Re: firebase_messaging with iOS ANS

60 views
Skip to first unread message

Tom Gilmour

unread,
Mar 4, 2020, 11:57:42 AM3/4/20
to Andrew King, Flutter Development (flutter-dev)
Hi,

Not sure if this is your issue, but keep in mind that iOS push
notifications don't work on iOS emulators. You might want to use a
try/catch block to help debug:

void initFBM() async {
try {
if (await _fbm.requestNotificationPermissions()) {

_fbm.configure(
onMessage: (Map<String, dynamic> message) async {},
onBackgroundMessage: myBackgroundMessageHandler,
onLaunch: (Map<String, dynamic> message) async {},
onResume: (Map<String, dynamic> message) async {},
);
} else {}
} catch (err) {
print('Emulator detected : $err');
}
;
}

On Wed, Mar 4, 2020 at 8:10 AM Andrew King <aki...@gmail.com> wrote:
>
> Title should read APN, Apple Push Notification not ANS
>
> On Wednesday, 4 March 2020 17:07:43 UTC+1, Andrew King wrote:
>>
>> Hello
>> I'm trying to get firebase_messaging to work before incorporating it into other projects. It runs fine in Android, but not iOS. I follow the steps in firebase_messaging and this tutorial (https://medium.com/@SebastianEngel/easy-push-notifications-with-flutter-and-firebase-cloud-messaging-d96084f5954f) and I've looked at others. When I run the the project in Android Studio the build process generates an app that opens and closes immediately, with no feedback about what went wrong. My knowledge of Xcode is virtually 0 so I don't know where to look for debugging help.
>>
>> flutter doctor -v
>> [✓] Flutter (Channel unknown, v1.12.16, on Mac OS X 10.15.3 19D76, locale en-GB)
>> • Flutter version 1.12.16 at /Users/andrew/development/flutter
>> • Framework revision 37f9c54116 (3 months ago), 2019-11-27 11:33:38 -0800
>> • Engine revision fad1b23c42
>> • Dart version 2.7.0
>>
>>
>> [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
>> • Android SDK at /Users/andrew/Library/Android/sdk
>> • Android NDK location not configured (optional; useful for native profiling support)
>> • Platform android-28, build-tools 28.0.3
>> • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
>> • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
>> • All Android licenses accepted.
>>
>> [✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
>> • Xcode at /Applications/Xcode.app/Contents/Developer
>> • Xcode 11.3.1, Build version 11C504
>> • CocoaPods version 1.9.0
>>
>> [✓] Android Studio (version 3.6)
>> • Android Studio at /Applications/Android Studio.app/Contents
>> • Flutter plugin version 44.0.2
>> • Dart plugin version 192.7761
>> • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
>>
>> [✓] Connected device (1 available)
>> • Reflex iPad • 407429d9f9469f75ddb180966bc82e591125afeb • ios • iOS 13.3.1
>>
>> • No issues found!
>>
>> Does anyone know what I can try next?
>>
>> Thanks for any help
>>
> --
> You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/8cf4a422-4311-4d14-9e45-164fcc1f0036%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages