【发布时间】:2014-03-26 17:20:53
【问题描述】:
我正在开发一个应用程序,我需要向应用程序发送推送通知以根据需要开始处理数据。
如何将push notification 发送到设备,而不是显示alert message,而是将notification 转发到应用程序——无论应用程序是在前台还是后台。
我确实实现了委托方法:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
但是,仅当应用程序位于 foreground 中时才会调用它。当应用程序位于 background 中时,notification 会显示在 notification center 上。
请指教。
【问题讨论】:
标签: ios iphone objective-c notifications push