简体   繁体   中英

fcm onMessage works on simulator but does not work in physical device

I am a web developer trying to build a simple hybrid webview app with push notification. So I used flutter and firebase-cloud-messaging . The android side works fine in both emulator and on a physical android phone.

But for ios I have a problem. The onMessage callback works in the simulator and generates a AlertDialog . But when I test it on a physical iphone, it doesnt work. Nothing pops up. The other callbacks do work( onLaunch , onResume ). Another weird part, is that as soon as the test app is installed on the physical device, the terminal loses connection to the device. So I cannot even see the error logs.

For me, It depends on version of
implementation 'com.google.firebase:firebase-messaging:20.1.0' on build.gradle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM