![](/img/trans.png)
[英]Why does this code works on Xcode simulator, but does not work on device?
[英]fcm onMessage works on simulator but does not work in physical device
我是一名 web 開發人員,試圖構建一個帶有推送通知的簡單混合 webview 應用程序。 所以我使用了flutter
和firebase-cloud-messaging
。 android
端在模擬器和物理 android 手機上都可以正常工作。
但是對於ios我有一個問題。 onMessage
回調在模擬器中工作並生成AlertDialog
。 但是當我在物理 iphone 上測試它時,它不起作用。 什么都沒有彈出。 其他回調確實有效( onLaunch
, onResume
)。 另一個奇怪的部分是,一旦測試應用程序安裝在物理設備上,終端就會失去與設備的連接。 所以我什至看不到錯誤日志。
對我來說,這取決於版本
在 build.gradle 上implementation 'com.google.firebase:firebase-messaging:20.1.0'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.