当应用程序未在前台或后台运行时,我们是否可以接收远程推送通知?基本上应用程序被杀害?远程推送通知
Q
远程推送通知
0
A
回答
0
0
如果在应用程序未运行时应用程序的通知到达,则设备会通知用户应用程序有数据正在等待它。
0
如果收到消息,它将不会启动您的应用程序,它由iOS处理。
如果用户选择查看通知,那么您的应用将会启动。因此,如果用户没有对通知做出反应,您的应用将不会启动。 如果当用户选择为您的应用推送通知的iOS启动您的应用程序,你将不得不检查lauchOptions dictonary,看看是否有任何推送通知:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
_rootViewController = [[RootViewController alloc] init];
self.window.rootViewController = self.rootViewController;
NSDictionary *remoteNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (remoteNotif) {
//Handle notification
}
}
如果您的应用程序已经在运行,并在前台比应用程序代表将直接收到通知。在您的应用程序委托上调用方法- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
。
相关问题
- 1. 远程推送通知
- 2. 推远程通知
- 3. iOS8 - 询问远程推送通知
- 4. 的iOS:处理远程(推送)通知
- 5. 远程推送通知操作
- 6. 应该iOS上的远程通知触发推送通知UIApplicationWillResignActiveNotification?
- 7. iOS推送通知和远程通知的区别?
- 8. Xcode6 Swift添加远程推送通知并从PHP发送
- 9. 向特定用户发送远程推送通知
- 10. 推送推送通知
- 11. 推送通知教程
- 12. Skygear推送通知教程
- 13. iPhone推送通知程序
- 14. iOS推送通知流程
- 15. 从AppDelegate通过远程通知推送到UINavigationController
- 16. 推送通知
- 17. 推送通知
- 18. 推送通知
- 19. 推送通知
- 20. 推送通知
- 21. 推送通知
- 22. 推送通知
- 23. 想要同时使用基于应用程序状态的无声推送通知和远程推送通知
- 24. 远程推送通知和终止的应用程序
- 25. ORM和推送远程exe应用程序的通知
- 26. 通过(远程)推送通知触发的锁定屏幕上的通知?
- 27. “暖”推出推送通知
- 28. 让用户安排时间不接收远程推送通知
- 29. Phonegap构建无插件的远程推送通知?
- 30. IOS推送通知smartface 4.3注册和远程令牌
可能的重复[我应该如何处理推送通知,当我的应用程序不运行](http://stackoverflow.com/questions/4782352/how-can-i-handle-push-notification-when-my-app - 未运行) – bernie 2012-04-24 16:51:01