簡體   English   中英

當我發送 localNotification 時 OnNotification() 函數不起作用

[英]OnNotification() function dosen't work when i send localNotification

我正在使用 react-native-push-notification 來實現推送通知,當我發送遠程通知 OnNotification() 被正確調用時,我正確地遵循了文檔,但是當我使用 PushNotification.LocalNotification() 發送 LocalNotification 時,我得到了正確的通知彈出窗口但它不會觸發 OnNotification() 函數,我已經解決了很多 stackoverflow 問題和 git 問題仍然沒有解決方案,任何人都可以在這個問題上有解決方案,這會很有幫助

對於 ios,當您單擊通知並從已終止狀態啟動應用程序時,此方法將觸發/回調

 PushNotificationIOS.getInitialNotification().then(notification => {
     if (!notification) {
      return;
   }
 });

我剛剛在發布模式下實施和測試,效果很好。 對於 Andriod,我仍在弄清楚哪種方法會在終止狀態下觸發回調。

注意:以上代碼僅適用於 iOS 的發布模式。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM