分享的文章连接

1  http://blog.csdn.net/shenjie12345678/article/details/41120637

2;http://dev.umeng.com/push/ios/integration

重点解析:

1:如何获得友盟推送的AppKey?

1.1登陆到友盟的消息推送界面——>添加应用,出现如下界面

其中开发证书是指:在钥匙串中导出的Development的证书

生产证书是指:在钥匙串中导出的Production生产的证书

2:下载消息推送的SDK

3: 代码  在AppDelegate.h添加

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

[self pushNotification:launchOptions];

return YES;

}

#pragma mark====消息推送配置

-(void)pushNotification:(NSDictionary*)launchOptions{

[UMessage startWithAppkey:@"5578f54967e58e03ad008619" launchOptions:launchOptions];

//#define IS_iOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 ? YES : NO)

if(IS_iOS8)

{

//register remoteNotification types (iOS 8.0及其以上版本)

UIMutableUserNotificationAction *action1 = [[UIMutableUserNotificationAction alloc] init];

action1.identifier = @"action1_identifier";

action1.title=@"Accept";

action1.activationMode = UIUserNotificationActivationModeForeground;//当点击的时候启动程序

UIMutableUserNotificationAction *action2 = [[UIMutableUserNotificationAction alloc] init];  //第二按钮

action2.identifier = @"action2_identifier";

action2.title=@"Reject";

action2.activationMode = UIUserNotificationActivationModeBackground;//当点击的时候不启动程序,在后台处理

action2.authenticationRequired = YES;//需要解锁才能处理,如果action.activationMode = UIUserNotificationActivationModeForeground;则这个属性被忽略;

action2.destructive = YES;

UIMutableUserNotificationCategory *categorys = [[UIMutableUserNotificationCategory alloc] init];

categorys.identifier = @"category1";//这组动作的唯一标示

[categorys setActions:@[action1,action2] forContext:(UIUserNotificationActionContextDefault)];

UIUserNotificationSettings *userSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert

categories:[NSSet setWithObject:categorys]];

[UMessage registerRemoteNotificationAndUserNotificationSettings:userSettings];

} else{

//register remoteNotification types (iOS 8.0以下)

[UMessage registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge

|UIRemoteNotificationTypeSound

|UIRemoteNotificationTypeAlert];

}

//是否开启消息推送

[UMessage setLogEnabled:YES];

}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken

{

[UMessage registerDeviceToken:deviceToken];

}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{

NSLog(@"userInfo == %@",userInfo);

NSString *message = [[userInfo objectForKey:@"aps"]objectForKey:@"alert"];

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:message delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];

[alert show];

}

友盟消息推送服务器demo,友盟消息推送总结相关推荐

  1. 友盟消息推送服务器demo,umeng友盟消息推送功能集成

    umeng友盟消息推送功能集成(本人使用的是eclipse开发) 1.首先请自行观看友盟消息推送集成的API文档. 观看地址如下: 2.集成步骤如下 下载sdk 注意:有两种sdk如果用户已经集成支付 ...

  2. 苹果的消息是从服务器接收数据,iOS 消息推送原理及简单实现

    从图中可以很清楚的看出来推送的原理主要分为以下几步: 1.由App向iOS设备发送一个注册通知,用户需要同意系统发送推送. 2.iOS向APNs远程推送服务器发送App的Bundle Id和设备的UD ...

  3. 苹果微信推送服务器错误,接入WxPusher微信推送服务出现错误:Content type application/x...

    背景 使用WxPusher微信推送服务 ,可以及时的将服务的一些运行异常信息,发送到自己的微信上,方便了解服务的运行状态(PS:这个服务是免费的). 你可以在这里看到WxPusher微信推送服务的接入 ...

  4. 微软软件推送服务器,向 UWP 应用添加推送通知 - Azure Mobile Apps | Microsoft Docs

    向 Windows 应用添加推送通知 06/25/2019 本文内容 概述 本教程介绍如何向 Windows 快速入门项目添加推送通知,以便每次插入一条记录时,向设备发送一条推送通知. 如果不使用下载 ...

  5. 用友安装时显示加密服务器,用友云主机指向加密服务器

    用友云主机指向加密服务器 内容精选 换一换 云堡垒机支持批量导出资源信息,用于本地备份资源配置,以及便于快速管理资源基本信息.为加强资源信息安全管理,支持加密导出资源信息.导出的主机资源文件中包含主机 ...

  6. 友盟推送 php demo,友盟推送,php简单代码

    /* 推送测试 */ namespace Service\Controller; use Think\Controller; class PushController extends Controll ...

  7. 基于mqtt协议的消息推送服务器,基于 MQTT 协议的推送服务

    一.简述 MQTT(Message Queuing Telemetry Transport,消息队列遥测传输协议),是一种基于发布/订阅(publish/subscribe)模式的"轻量级& ...

  8. 消息推送服务器令牌,小程序-消息推送配置Token令牌错误校验失败如何解决

    网上借个图 按微信要求:确认此次GET请求来自微信服务器,则原样返回echostr参数内容 都按要求来了,但怎么都不行,总是提示:Token校验失败,请检查确认 /** * 检验签名 */ publi ...

  9. 配置消息推送服务器,自动化部署和消息推送

    一.前言 1.思考:如何取得平衡? 代码写的太简单,可复用性较低,易读易懂: 代码写的太抽象,有一定的复用性,维护成本较高,需要专人维护,否则可能引起牵一发而动全身的问题. 如何避免过度抽象,过度简单 ...

最新文章

  1. [Android编程心得] Camera(OpenCV)自动对焦和触摸对焦的实现
  2. 30天敏捷结果(30):提升敏捷结果
  3. 神经网络防止过拟合的方法
  4. 视频类搜索引擎优化教程侧重点
  5. 【KubeVela 官方文档翻译】,欢迎大家踊跃参与
  6. 有关sublime的一些使用
  7. Essentials of Deep Learning: Visualizing Convolutional Neural Networks in Python
  8. 自然语言处理 —— 2.6 word2vec
  9. layer 弹出层 回调函数调用 弹出层页面 函数
  10. TypeScript 的声明文件的使用与编写
  11. django中时区设置
  12. php字符串中删除字符串函数,PHP实现删除字符串中任何字符的函数
  13. ppt flash无法播放解决方法
  14. Java HTTP 代理服务器
  15. 酒香也怕巷子深,教你一招,轻松让百度收录你的个人站点
  16. 2017百度之星资格赛—1003度度熊与邪恶大魔王
  17. 安卓手机的adb命令
  18. WPF 实现简易北京地铁效果图
  19. 【Python爬虫】有道翻译
  20. 男脸型测试配发型软件,男士测脸型配发型app 百度拍照测脸型

热门文章

  1. ruby array_Ruby中带有示例的Array.index()方法
  2. Java Double类shortValue()方法与示例
  3. python lxml xpath爬取图片代码
  4. Python对IP地址列表排序、对列表进行去重、IP地址与MAC地址组合的多个元组的列表排序
  5. QT5获取QPlainTextEdit 某行内容
  6. PyTorch系列 (二): pytorch数据读取自制数据集并
  7. python使用python-barcode生成任意长度字符串的条形码(一维码)详细教程
  8. 模板全特化和偏特化用法
  9. mybatis和spring整合版本对应表
  10. 将C#中DateTime类型转化为JavaScript中的Date类型