APNs
生成推送证书:
1. 登陆开发者中心:https://developer.apple.com
2. 点开 certificates、identifiers 和 proversionprofiles 里面
3. 创建 APPID, 勾选 push notification servers 服务
4. 搜索刚才创建的 APPID,点击 edit,配置证书, 下载双击。
5. 证书创建完成, 钥匙链内右键导出 p12
实现的代码在 AppDelegate.h
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
//请求通知权限
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert |UIUserNotificationTypeSound | UIUserNotificationTypeBadge categories:nil];
[application registerUserNotificationSettings:settings];
//注册远程通知
[application registerForRemoteNotifications];
return YES;
}
//deviceToken, 设备令牌, 唯一.
//远程推送注册成功
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSLog(@"%@", deviceToken);
//post 请求发给自己的服务器
//生成推送证书:
//1. 登陆开发者中心:https://developer.apple.com
//2. 点开 certificates、identifiers 和 proversionprofiles 里面
//3. 创建 APPID, 勾选 push notification servers 服务
//4. 搜索刚才创建的 APPID,点击 edit,配置证书, 下载双击。
//5. 证书创建完成, 钥匙链内右键导出 p12
}
APNs的更多相关文章
- APNS 远程推送通知 PUSH deviceToken
服务器向客户端推送消息: 当应用程序推到后台,或者根本就没有运行(我们的代码无能为力) 如果这种情况之下,应用程序想和用户交互(传统的做法 不可能) 推送 APNS:Ap ...
- 基于Codeigniter框架实现的APNS批量推送—叮咚,查水表
最近兼职公司已经众筹成功的无线门铃的消息推送出现了问题,导致有些用户接收不到推送的消息,真是吓死宝宝了,毕竟自己一手包办的后台服务,影响公司信誉是多么的尴尬,容我简单介绍一下我们的需求:公司开发的是一 ...
- iOS开发之功能模块--Apns推送中的的json格式介绍
在开发向苹果Apns推送消息服务功能,我们需要根据Apns接受的数据格式进行推送.下面接受我在进行apns推送时候总结的一点apns服务接受的Json数据格式 示例 1: 以下负载包含哦一个简单的 a ...
- IOS本地,APNS远程推送(具体过程)
添加本地推送 ///本地添加 -(void)addLocalPushNotification:(UIButton*)sender; { NSLog(@"%s",__FUNCTION ...
- Push:iOS基于APNS的消息推送
1. Push的三个步骤,如下图所示: (1)Push服务应用程序把要发送的消息.目的iPhone的标识打包,发给APNS: (2)APNS在自身的已注册Push服务的iPhone列表中,查找有相应标 ...
- 添加APNS通知
1.进入苹果开发者官网developer.apple.com,点击member center,进入登录界面. 2.输入你的开发者账号和密码,登录后会跳转到“Select your team”这个界面. ...
- Send Push Notifications to iOS Devices using Xcode 8 and Swift 3, APNs Auth Key
Send Push Notifications to iOS Devices using Xcode 8 and Swift 3 OCT 6, 2016 Push notifications are ...
- APNS 服务推送通知
1. 将app注册notification里面, 并从APNS上获取测试机的deviceToken. - (BOOL)application:(UIApplication *)application ...
- 基于 HTTP/2 的全新 APNs 协议
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotifi ...
- Send push notification on Apple (APNS) on c#.net
原文: http://apns-c-sharp-net-vikram-jain.blogspot.com ======================= Please, Install your ce ...
随机推荐
- 如何改变checkbox的样式
<!doctype html> <html> <head> <meta charset="utf-8"> ...
- APP压力稳定性测试之monkey环境搭建
一.搭建adb环境: 需要的安装软件包可以使用我分享的,链接:https://pan.baidu.com/s/13DThDtc0GALabTakshcLfg 密码:0kuo:也可以自己百度下载 1)下 ...
- 转载: http状态码
消息 这一类型的状态码,代表请求已被接受,需要继续处理.这类响应是临时响应,只包含状态行和某些可选的响应头信息,并以空行结束.由于 HTTP/1.0 协议中没有定义任何 1xx 状态码,所以除非在 ...
- Observable详解
Observable详解 rxjs angular2 在介绍 Observable 之前,我们要先了解两个设计模式: Observer Pattern - (观察者模式) Iterator Patte ...
- Educational Codeforces Round 63 (Rated for Div. 2) D. Beautiful Array (简单DP)
题目:https://codeforces.com/contest/1155/problem/D 题意:给你n,x,一个n个数的序列,你可以选择一段区间,区间的数都乘以x,然后求出最大字段和 思路: ...
- seckill(1)秒杀系统主要步骤
- 2016/12/22 dplの课练
1.sort -nk 1 -t - 3 2.sort -nk 1 -t - 2 3.sort -nk 2 -t - 1 3./etc/passwd根据用户id的大小排序,从小到大的排序输出 sort ...
- linux实时时钟相关函数
time 功能:获取1970年1月1日00:00:00到现在的秒数 原型:time_t time(time_t *t); 参数: t:获取到的秒数 返回:获取到的秒数 说明:在time.h中定义了ti ...
- 解决使用mybatis分页插件PageHelper的一个报错问题
在项目中使用PageHelper进行分页,启动运行时报错,报错如下: 27-Aug-2017 09:58:48.017 INFO [localhost-startStop-1] org.apache. ...
- Real time profiler for Delphi applications
xalion提供的资源,这么强,还是免费的,快去试用! ✓ Detailed debug information (internal, TDS, MAP) ✓ Display informat ...