![](/img/trans.png)
[英]How does Push Notifications work while in development and production mode, (pushwoosh)
[英]ionic iOS FCM works in development mode but does not work in production
我正在使用:
Xcode10舊版構建
Phonegap-plugin-push 1.10.5
我關注了https://github.com/aggarwalankush/push-notification-server (通知服務器)和https://github.com/aggarwalankush/ionic-push-base (離子應用程序)
我已經使用https://medium.com/@ankushaggarwal/gcm-setup-for-android-push-notifications-656cfdd8adbd設置了FCM。
我還為生產和開發設置了.p12證書,並在通知服務器中定位了生產證書。
我的應用發布到應用商店后,推送通知中斷。 但是開發構建仍然可以正常工作。 可能是什么原因?
我還將證書上傳到FCM如下:
我終於弄清楚了這個問題。
這是由於:
ApnsService service =
APNS.newService()
.withCert(PATH_TO_P12_CERT, CERT_PASSWORD)
.withSandboxDestination()
.build();
其中withSandboxDestination()用於調試目的。
即使您在xcode中將應用程序“發布”編譯,它仍處於“開發中”狀態。
一旦應用程序在應用程序商店中,您將需要:
將"withSandboxDestination()"
更改為
"withProductionDestination()"
希望這對與我有相同問題的任何人有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.