您的位置:首页 > 其它

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

2018-06-02 22:14 225 查看
我是这么解决的,先看看我的药你用过没。

<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 文件,不知这回抽什么风,不生成了,非要这样。着实让人蛋疼。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  cordova jpush