谷歌推送通知在生产中不工作 [英] Google push notification not working in production
问题描述
我收到的IOS谷歌推送通知这个错误
I am getting this error on IOS google push notification
该操作无法完成。 (com.google.gcm错误501)。
The operation couldn’t be completed. (com.google.gcm error 501.)
我得到了开发环境和生产环境的注册ID。
I get the registration id in development environment and production environment.
发展enviornment的消息:
{"multicast_id":8145067860904395870,"success":1,"failure":0,"canonical_ids":0,"results":
[{"message_id":"0:1452842547360715%bc92eed1bc92eed1"}]}
和我顺利地收到消息。
但是,在生产环境中,我得到这个消息。
{"multicast_id":8861850059359760561,"success":0,"failure":1,"canonical_ids":0,"results":
[{"error":"NotRegistered"}]}
和未收到通知。
我试图从吊销证书,并创造新的证书和新的供应配置文件,以清洁build文件夹,但通知的每一件事情仍然没有生产工作。
I have tried every thing from revoking certificate and creating new certificate and new provisioning profile to cleaning build folder but notification is still not working in production.
推荐答案
对我来说,解决办法是,我有去AppDelegate.swift文件,并在开发搜索kGGLInstanceIDAPNSServerTypeSandboxOption它应该是真实和生产应该是假的。只要将它更改为false生产和通知是为我工作。
The solution for me is that i have to go to AppDelegate.swift file and search for kGGLInstanceIDAPNSServerTypeSandboxOption in development it should be true and for production it should be false. Just changed it to false for production and notification was working for me.
这篇关于谷歌推送通知在生产中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!