Home  >  Q&A  >  body text

iOS中APP在前台运行,我在个推上发推送消息,为什么不走didReceiveRemoteNotification方法?

iOS中APP在前台运行,我在个推上发推送消息,为什么不走application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo方法,
但是我把App压入后台,在个推上发推送消息,就走application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo方法?
求大神们,指点!

PHP中文网PHP中文网2741 days ago637

reply all(2)I'll reply

  • 阿神

    阿神2017-04-17 17:32:42

    Did you not add this sentence when pushing in the background: payload.setContentAvailable(1); Take a look at the description of the push, https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ ApplePushService.html

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 17:32:42

    What he said is that when the front desk is running, not when pushing, big brother

    reply
    0
  • Cancelreply