美文网首页
APNS问题汇总

APNS问题汇总

作者: IreneWang1988 | 来源:发表于2016-04-20 10:47 被阅读0次

1:development 证书安装的app,推送环境是sandbox。

     adhoc , distribution 证书安装的app,推送环境是production。

手机安装的极光推送能收到推送消息。用adhoc证书打包的IPA文件安装到手机上,极光就推送到生产环境上去了,所以会出现0|0的情况。

2:app 在运行状态和后台background的时候,都可以从- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
里收到payload。

app被进程杀掉,在用户点击弹出的apns推送信息时,会跳转- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {}函数。 

launchOptions 里面就有remote notification的payload。

获取方法是:

NSDictionary* pushNotificationKey = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];

if (pushNotificationKey) {

//这里定义自己的处理方式

NSLog(@"\n\ndidFinishLaunchingWithOptions\n pushNotificationKey %@\n\n",pushNotificationKey);

NSArray *allkeys=[pushNotificationKey allKeys];

NSString *allkeysstring = @"-";

for (NSString *s in allkeys) {

allkeysstring = [allkeysstring stringByAppendingString:s];

}

//[[[UIAlertView alloc] initWithTitle:nil message:allkeysstring delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show];

[self performSelector:@selector(handleRemoteNotification:) withObject:pushNotificationKey afterDelay:3.0f];

// [self handleRemoteNotification:pushNotificationKey];

}

这里面的pushNotificationKey 就是收到的payload。

相关文章

  • APNS问题汇总

    1:development 证书安装的app,推送环境是sandbox。 adhoc , distributio...

  • nodejs APNS

    node-apnnodejs + apn 推送给apns服务器的问题用NODEJS实现APNS

  • ROC-AUC 曲线以及PRC曲线

    目录:机器学习常见面试问题汇总问题汇总(1):逻辑回归问题汇总(2):支持向量机问题汇总(3):树模型问题汇总(4...

  • iOS MDM服务 推送常见类型及token区别

    iOS客户端及MDM监管涉及到的token汇总 由于iOS客户端APNS功能及PushKit功能 和MDM的APN...

  • APNS与VoIP

    APNS 一、简述APNS APNS全称是Apple Push Notification service(苹果推送...

  • 问题汇总(5):神经网络

    这篇应当也是很重要的把~ 目录:机器学习常见面试问题汇总问题汇总(1):逻辑回归问题汇总(2):支持向量机问题汇总...

  • iOS远程推送(Objective-C & Swift)

    iOS远程推送 APNS远程推送的流程: 1、app 注册到 APNS。2、APNS 下发 devicetoken...

  • iOS APNS

    APNS推送机制 APNS注意事项 1、APNS免费,但需要开发者账号2、APNS不稳定,Apple对消息推送的可...

  • iOS的APNs

    Communicating with APNs The APNs provider API lets you se...

  • Updated APNs provider API deadli

    Updated APNs provider API deadline 更新 APNs provider API 截...

网友评论

      本文标题:APNS问题汇总

      本文链接:https://www.haomeiwen.com/subject/fmmzlttx.html