OneSignal iOS issue "No Push Token" with SDK 2.0.7 - ios

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.

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.

Related

Firebase Phone Auth Error FIRAuthErrorCodeMissingAppToken

I'm getting this error from firebase when trying to sign in with a phone number on iOS
error_name: 'ERROR_MISSING_APP_TOKEN',
NSLocalizedDescription: 'There seems to be a problem with your project\'s Firebase phone number authentication set-up, please make sure to follow the instructions found at https://firebase.google.com/docs/auth/ios/phone-auth' },
domain: 'FIRAuthErrorDomain'
I've followed all the linked directions (https://firebase.google.com/docs/auth/ios/phone-auth) to enable phone authentication and add APNs Keys, etc.
What "token" is missing to cause this error?
Thanks.
We were having the same problem. Turns out we should have used a real device with a working SIM card inside.
Try it out. Hope it helps.
It looks like the answer was pretty simple, I was using an outdated version of the Firebase iOS components. I updated my Podfile and installed the newest version and everything started working.

PushNotification OneSignal Issue

im using OneSignal SDK for PushNotification in my iOS App
when i done everything in the Project and run on real device, OneSignal Says :
"This user has no push token and cannot be targeted."
i checked every thing, ex : codes, profiles.
I was struggling with the same problem.
Are you using objective-c? If so, you need to add the -ObjC flag to your project. Without it, the OneSignal SDK won't work.
On XCode, go to your target project > Build Settings > find Other Linker Flags and add -ObjC Flag.
Sometimes this could generate some conflicts with other SDKs (Such as Parse, GoogleMaps, Facebook..)
Take a look to my answer here for any possibly scenario about this:
https://stackoverflow.com/a/39135807/2551707

Push notification with OneSignal: What means "No Push Token"?

I'm using OneSignal for push notifications.
In the subscribed list some devices/users are marked with No (No Push Token). Explanation says: This user has no push token and cannot be targeted.
That occurs for iOS devices as well as for Android devices.
What does it mean? Why does it happen? How to change it?
This means OneSignal did not get a pushToken from the device however the device was able to register with your OneSignal account. On iOS the pushToken is known as the device token, on Android this is the Google registration id.
Depending on the OneSignal SDK you're using there is a setLogLevel function that can be called before you call OneSignal init to add additional logging. This will be printed in the Xcode log for iOS or adb logcat for Android. Also make sure you are using the last OneSignal SDK.
You can also contact OneSignal through the help bubble on the bottom of the page while logged in and they can check your account to help diagnose the issue.
Could you check if the "Push Notifications" capability is turned on? If it is not, turn it on and see if it works, otherwise keep reading.
Make sure you're running the latest version of the OneSignal SDK (2.1.14)
as this version should have resolved the issue. Next, try the following fixes:
Fix 1
From the navigation panel, select your top blue project. Then select your target and navigate to the Build Settings. Search for other linker flags and add the following entry: -ObjC
Do a project clean and run again, see if it works.
Fix 2
In your bridging header (if you have one), or on any header file that is visible to your App Delegate, create an extension for OneSignal class in which you define the following interface method:
+ (void)didRegisterForRemoteNotifications:(UIApplication*)app deviceToken:(NSData*)inDeviceToken;
Next, override the didRegisterForRemoteNotifications delegate method in your app delegate and call the above method on OneSignal and pass both parameters to the SDK.
Note that there was a pretty significant flaw in the OneSignal SDK when used in XCode 8 up to version 2.1.10 that resulted in these No push token registrations for iOS devices when including the package using Cocoapods (the recommended approach). Make sure you update your pod.
See the release notes for 2.1.11:
Fixed a 'No Push Token' issue in 2.1.10 that would happen when OneSignal was downloaded through CocoaPods and included other pods that used the -ObjC flag.
Make sure that your Xcode project has "Push Notifications" and "Remote notifications" enabled.
As other answer mentioned, there is a bug in 2.1.10 for CocoaPods setup. So I changed
from
pod 'OneSignal' ## points to 2.1.10
to
pod 'OneSignal', :git => 'https://github.com/OneSignal/OneSignal-iOS-SDK.git', :branch => 'master'

