如何在打開應用程序時獲取推送通知。僅當應用程序關閉或在後臺時才獲取推送通知。在應用程序在目標c中打開時獲取PushNotification
0
A
回答
0
當應用程序是背景或前景時應用沒有存儲器
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler
將被調用,需要在其上打開的應用程序,並需要處理它
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
推送通知的用戶交互
0
您的問題並不十分清楚,但是如果您要在通知窗口中顯示通知,即使您的應用程序處於活動狀態,您也需要處理相同的問題
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)pushMessage
併發布具有相同有效負載的新本地通知。然後你就可以處理在
- (void)application:(UIApplication *)app didReceiveLocalNotification:(UILocalNotification *)notif
0
一般來說,如果應用程序在前臺運行,iOS的不 顯示通知橫幅/ alert.That的由design.When應用程序是在forground,如果你想顯示推送通知,您可以使用iOS 10的UserNotification Framework,並將通知顯示或顯示爲banner.also您可以使用UILocalNotification來實現此目的。主要我們使用didReceiveRemoteNotification方法來實現此目的。現在我們擁有iOS 10的UIUserNotification方法。
When application is foreground and background state getting push notification
在IOS 0 thisfeature+0
而不是鏈接到堆棧溢出中的其他帖子的答案,投票結束這個問題的重複。 – JAL
相關問題
- 1. 如何在應用程序打開時獲取鍵盤高度
- 2. 在打開應用程序時獲取當前位置
- 3. 在打開應用程序時自動獲取當前位置
- 4. 從C++應用程序打開目標c窗口
- 5. 在應用程序中打開,從launchOptions中獲取UIApplicationLaunchOptionsURLKey
- 6. Phonegap PushNotification打開特定的應用程序頁面
- 7. 如何在「打開」中獲取我的應用程序
- 8. 在WPF應用程序中獲取打開的Forms-Windows
- 9. 目標C-從主屏幕滑動打開應用程序
- 10. 應用程序在打開時崩潰
- 11. 如何在C#應用程序中從FireFox獲取已打開的URL
- 12. 如何從其他應用程序打開ACTIVE應用程序時獲取fileURL
- 13. 獲取打開文件的默認應用程序的圖標
- 14. C# - UWP打開時對應用程序的任務欄圖標
- 15. 在目標c(Mac OSX)上打開應用程序的URL事件
- 16. 在C#中獲取程序圖標?
- 17. 在Android中打開的應用程序中查看應用程序圖標
- 18. Android應用程序在共享文件時在舊應用程序中打開
- 19. 如何在像目標c HandleOpenURL Marmalade 6.3中獲取應用程序的URL?
- 20. WPF應用程序在單擊桌面圖標時未打開
- 21. 控制檯在運行GUI C++應用程序時打開
- 22. 獲取在C#應用程序
- 23. 在Android應用程序中打開URL
- 24. 在iPhone應用程序中打開iCloud.app
- 25. 在iOS應用程序中打開URL
- 26. 在iPhone應用程序中打開iBooks
- 27. 在Iframe中打開Express應用程序
- 28. 在firefox中打開oracle應用程序
- 29. 在html中打開Twitter應用程序
- 30. Evernote在應用程序中打開
,如果你想在其他iOS版本可用比你創建自己的notificationview檢查這個http://stackoverflow.com/questions/14872088/get-push-notification-while-app -in-foreground-ios – iOS