cordova jpush 插件 生产环境得不到 registrationId

我是这么解决的,先看看我的药你用过没。

    <config-file parent="aps-environment" target="*/Entitlements-Debug.plist">
        <string>development</string>
    </config-file>
    <config-file parent="aps-environment" target="*/Entitlements-Release.plist">
        <string>production</string>
    </config-file>

症状。

日志

日志截图

 | JIGUANG | W - [JIGUANGClientController] Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed?  or there is no APNs register code? Please refer to JPush docs.

进一步打印日志,添加方法。

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
    NSLog(@"Error: %@", error);
}

输出

Error: Error Domain=NSCocoaErrorDomain Code=3000 "未找到应用程序的“aps-environment”的授权字符串" UserInfo={NSLocalizedDescription=未找到应用程序的“aps-environment”的授权字符串}

之后诊断证书一大堆,未果。

给 cordova config.xml 文件加

    <config-file parent="aps-environment" target="*/Entitlements-Debug.plist">
        <string>development</string>
    </config-file>
    <config-file parent="aps-environment" target="*/Entitlements-Release.plist">
        <string>production</string>
    </config-file>

build 后尝试成功了。

其实以前会自动生成 xxx.entitlements 文件,不知这回抽什么风,不生成了,非要这样。着实让人蛋疼。

转载于:https://my.oschina.net/guodapeng/blog/1823244

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值