生成推送证书:

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的更多相关文章

  1. APNS 远程推送通知 PUSH deviceToken

    服务器向客户端推送消息:      当应用程序推到后台,或者根本就没有运行(我们的代码无能为力)      如果这种情况之下,应用程序想和用户交互(传统的做法 不可能)      推送 APNS:Ap ...

  2. 基于Codeigniter框架实现的APNS批量推送—叮咚,查水表

    最近兼职公司已经众筹成功的无线门铃的消息推送出现了问题,导致有些用户接收不到推送的消息,真是吓死宝宝了,毕竟自己一手包办的后台服务,影响公司信誉是多么的尴尬,容我简单介绍一下我们的需求:公司开发的是一 ...

  3. iOS开发之功能模块--Apns推送中的的json格式介绍

    在开发向苹果Apns推送消息服务功能,我们需要根据Apns接受的数据格式进行推送.下面接受我在进行apns推送时候总结的一点apns服务接受的Json数据格式 示例 1: 以下负载包含哦一个简单的 a ...

  4. IOS本地,APNS远程推送(具体过程)

    添加本地推送 ///本地添加 -(void)addLocalPushNotification:(UIButton*)sender; { NSLog(@"%s",__FUNCTION ...

  5. Push:iOS基于APNS的消息推送

    1. Push的三个步骤,如下图所示: (1)Push服务应用程序把要发送的消息.目的iPhone的标识打包,发给APNS: (2)APNS在自身的已注册Push服务的iPhone列表中,查找有相应标 ...

  6. 添加APNS通知

    1.进入苹果开发者官网developer.apple.com,点击member center,进入登录界面. 2.输入你的开发者账号和密码,登录后会跳转到“Select your team”这个界面. ...

  7. 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 ...

  8. APNS 服务推送通知

    1. 将app注册notification里面, 并从APNS上获取测试机的deviceToken. - (BOOL)application:(UIApplication *)application ...

  9. 基于 HTTP/2 的全新 APNs 协议

    https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotifi ...

  10. Send push notification on Apple (APNS) on c#.net

    原文: http://apns-c-sharp-net-vikram-jain.blogspot.com ======================= Please, Install your ce ...

随机推荐

  1. 小白的python之路11/14

    视频69 固定命令的方式 1 vim /etc/profile 2 vim /etc/bashrc 3 vim /root/.bashrc 4 vim /root/.bash_profile 5 cd ...

  2. mybatis一简单one2one关系xml配置

    user类 <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE mapper PUBLIC &qu ...

  3. 关于angular 的路由title设置

    在主模块下 constructor( private router: Router, private activatedRoute: ActivatedRoute, ) {} this.router. ...

  4. 实时输出topk最频繁变动的股价

    网上看到了一道关于bloomburg的面试题,follow 评论的思路 自己试着写了一个HashHeap的实现. 基本思路是维护一个大小为K的最小堆,里面是topK股价变动的公司ID(假设ID是Int ...

  5. ZABBIX安装过程中relocation error报错解决办法

    错误提示: /usr/sbin/zabbix_server: relocation error: /usr/sbin/zabbix_server: symbol mysql_next_result, ...

  6. C语言作业(心理魔术)

    #include "stdafx.h" #include "stdio.h" #include "stdlib.h" #include &q ...

  7. 实现简单的ssh功能

    客户端代码: # -*- coding=utf-8 -*- __Author__ = "Dennis" import socket client = socket.socket() ...

  8. python基础知识总结(二)

    基础数据类型初始: int(数字):+ 加     - 减 *  乘 /  除 % 取余数 str(字符串):python中凡是用引号引起来的都是字符串 可以相加,用来表示字符串的拼接 可以相乘,只能 ...

  9. 【译】如何编写“移动端优先”CSS

    原文链接:https://zellwk.com/blog/how-to-write-mobile-first-css/ 构建响应式网站是如今前端开发者的必备技能,当我们谈到响应式网站时,“移动端优先” ...

  10. java第八周作业

    分析代码: public final class LineItemKey implements Serializable { private Integer customerOrder; privat ...