百度云推送客户端配置IOs
来源:互联网 发布:什么时候开始有的网络 编辑:程序博客网 时间:2024/06/05 19:28
先配置好百度开发文档中的东西,一下实现一个在回调中获取连接,跳转。
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
self.userInfo = userInfo;
NSString *alert = [[userInfo objectForKey:@"aps"] objectForKey:@"alert"];
//页面激活的状态下 (不在后台)
if (application.applicationState ==UIApplicationStateActive) {
//有链接的时候就是资讯 @“urls”这个是自己服务器添加的字段
if(nil!=[userInfoobjectForKey:@"urls"])
{
UIAlertView *alertView = [[UIAlertViewalloc] initWithTitle:@"资讯新闻"
message:alert
delegate:self
cancelButtonTitle:@"稍后"
otherButtonTitles:@"立即查看",nil];
[alertViewshow];
}else
{
UIAlertView *alertView = [[UIAlertViewalloc] initWithTitle:@"新消息"
message:alert
delegate:self
cancelButtonTitle:@"我知道了"
otherButtonTitles:nil];
[alertViewshow];
}
}
//在后台的时候
else
{
if(nil!=[userInfoobjectForKey:@"urls"])
{
[[NSNotificationCenterdefaultCenter] postNotificationName:@"url"object:niluserInfo:userInfo];
}
}
[application setApplicationIconBadgeNumber:0];
[BPushhandleNotification:userInfo];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex==1)
{
[[NSNotificationCenterdefaultCenter] postNotificationName:@"url"object:niluserInfo:self.userInfo];
}
}
在VC中
[[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(openAction:)name:@"url"object:nil];
-(void)openAction:(NSNotification *)notify
{
//跳转的指定页面
}
- 百度云推送客户端配置IOs
- 百度云推送的ios证书配置
- 百度云推送的iOS证书配置
- 百度云推送----iOS
- iOS推送 (百度推送)
- iOS推送 (百度推送)
- iOS 百度云推送详解
- 百度云推送 Android+IOS
- iOS百度云推送问题
- iOS之百度云推送
- Android客户端之百度云推送
- iOS开发——百度云推送
- iOS之百度云推送二
- ios 推送消息 极光推送/百度推送
- 百度 iOS推送
- iOS百度推送
- <iOS>百度推送
- 百度推送iOS
- w3school JS测验
- 查看oracle连接数
- 非常适合新手的长尾关键词挖掘方法
- hadoop2.0 遇到的问题 (持续更新)
- VCDebug、Ollydbg、WinDbg字符串条件断点设置方法总结
- 百度云推送客户端配置IOs
- ubuntu 下查看已安装程序
- Android环境搭建问题:Connection to http://dl-ssl.google.com refused
- jquery学习一
- 颜色值
- 新建的Android项目没有生成R.java文件
- Selenium-AndroidDriver(python) (一) --- 环境配置及脚本运行
- ArcGis Javascript API (V3.6)加载天地图
- 北京九月存量房网上签约