本地通知启动 app 的状态
2016-06-27 12:33
489 查看
/** 程序从杀死到接收到消息打开通知的操作 */
- (void)DYApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
/** 程序杀死到启动 */
if (launchOptions[UIApplicationLaunchOptionsLocalNotificationKey]){// 程序关闭 点击程序图标启动程序
/** 取到通知 */
UILocalNotification * local = launchOptions[UIApplicationLaunchOptionsLocalNotificationKey];
[self PushWithIdentifiers:local.userInfo[DYIdentifierKey]];
}
UILocalNotification * local = launchOptions[UIApplicationLaunchOptionsLocalNotificationKey];
[self PushWithIdentifiers:local.userInfo[DYIdentifierKey]];
}
/** 程序从后台接收到通知到前台的操作 */
-(void)DYApplication:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{
if (application.applicationState == UIApplicationStateActive) {/** 程序在前台 */
// [self alertWithTitle:@"前台接收到了通知"];
}else if (application.applicationState == UIApplicationStateInactive){ /** 程序充从后台到前台 */
/** 根据数组的主播个数的不同 跳转不同的页面 */
[self PushWithIdentifiers:notification.userInfo[DYIdentifierKey]];
}
}
- (void)DYApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
/** 程序杀死到启动 */
if (launchOptions[UIApplicationLaunchOptionsLocalNotificationKey]){// 程序关闭 点击程序图标启动程序
/** 取到通知 */
UILocalNotification * local = launchOptions[UIApplicationLaunchOptionsLocalNotificationKey];
[self PushWithIdentifiers:local.userInfo[DYIdentifierKey]];
}
UILocalNotification * local = launchOptions[UIApplicationLaunchOptionsLocalNotificationKey];
[self PushWithIdentifiers:local.userInfo[DYIdentifierKey]];
}
/** 程序从后台接收到通知到前台的操作 */
-(void)DYApplication:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{
if (application.applicationState == UIApplicationStateActive) {/** 程序在前台 */
// [self alertWithTitle:@"前台接收到了通知"];
}else if (application.applicationState == UIApplicationStateInactive){ /** 程序充从后台到前台 */
/** 根据数组的主播个数的不同 跳转不同的页面 */
[self PushWithIdentifiers:notification.userInfo[DYIdentifierKey]];
}
}
相关文章推荐
- 使用Jenkins搭建构建机(二) Unity构建接口
- MadFinger Games
- ObjectOutputStream/ObjectInputStream
- 递归算法
- 【Unity Shaders】学习笔记——SurfaceShader(六)混合纹理
- Cocos studio v3.10记录(一)
- Android下拉刷新
- Android清除缓存
- 使用Jenkins搭建构建机(一) 部署Jenkins
- 微信公众平台开发之发送文本消息.Net代码解析
- Android Volley完全解析
- 通过Application存取公共数据比如登录信息等..
- list packages
- PagerSlidingTabStrip实现横划
- 魅族 MX4,MX4 Pro,MX5 android studio无法识别问题
- 精通iOS开发--第15章 Grand Central Dispatch和后台处理之Block与Self的循环引用
- Android自动识别<a>标签的自定义TextView(可自定义点击事件)
- 精通iOS开发--第15章 Grand Central Dispatch和后台处理之程序生命周期 NSNotificationCenter和线程
- 文本属性Attributes
- Android开发资源整理