![](/img/trans.png)
[英]didReceiveRemoteNotification not being called when I tap on app icon after receiving a push notification while on background
[英]Push Notification not calling didReceiveRemoteNotification when app in background
我有一個iOS應用,我從服務器收到推送通知。 我已將要發送給APNS的json的content-available設置為1,還為我的應用程序中的后台功能設置了標志。
推送通知到來,但是當應用程序在后台運行時,didReceiveRemoteNotification不被調用-我確實需要這樣做,因為我想為用戶顯示橫幅。
誰能告訴我我在做什么錯?
謝謝
通知:
aps = { alert = { "action-loc-key" = "This is button message"; body = "This is an iOS message"; }; badge = "-1"; sound = default; "content-available" = 1 };
如果應用程序處於后台模式,則在出現推送通知時不會自動調用方法- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
。
僅當用戶點擊推送通知警報或橫幅時,才調用此方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.