mwaylabs / flutter-apns Goto Github PK
View Code? Open in Web Editor NEWFlutter Plugin for Push notification servers
License: MIT License
Flutter Plugin for Push notification servers
License: MIT License
I don't understand why, but it looks like i can't get the Apns Token from the connector.token.
Every time i tried this on a IOS simulator it print nothing .
And even if i tried it on a real IOS device, it's still not working.
@override
void initState() {
super.initState();
getIOSPermission() {
_firebaseMessaging.requestNotificationPermissions(
IosNotificationSettings(alert: true, badge: true, sound: true));
_firebaseMessaging.onIosSettingsRegistered.listen((settings) {
print("Settings registered:$settings");
});
}
if (Platform.isIOS) {
getIOSPermission();
connector.requestNotificationPermissions();
}
connector.token.addListener(() {
print('Apns Token ${connector.token.value}');
usersRef.document(firebaseUser.uid).updateData(
{"IOsToken": connector.token.value});
})
_firebaseMessaging.configure(
onLaunch: onPush,
onResume: onPush,
onMessage: onPush,
onBackgroundMessage: onBackgroundPush,
);
}
ive enable all (enable Push Notifications and Background Modes, and enable Background fetch and Remote notifications under Background Modes.) and followed all the firebase messaging instruction and APNS IOs configure steps.
I'm not using connector .config method, is it a problem ?
Any help would be nice,
how to get iOS: Rich Notifications? any configuration extension file can be updated in it?
New version contains a lot of improvements and fixes, please add its support in separated branch or release.
Hey, I'm not getting any value back on the connector.token listener.
Currently on version 1.0.4 of the library and iOS 13.1.2 (physical device).
I've tried with the example app as well and I'm never getting a token back.
On the beta channel, the latest release (1.11.0) throws this error during flutter analyze:
Couldn't read file LocalFile:
'.../dev/lib/flutter/.pub-cache/git/flutter-apns-7f918932cf8bb9f283c19bab728ac557ff4a1141/android/src/main/kotlin/com/mwaysolutions/flutter/apns/FlutterApnsPlugin.kt' even though it exists. Please verify that this file has read permission and try again.
It is looking for a kotlin file, but there is no kotlin in the project.
i'm going to fork and add the actions buttons for the library, have you already considered this feature?
First of all, thank you very much for your service!
I'm trying to get the device token running through Xcode Iphone Simulator, but I'm not being able of getting the device token.
connector.token.addListener(() { print('Token ${connector.token.value}'); }); connector.requestNotificationPermissions();
Thanks!
When running my app on an iOS 14.4 emulator, the build succeeds but then connection to the device is immediately lost, and I get the following output in my Android Studio console:
Connected to _flutterView/0x7fba6a021e20.
[+3979 ms] Assertion failed: file flutter_apns/FlutterApnsPlugin.swift, line 100
[ +11 ms] Service protocol connection closed.
[ ] Lost connection to device.
I am using v 1.4.1 of the plugin
My flutter doctor output:
[✓] Flutter (Channel stable, 2.0.6, on macOS 11.2.1 20D74 darwin-x64, locale en-GB)
• Flutter version 2.0.6 at /Users/nicholaslatham/flutter/flutter
• Framework revision 1d9032c7e1 (3 weeks ago), 2021-04-29 17:37:58 -0700
• Engine revision 05e680e202
• Dart version 2.12.3
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/nicholaslatham/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 51.0.1
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • DDBF54B9-78B5-44DC-A50E-1D1238A25B57 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• No issues found!
Is this maybe related to :
I would like to use the apns token to use my own server to send push notifications.
But in addition, i would like to send firebase push notification for other "marketing" push notification.
Do you think it would be possible to provide both tokens in case of iOS platform (apns + firebase) ?
I've created a fork of this plugin to update the firebase_messaging version to 9.0.0, as there are breaking changes compared to the version 7.0.0. I've updated the code accordingly. Please check the pull request.
ios存在获取不到token的情况,请问一下是什么原因
When I swipe up app. I click the notification, but app doesn't wake up. It just like crash. I ran the example code.
Hi,
Thanks for your work!
I'd like to report that you're missing background message handling for firebase.
Can you please add it, or at least add support for only handling apns, letting users configure firebase directly through firebase-messaging?
Thanks again,
Regards
It's look like the onResume and onLaunch is duplicate on IOS. it trigger both when app is terminated.
APNS version : latest
IOS Version : 13.5.1
-Flutter doctor
`[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.4 19E258a, locale en-US)
• Flutter version 1.20.4 at /Applications/AndroidProject/flutter
• Framework revision fba99f6cf9 (3 weeks ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/apple/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Users/apple/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
✗ Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.9.3
[✓] Android Studio
• Android Studio at /Applications/Android Studio 4.1 Preview.app/Contents
• Flutter plugin version 45.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
`
Hello,
I'm having the issue with push notifications: no notifications when my app is in foreground (also no callbacks onMessage
).
Also onPush
is never called, but my app receives push notifications when it's in background.
I'm using flutter_apns: 1.4.1, Flutter 2.0.0
Here is the code I use (it's 99% from the example):
void main() {
...
WidgetsFlutterBinding.ensureInitialized();
...
}
Future<void> initPush() async {
final connector = createPushConnector();
if (connector is ApnsPushConnector) {
connector.shouldPresent = (x) => Future.value(true);
}
connector.configure(
onLaunch: (data) => onPush('onLaunch', data),
onResume: (data) => onPush('onResume', data),
onMessage: (data) => onPush('onMessage', data),
onBackgroundMessage: _onBackgroundMessage,
);
connector.token.addListener(() async {
print('${connector.token.value}');
});
connector.requestNotificationPermissions();
}
Future<dynamic> onPush(String name, Map<String, dynamic> payload) {
print('$payload');
final action = UNNotificationAction.getIdentifier(payload);
if (action == 'MEETING_INVITATION') {
print('MEETING_INVITATION');
}
return Future.value(true);
}
Future<dynamic> _onBackgroundMessage(Map<String, dynamic> data) =>
onPush('onBackgroundMessage', data);
Any ideas what can be wrong?
Looks like iOS 13 changed the token description field, see this discussion:
Token is coming back from flutter_apns looking like this:
"{length=32,bytes=0x01a066cdf7e5aaaeb9b5fbdcd4a94987...c96abee0ef5cb5e0}"
Ellipsis is really there, so we don't even get the full token that we could parse out of that.
Hey guys, first of all thank you so much for this repo, it helped my company a lot! I did have one issue that I resolved for iOS: push notifications weren't showing when the app was in foreground and there was no configuration option for it built into this plugin. Please take a look at my changes (two commits) here and it'd be fantastic to see this as an option moving forward:
https://github.com/FloPMT/flutter-apns/commits/master
connector.token.addListener((){ print('Token ${connector.token.value}); });
Returns nothing
Using flutter_apns: ^1.1.0
Pubspec.lock has firebase_messaging: 6.0.13
I can't found way to call fcm (FirebaseMessaging) functions. For example deleteInstanceId().
On iOS app Foreground apns messages are received. But when I close app, they are not. Everything's works great again, after I open app. Is it some bug or I am just missing something?
I have this problem when add this with firebase_messaging.it throw the exception
Unhandled Exception: MissingPluginException(No implementation found for method getToken on channel plugins.flutter.io/firebase_messaging) #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7) <asynchronous suspension> #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12) #2 FirebaseMessaging.getToken (package:firebase_messaging/firebase_messaging.dart:150:27) #3 _LoginFormState.validateToLogin (package:comanager/ui/login/login_form.dart:49:36) #4 _LoginFormState.build.<anonymous closure>.<anonymous closure> (package:comanager/ui/login/login_form.dart:269:32) #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:992:19) #6 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1098:38) #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:184:24) #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:524:11) #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:284:5) #10 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:256:7) #11 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:158:27) #12 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:224:20) #13 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22) #14 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:158:7) #15 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:104:7) #16 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:88:7) #17 _rootRunUnary (dart:async/zone.dart:1206:13) #18 _CustomZone.runUnary (dart:async/zone.dart:1100:19) #19 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7) #20 _invoke1 (dart:ui/hooks.dart:267:10) #21 _dispatchPointerDataPacket (dart:ui/hooks.dart:176:5)
Flutter doctor
`[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/apple/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Users/apple/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
✗ Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.9.3
[✓] Android Studio
• Android Studio at /Applications/Android Studio 4.1 Preview.app/Contents
• Flutter plugin version 45.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
`
flutter-apns
has intrinsic dependency on firebase_messaging^7.0.0
.
And firebase_messaging^7.0.0
doesn't allow for the app to be compiled with firebase_core: 0.7.0
.
Pub get
error log:
Because firebase_messaging >=7.0.0 <7.0.3 depends on firebase_core ^0.5.0 and no versions of firebase_messaging match >7.0.3 <8.0.0, firebase_messaging >=7.0.0 <7.0.3-∞ or >7.0.3 <8.0.0 requires firebase_core ^0.5.0.
And because firebase_messaging 7.0.3 depends on firebase_core ^0.5.0+1, firebase_messaging ^7.0.0 requires firebase_core ^0.5.0.
Because no versions of flutter_apns match >1.4.1 <2.0.0 and flutter_apns 1.4.1 depends on firebase_messaging ^7.0.0, flutter_apns ^1.4.1 requires firebase_messaging ^7.0.0.
Thus, flutter_apns ^1.4.1 requires firebase_core ^0.5.0.
So, because mymilkman depends on both firebase_core ^0.7.0 and flutter_apns ^1.4.1, version solving failed.
pub get failed (1; So, because mymilkman depends on both firebase_core ^0.7.0 and flutter_apns ^1.4.1, version solving failed.)
I added code below to AppDelegate.swift following README.md.
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
Then I found that connector.configure(~) method didn't be called.
When I deleted it from AppDelegate.swift, connector.configure was called.
So I think there may be mistake in README.md.
Hi,
I just wanted to know if The Apns Token get by listening the connector.token is the same that Fcm.getToken method return ?
Because right know i'm using FCM, it works fine for Android but when it comes to IOS, i get messaging/registration-token-not-registered Error by FCM console when trying to send a notification.
So what i'm trying to do is to use directly the native ways of Apple to see if it can work.
Do i also have to change _firebaseMessaging.configure() with connector.configure() or i can keep my firebaseMessaging.configure even with IOS ?
iOS is giving following exception while initialising firebase,
[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)
#0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:157
<asynchronous suspension>
#1 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:332
#2 MethodChannel.invokeListMethod
package:flutter/…/services/platform_channel.dart:345
#3 MethodChannelFirebase._initializeCore
package:firebase_core_platform_interface/…/method_channel/method_channel_firebase.dart:30
#4 MethodChannelFirebase.initializeApp
package:firebase_core_platform_interface/…/method_channel/method_channel_firebase.dart:75
#5 Firebase.initializeApp
package:firebase_core/src/firebase.dart:43
#6 main
package:Rastrack/main.dart:260
#7 _rootRunUnary (dart:async/zone.dart:1198:47)
#8 _CustomZone.runUnary (dart:async/zone.dart:11<…>
Pub versions:
flutter_apns: ^1.4.1
firebase_core: ^0.7.0
I'm using firebase_messaging 6.0.9.
I've noticed notifications on Apple devices are spotty at best and wanted to try APNS.
When installing this plugin below is the trace:
[app] flutter packages get
Running "flutter pub get" in app...
Because app depends on flutter_apns ^1.0.5 which depends on firebase_messaging ^5.1.8, firebase_messaging ^5.1.8 is required.
So, because app depends on firebase_messaging ^6.0.9, version solving failed.
pub get failed (1; So, because app depends on firebase_messaging ^6.0.9, version solving failed.)
exit code 1
Because flutter_apns 1.1.0 depends on firebase_messaging ^6.0.9 and no versions of flutter_apns match >1.1.0 <2.0.0, flutter_apns ^1.1.0 requires firebase_messaging ^6.0.9.
So, because app depends on both firebase_messaging ^7.0.0 and flutter_apns ^1.1.0, version solving failed.
Hi, I cloned this repository but it won't run for some reason, please help.
Pod install is not working either
P.s. This may be due to the fact that I have a MacBook with chip m1
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
lib/main.dart
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Finding Podfile changes
- Flutter
- firebase_core
- firebase_messaging
- flutter_apns
- flutter_local_notifications
- path_provider
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_messaging` from `.symlinks/plugins/firebase_messaging/ios`
firebase_messaging: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
-> Fetching podspec for `flutter_apns` from `.symlinks/plugins/flutter_apns/ios`
-> Fetching podspec for `flutter_local_notifications` from `.symlinks/plugins/flutter_local_notifications/ios`
-> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: Specs/0/3/5/Firebase/7.3.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: Specs/0/3/5/Firebase/6.26.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: all_pods_versions_8_b_d.txt exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: Specs/8/b/d/FirebaseCore/7.3.0/FirebaseCore.podspec.json exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: Specs/0/3/5/Firebase/6.26.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
### Command
```
/usr/local/bin/pod install --verbose
```
### Report
* What did you do?
* What did you expect to happen?
* What happened instead?
### Stack
```
CocoaPods : 1.10.0
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
RubyGems : 3.0.3
Host : macOS 11.1 (20C69)
Xcode : 12.3 (12C33)
Git : git version 2.24.3 (Apple Git-128)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ 46723fe3a20b5da6a2bf5d170f680690d106c0dd
trunk - CDN - https://cdn.cocoapods.org/
```
### Plugins
```
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.1.0
cocoapods-trunk : 1.5.0
cocoapods-try : 1.2.0
```
### Podfile
```ruby
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
```
### Error
```
LoadError - dlsym(0x7fc2e3d12860, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:6:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:440:in `download_typhoeus_impl_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:372:in `download_and_save_with_retries_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:365:in `download_file_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:338:in `download_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:284:in `ensure_versions_file_loaded'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:208:in `search'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/source/aggregate.rb:83:in `select'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/source/aggregate.rb:83:in `search'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:416:in `create_set_from_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:385:in `find_cached_set'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:360:in `specifications_for_dependency'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:165:in `search_for'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:274:in `block in sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:267:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:267:in `sort_by'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:267:in `sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:53:in `block in sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:70:in `with_no_such_dependency_error_handling'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:52:in `sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:754:in `push_state_for_requirements'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:746:in `require_nested_dependencies_for'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:729:in `activate_new_spec'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:686:in `attempt_to_activate'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:414:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
```
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=dlsym%280x7fc2e3d12860%2C+Init_ffi_c%29%3A+symbol+not+found+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.13.1%2Flib%2Fffi_c.bundle&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
Found no similar issues. To create a new issue, please visit:
https://github.com/cocoapods/cocoapods/issues/new
Error running pod install
Error launching application on iPhone 12 Pro Max.
Exited (sigterm)
onMessage does not get called on iOS.
I've got notifications set up correctly and working. I'm using onResume and onLaunch well to open up a specific route in my application, yet, I just want to print something or add the data I receive on onMessage, and nothing happens.
The firebase messaging plugin was updated in version 7.0.0 to use firebase_core features. It would be nice if the apns plugin would allow to use the updated version of firebase messaging. As there were no breaking changes, this shouldn't make any problems.
Currently a dependency resolution error is displayed when one tries to change the firebase messaging version to 7.0.0.
Hi, could anyone tell me please how to get firebase working on ios? I got firebase messaging etc. installed, but messages are only going through in simulators and if the app is in foreground. I tried getting it to work with flutter_apns but there I'm stuck at getting the token. But there it's only returning flutter: ValueNotifier<String># **some random value** (null)
. Does anyone know how to at least get the token and from then on, maybe get everything to work?
Thanks
connector.token.addListener
works fine for me on debug build and I am receiving APNS token. But on release build listener by some reason isn't working.
Flutter 1.6.7 • channel dev • https://github.com/flutter/flutter.git
Framework • revision cba41ca2ec (6 weeks ago) • 2019-05-30 12:04:01 -0700
Engine • revision 58eff77ef2
Tools • Dart 2.3.2 (build 2.3.2-dev.0.0 fee615c5a5)
Compiler message:
file:///Users/elvin/.pub-cache/hosted/pub.flutter-io.cn/flutter_apns-1.0.0/lib/apns_connector.dart:5:1: Error: 'MessageHandler' is imported from both 'package:flutter_apns/connector.dart' and 'package:flutter/src/services/binary_messenger.dart'.
import 'package:flutter/services.dart';
We tracked down reports from users that received duplicate push-notifications on iOS from our notification-service. It turned out, we received differently formatted tokens from this library recently.
Looks like this change is the culprit:
4581b17c59b893853af91e6799dedf3b162695b9 (FlutterApnsPlugin.m :: stringWithDeviceToken)
(hexString changed while it got ported from obj-c to swift)
We stored them as is, without further deduplication in the assumption they should be treated as opaque. Obviously, this assumption was wrong - at least for iOS.
I think what's missing here ist:
hexString
, so it doesn't change again accidentally and is always hex-encodedThis is a feature request. I would like to be able to change the displayed content of a push notification as mentioned in this article:
This becomes necessary if you receive encrypted messages or if the message only contains a technical message id and the client needs to load the actual message content in a subsequent step. It would be great if one could register a Flutter callback function (similar to onbackgroundMessage from firebase_messaging) that is called when a push notification is received. The function would return the content that should be displayed in the notification instead of the original data in the notification dictionary.
I'm using Flutter beta: v1.24.0-10.2.pre. Seems like addListener never call and never get token. I already add the log error in AppDelegate.swift but still not get any error from console log application. Note that I'm testing on real device.
I believe this is related to this issue, firebase/flutterfire#188 just recently( the 19th ), firebase_messaging was upgraded, however, on android using Flutter 1.7 ( not the latest upgrade 1.9 ). I receive this error using flutter-apns 1.0.2.
error: method findAppBundlePath in class FlutterMain cannot be applied to given types;
String appBundlePath = FlutterMain.findAppBundlePath();
^
required: Context
found: no arguments
reason: actual and formal argument lists differ in length
1 error
Finished with error: Gradle task assembleDebug failed with exit code 1
Reverting flutter-apns to 1.0.1 seems to work for android, but does not seem to compile properly on iOS.
We are not ready to update to flutter 1.9( if this is truly the issue ), changing the firebase_messaging include in flutter-apns pubspec.yaml to be "5.1.3" rather than "^5.1.3" seems to fix this issue when I build flutter-apns as a local plugin.
No pending snapshot to activate. SDK name: app_measurement
Can I handle notification on background with this plugin for IOS ?
I know that using fcm I can't but can I with flutter APNs ?
I also wanted know if there is the same issue with auto cleaning notifications when entering foreground (iOS) using this plugin.
MaikuB/flutter_local_notifications#134
MaikuB/flutter_local_notifications#641
This issue seem to be link to fcm but since here it's not fcm could it solve the issue ?
Hi
do you support receiving messages in IOS both from firebase and apns?
Regards,
I did the whole process and it works perfectly, onMessage, onResume.
onLaunch is not called when the app is closed, see my implementation:
import 'package:flutter_apns/apns.dart';
import '../utilities/notifications.dart';
class PushNotificationService extends GetxService {
String token;
bool isAction = false;
Future initNotification() async {
print('PUSH - INICIALIZADO');
final connector = createPushConnector()
connector.configure(
onMessage: (Map<String, dynamic> message) {
print('PUSH - onMessage');
String title, body, action;
if (connector is ApnsPushConnector) {
title = message['aps']['alert']['title'] ?? '';
body = message['aps']['alert']['body'] ?? '';
action = message['aps']['action'] ?? '';
} else {
title = message['data']['title'] ?? '';
body = message['data']['body'] ?? '';
action = message['data']['action'];
}
}
return Future.value();
},
onBackgroundMessage: (Map<String, dynamic> message) async {
print('PUSH - onBackgroundMessage');
String action;
if (connector is ApnsPushConnector) {
action = message['aps']['action'] ?? '';
} else {
action = message['data']['action'] ?? '';
}
},
onLaunch: (Map<String, dynamic> message) async {
print('PUSH - onLaunch');
String action;
if (connector is ApnsPushConnector) {
action = message['aps']['action'] ?? '';
} else {
action = message['data']['action'] ?? '';
}
},
onResume: (Map<String, dynamic> message) async {
print('PUSH - onResume');
String action;
if (connector is ApnsPushConnector) {
action = message['aps']['action'] ?? '';
} else {
action = message['data']['action'] ?? '';
}
return Future.value();
},
);
connector.token.addListener(() {
try {
token = connector.token.value;
print('TOKEN: $token');
} catch (e) {}
});
connector.requestNotificationPermissions();
if (connector is ApnsPushConnector) {
connector.shouldPresent = (Map<String, dynamic> message) {
return Future.value(false);
};
}
token = connector.token?.value;
}
}
i got this message when trying to run my app in android , and when remove the plugin the app worked , this's the error :
> File '/myapp/build/apns_flutter/intermediates/local_only_symbol_list/debug/R-def.txt' specified for property 'localResourcesFile' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Adding this plugin to the pubspec.yaml (without even using or importing it anywhere), results in the exception below:
[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7)
<asynchronous suspension>
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
#2 MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:345:41)
#3 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:30:36)
#4 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:75:13)
#5 Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:25)
#6 main (package:mobile/main.dart:14:18)
#7 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:231:25)
#8 _rootRun (d<…>
In this project where the error occurs, I also import and use firebase_core
and firebase_auth
. The error occurs at the main()
function in main.dart
where I have the code below before calling the runApp()
method on my app.
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(); // <-- Error occurs here
I've tried your 1.4.0
, 1.3.1
, 1.3.0
and 1.0.5
releases to remedy the issue, and even created a new flutter project with the same lib/
and pubspec.yaml
to no avail.
The issue occurs with iOS, haven't tried with Android.
Hi so i saw this plugin a few days ago and decided to test it for iOS. The following is an overview of my project:
What im i doing wrong. Help.
Thanks in advance.
EDIT:
I get this error in XCode
"invalid capability (0x14) "Unable to insert COPY_SEND""
First off: Thank you for this plugin!
I am trying to use notifications on iOS and Android (via APNs and FCM), which I publish from Amazon AWS. When the app is running in the background (or is terminated), the notification pops in, which opens the app when I tap it. However, on iOS, none of the callback functions are ever called.
In the initState
function of my main widget, I initialize the PushConnector
as _messaging
. I then try to set the callback handlers, which does not work (on iOS).
_messaging.configure(
onMessage: (Map<String, dynamic> message) async {
print("onMessage: $message");
// further process message content
},
onBackgroundMessage: myBackgroundMessageHandler,
onLaunch: (Map<String, dynamic> message) async {
print("onLaunch: $message");
// further process message content
},
onResume: (Map<String, dynamic> message) async {
print("onResume: $message");
// further process message content
},
);
EDIT: myBackgroundMessageHandler
also does the same print, but the output is never shown either.
If anyone has any clue what could be causing this behaviour, I would be very grateful.
I haven't found this in the docs.
Is it possible to use this without method swizzling? I have some relevant methods that are already overridden so this would be the only way to make this work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.