Parse push notifications broken in iOS 9 build with updated frameworks

I'm trying to conceptually understand how I broke my push notifications in iOS 9.
Here's what actions I took:
I updated the Parse and Bolts frameworks from 1.6.1 to 1.8.3 by deleting the old frameworks in Xcode and deleting the actual files in the finder. Then I added the new versions of the frameworks into the project by dragging them into Xcode. I checked the build phases and the new libraries are linked.
At this point I tested the app and was not receiving notifications with this build. People running previous versions of the app on iOS 9 do receive notifications.
I had not changed the App ID or Provisioning Profile at this point, but I thought they could be the issue, so I created a new Provisioning Profile with the existing App ID. Still no notifs.
I checked in Parse Core and my device is registering with the correct build # and the updated Parse library. So Parse knows my device needs to be sent a push, but it's not getting there.
Normally I would expect the advice to be create a new Provisioning Profile, but I did that. Any idea what I might be missing here? Thanks.
Since you did all of that, I would like to note that Push notifications are not guaranteed to be sent, they just usually are. And Parse Push has gone down before. So if not tonight, try again tomorrow. However, I would try a couple more things, ensure your client-push is enabled in your Parse.com console. I would also delete the app and reinstall and also make sure your code signing is accurate in your project settings. You should also try a simple Clean in Xcode, sometimes that does a lot of good. At most, you could try building an Ad Hoc version to test. Lastly, they have summarized a couple of more things you can troubleshoot since this a common issue and they use their Google Groups for developer communications now more-so than SO : https://groups.google.com/forum/#!topic/parse-developers/65WAfRIiEnA
Note: This is not a one-answer fix, since push notifications don't have a one-specific issue. But these are general outlines of what can be done to remedy your particular issue. I have two apps with Parse, running Xcode 7 GM and iOS 9 GM and push notifications are working for both.
Simply using an ad hoc build (ie with production push certificates) rather than deploying from xCode (with development certs) resolved this. If your app is already deployed in production in Parse, you will have replaced the development certs in their dashboard when you released it.

Facebook SDK on Unity 5 on iOS

I have been having trouble getting the latest Facebook SDK 6.2.1 to function with Unity 5.0.0f4 in both my project and an empty one.
Here is what I do:-
Create a blank project
import Facebook SDK
Set App ID and Name in editor settings
Add sample scene to build settings
Build Xcode Project
Open in Xcode
Disable ARC in settings
Remove extra #endif when xcode complains about it
Build and Run game on iOS device
The error I end up with is in the following link:-
dl.dropboxusercontent.com/u/13490919/FacebookiOSProb/Screenshot%202015-03-12%2014.53.29.png
The error I get is "EXC_BAD_ACCESS (code=1)". I'm not much of an xcode/iOS guy so this confuses me a tone load. This error does not occur if facebook isn't present. Has anyone got any idea how to get around this? Surely i'm not the only one with this issue. All I want to do is get an access token from facebook. If need be, I don't mind using a simple webview or something similar.
Any help on this would be much appreciated. I would give free hugs to but ya know.
Thanks
Ive managed to solve the issue. As posted by someone else on unity forums here, you need to mark the option "iOS" as platform for plugin and adding "-fno-objc-arc" as compile flag in the following file: Assets/Facebook/Editor/iOS/FbUnityInterface.mm
This works with the latest versions of Unity 5.0.1f and Facebook SDK 6.2.1 as of this post.
Facebook SDK for Unity Downloads
Note: Only Unity 4 is supported at this time
That is why it's not working. I don't know when Facebook will launch their sdk for Unity 5.

Resources