[英]ionic iOS FCM works in development mode but does not work in production
I'm using: 我正在使用:
Xcode10 Legacy build Xcode10旧版构建
Phonegap-plugin-push 1.10.5 Phonegap-plugin-push 1.10.5
I followed https://github.com/aggarwalankush/push-notification-server (notification server) and https://github.com/aggarwalankush/ionic-push-base (ionic app) 我关注了https://github.com/aggarwalankush/push-notification-server (通知服务器)和https://github.com/aggarwalankush/ionic-push-base (离子应用程序)
I have set up FCM using https://medium.com/@ankushaggarwal/gcm-setup-for-android-push-notifications-656cfdd8adbd . 我已经使用https://medium.com/@ankushaggarwal/gcm-setup-for-android-push-notifications-656cfdd8adbd设置了FCM。
I have also set up the .p12 certificate for both production and development and have targeted the production certificate in my notification server. 我还为生产和开发设置了.p12证书,并在通知服务器中定位了生产证书。
Once my app was published to the app-store, the push notification broke. 我的应用发布到应用商店后,推送通知中断。 But development build is still working fine.
但是开发构建仍然可以正常工作。 What could be the reason?
可能是什么原因?
I have also upload the certificate into FCM as follows: 我还将证书上传到FCM如下:
I have finally figured out the issue. 我终于弄清楚了这个问题。
It is due to : 这是由于:
ApnsService service =
APNS.newService()
.withCert(PATH_TO_P12_CERT, CERT_PASSWORD)
.withSandboxDestination()
.build();
where withSandboxDestination() is for debugging purposes. 其中withSandboxDestination()用于调试目的。
Even if you compiled the app "for release" in xcode , it will be still under "development". 即使您在xcode中将应用程序“发布”编译,它仍处于“开发中”状态。
Once the app is on the app store, you would need to: 一旦应用程序在应用程序商店中,您将需要:
change "withSandboxDestination()"
to 将
"withSandboxDestination()"
更改为
"withProductionDestination()"
Hope this helps anyone who has the same issue as me. 希望这对与我有相同问题的任何人有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.