jjzjj

didReceiveRemoteNotification

全部标签

iphone - 从 didReceiveRemoteNotification 打开 View

这个问题我被问过几次,我尝试了几种不同的方法,但都没有成功。我试过的最新方法如​​下:我包括了我想展示的ViewController。然后,我将此代码放入didReceiveRemoteNotification方法中。CarFinderViewController*pvc=[[CarFinderViewControlleralloc]init];//[self.window.rootViewControllerpresentViewController:pvcanimated:YEScompletion:nil];[(UINavigationController*)self.windo

ios - application : didReceiveRemoteNotification: fetchCompletionHandler: called more than once. 如何避免?

我有一个应用程序,它使用远程/推送通知。使用远程通知的后台模式,一切正常。应用程序唤醒并从服务器获取所有需要的数据。但是如果通知中心没有清除推送通知警报,并且用户点击它application:didReceiveRemoteNotification:fetchCompletionHandler:方法将再次被调用,这意味着它将向服务器发送新的请求,并且这是不受欢迎的行为。第一个选项是检查应用程序状态,但是当应用程序处于暂停状态时,这会给我带来问题。我必须执行类似下面代码的操作,但这对我不起作用:if([UIApplicationsharedApplication].application

ios - CloudKit iOS 9.0 didReceiveRemoteNotification 在 iOS 9.3 发布后未调用

我有一个装有iOS9.0的iPodTouch,它在iOS9.3发布后没有收到CloudKitCKSubscription推送通知。我装有iOS9.3的iPad可以正常接收通知,使用相同版本的应用程序。有人知道这是怎么回事吗?某些CloudKit版本是否不再向旧版本推送通知?当我在我的iPodTouch上删除并重新安装该应用程序时,我点击“允许”以允许推送通知,但是如果我在我的CloudKit仪表板中进行任何记录更改,只有我的iPad会收到推送通知,而didReceiveRemoteNotification甚至都不会在我的iPodTouch上打电话。funcapplication(app

objective-c - didReceiveRemoteNotification 没有被调用

我正在iOS/android中创建应用程序。当设备收到远程通知时,应该调用didReceiveRemoteNotification。但它没有发生。我通过APNS发送消息的服务器端代码如下:$deviceToken=$obj_listener->ref_id;//Putyourprivatekey'spassphrasehere:$passphrase='blahblah';$ctx=stream_context_create();stream_context_set_option($ctx,'ssl','local_cert','/var/www/mobileapp/TestAppCK

ios - 接入点 : didReceiveRemoteNotification:fetchCompletionHandler did not run when app is in background (unless xcode is debugging)

我在运行iOS8.1的iPad2中遇到有关APNS的问题。我在谷歌上搜索了几天并尝试了所有我能找到的解决方案。但是我似乎无法解决这个问题。我做了什么:启用的功能:远程通知、后台获取我在aps负载中有“content-available=1”。我在didReceiveRemoteNotification:fetchCompletionHandler中使用了NSLog(),这样我可以在设备日志中清楚地看到该方法是否被触发我想做的事情:我想在后台收到APNS时执行网络请求。我相信我可以使用beginBackgroundTaskWithExpirationHandler和东西很好地处理那部分。

ios - 不会为每个推送通知调用 didReceiveRemoteNotification

似乎如果我同时向同一设备发送多个推送通知,则不会为每个发送的通知调用didReceiveRemoteNotification。假设我发送了6个通知,didReceiveRemoteNotification平均只被调用3次。那就是应用程序当前是否正在运行。但是,如果我在应用程序之外并发送6个推送通知,所有推送通知都会发送到通知中心/锁定屏幕。这是预期的行为吗? 最佳答案 这是预期的行为:ApplePushNotificationserviceincludesadefaultQualityofService(QoS)componentt

ios - 为什么 didReceiveRemoteNotification :fetchCompletionHandler is called but usual didReceiveRemoteNotification isn't?

在我的应用程序中,我有两种类型的推送通知:带有content-available=1标志的远程静默通知和带有body、badge和其他东西。我还定义了两个委托(delegate)方法didReceiveRemoteNotification:fetchCompletionHandler和常用的didReceiveRemoteNotification。但是当没有content-available标志的推送通知到达时,调用didReceiveRemoteNotification:fetchCompletionHandler,而不是didReceiveRemoteNotification。如何

ios - didReceiveRemoteNotification 在 Firebase 与 Push 框架一起使用时未调用

我正在使用Firebase进行分析,并使用库进行推送通知。当我使用它们中的任何一个时,都会调用didReceiveRemoteNotification。但是当我同时使用它们时,didReceiveRemoteNotification不会被调用。代码:didFinishLaunchingWithOptions:NSString*google_app_id=@"----";NSString*gcm_sender_id=@"----";FIROptions*o=[[FIROptionsalloc]initWithGoogleAppID:google_app_idGCMSenderID:gcm

ios - didReceiveRemoteNotification 或 ReceivedRemoteNotification 从不触发

由于某些原因,didReceiveRemoteNotification或ReceivedRemoteNotification永远不会触发;当我前一段时间实现它时,它很好,至少当我在应用程序处于后台时测试它时是这样。现在2周后,我的应用程序更加成熟,我回到了推送通知部分,却发现在特定时刻没有触发事件。设备正在接收推送通知弹出窗口,当我单击它时,应用程序打开,但didFinishLaunchingWithOptionslaunchOptions为nil。什么可能导致它停止工作?启用推送通知已启用后台模式(远程通知和后台获取)在didFinishLaunchingWithOptions中:i

ios - 如何从 didReceiveRemoteNotification 返回数据中获取数据?

使用swift3在​​xcode8上运行下面是我在AppDelegate.swift中的代码funcapplication(_application:UIApplication,didReceiveRemoteNotificationuserInfo:[AnyHashable:Any],fetchCompletionHandlercompletionHandler:@escaping(UIBackgroundFetchResult)->Void){print("====didReceiveRemoteNotification====")print(userInfo)}当我收到通知并单击