用React Native 0.70.1/react-native-code-push 7.05 project/Xcode 14/Monterey
重建后,npx react-native run-ios
成功启动,没有任何错误,但控制台屏幕抛出错误:
[CodePush] An unknown error occurred.
LOG [CodePush] 400: {"status":400,"name":"Error","message":"Missing required query parameter "deployment_key""}
然后,我在MS appcenter for IOS中创建了一个新的应用程序,并用Xcode中刚刚在AppCenter-Config.plist
中创建的新应用程序替换了应用程序机密。但错误是一样的。在重新构建应用程序之前,我验证了最新的react原生代码push 7.0.5是否与react native 0.70版本兼容。
Xcode 14中的应用程序构建成功。appcenter或应用程序配置缺少什么?
在我的情况下,我得到这个错误是因为我忘记在Info.plist
中设置CodePushDeploymentKey
:(
既然我在构建设置中有了特定于配置的CODEPUSH_KEY
,并且在Info.plist
中将CodePushDeploymentKey
设置为$(CODEPUSH_KEY)
,它就可以工作了!