OneSignal iOS 问题“无推送令牌"使用 SDK 2.0.7 [英] OneSignal iOS issue "No Push Token" with SDK 2.0.7

查看:20
本文介绍了OneSignal iOS 问题“无推送令牌"使用 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 标志,所以我现在使用 WEB API,使用 HTTP 调用和 JSON 响应.(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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