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

upvote
  flag
Can you try upgrading to the latest 2.0.9 SDK to see if this issue persists? – Joseph K
upvote
  flag
Still the same @JosephK .Its weird because my iPad is working great. The only difference between the iPad and the iPhones is the iOS version. Rather than that, there is no other difference at all. – Joaquin102
upvote
  flag
can u give me replay of may question?? //allinonescript.com/questions/41095726/… – princ___y

3 Answers 11

up vote 1 down vote accepted

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

enter image description here

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.

upvote
  flag
This solution is no longer needed as the fix was issued from within the SDK and now the swizzling works with or without the -ObjC flag. – Joseph K
upvote
  flag
Great news @Joseph K – Joaquin102

You're my hero. I've been struggling with this for a month. I have even talked with OneSignal about it several times and they had no clue why this was happening to me! Thanks again!

This issue has been fixed as of the 2.1.11 version of the SDK. Make sure to run a pod update if you're managing the SDK with CocoaPods.

Not the answer you're looking for? Browse other questions tagged or ask your own question.