OneSignal iOS问题“无推送令牌”使用SDK 2.0.7 [英] OneSignal iOS issue "No Push Token" with SDK 2.0.7
问题描述
我正在面对来自OneSignal的奇怪错误并推送通知。我有3个设备(2个iPhone,1个迷你iPad)。完成推送通知的整个过程后,只有我的iPad收到来自OneSignal的推送通知。我的所有设备都在我的开发者帐户中注册,我发现最奇怪的情况是我NSLOG didRegisterForRemoteNotificationsWithDeviceToken
,看看每个连接的设备是否收到令牌,他们都确实得到一个令牌但由于某种原因OneSignal没有。只有iPad令牌。我能看到的唯一区别是iPad是9.3.2,两款iPhone都是9.3.4。所有设备上都安装了相同的应用程序,从 AppDelegate
调用oneSignal注册方法。有没有人一直在努力解决这个问题?我附上了我的oneSignal帐户的图片。提前致谢。
这个标志,SDK不会注册DeviceToken。
此外,如果您使用 Parse SDK, GoogleMaps SDK或 Facebook SDK,您可能会遇到冲突。可行的解决方案是:
-
Parse SDK(我不知道是否使用解析服务器冲突出现):删除
ParseCrashReporting ParseFacebookUtils ParseTwitterUtils
-
Facebook SDK(也许对于新版本,这不是必需的):删除
theFBAudienceNetwork
-
GoogleMaps :基本上GoogleMaps SDK不能与 -ObjC 标志一起使用,因此我现在使用带有JSON响应的HTTP调用的WEB API。 (这一切都在GoogleMaps开发者网站上进行了解释)
希望这能帮助那些正在努力奋斗的人。
如有任何关于此主题的问题,请随时与我联系。我想现在我知道每一件事都可能失败。
I am confronting a weird error from OneSignal and push notifications. I have 3 devices (2 iPhones, 1 mini iPad). After i completed the entire process of Push notifications, only my iPad receives push notifications from OneSignal. All my devices are registered in my Developer Account and what i found is the most weird situation is that i NSLOG the didRegisterForRemoteNotificationsWithDeviceToken
to see if each device connected receives a token and they all indeed get a token but for some reason OneSignal doesn't. Only the iPad token. The only difference that i could see is that the iPad is 9.3.2 and both iPhones are 9.3.4. The same app is installed on all devices, the oneSignal registration method is called from AppDelegate
. Does anyone have been struggling with this issue as well? I attached an image of my oneSignal account. Thanks in advance.
OneSignal All Users dashboard
Well finally after a week deleting and creating certificates more than 100 times, provisioning profiles, etc i found the problem. I am using objective-c so it is necessary to use the -ObjC flag. Go to project > Your Target > Build Settings > on the search bar write other linker flags, the section will come up and by double click on it, it will allow you to add -ObjC
Without this flag, the SDK wouldn't register the DeviceToken. Also if you are using Parse SDK, or GoogleMaps SDK, or Facebook SDK, you probably will have a conflict. The posible solutions are:
Parse SDK (I don't know if using parse server the conflict appears) : Delete
ParseCrashReporting ParseFacebookUtils ParseTwitterUtils
Facebook SDK (Maybe with new versions, this won't be necessary): delete
theFBAudienceNetwork
GoogleMaps: Basically the GoogleMaps SDK doesn't work with the -ObjC flag, so i using now the WEB API using HTTP Calls with JSON Responses. (It is all explained on the GoogleMaps Developers website)
Hope this will help someone that is struggling badly like i was. Please any question about this subject don't hesitate to ask me about it. I think that right now i know every possible fail.
这篇关于OneSignal iOS问题“无推送令牌”使用SDK 2.0.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!