Please follow all steps below. If you are still having issues, please reach out to support with a log generated from Step 4.
Return to our iOS SDK Setup Guide to make sure you followed all steps and added any updates.
Make sure you have version
1.1.0 or newer of CocoaPods by running
pod --version from the terminal.
Make sure you are running version
2.10.1 or newer of the OneSignal SDK. We recommend being on the newest version. More details on why
2.10.1 is required here.
See our iOS Github Releases for the latest version of the OneSignal iOS SDK and changelog of features and updates.
pod update from the terminal to update to the latest version of OneSignal SDK.
You must test on an actual iOS device. The Simulator does not support push.
After running through the rest of this Troubleshooting guide, use the OneSignal SDK setLogLevel method to Verbose and send us the full logcat from the device when reproducing the behavior.
//The following options are available with increasingly more information: //.LL_NONE, .LL_FATAL, .LL_ERROR, .LL_WARN, .LL_INFO, .LL_DEBUG, .LL_VERBOSE. OneSignal.setLogLevel(.LL_VERBOSE, visualLevel: .LL_NONE)
//The following options are available with increasingly more information: //ONE_S_LL_NONE, ONE_S_LL_FATAL, ONE_S_LL_ERROR, ONE_S_LL_WARN, ONE_S_LL_INFO, ONE_S_LL_DEBUG, ONE_S_LL_VERBOSE. [OneSignal setLogLevel:ONE_S_LL_VERBOSE visualLevel:ONE_S_LL_NONE];
If you need help interpreting the logs, please share them through Pastebin or a .txt file to help our support and engineering team assist you.
The "Apns Delegate Never Fired", generally this occurs for a couple reasons:
1 - Try toggling WiFi on the iOS device, try another device, or a different network. If the device could not get a connection to Apple's APNs server you will see the OneSignal status. You may see this more often with development builds of your app since this will be connecting to Apple's Sandbox server instead of Production.
2 - Make sure you have the Push Notifications capability in the Main App Target > "Signing & Capabilities" > Push Notifications: https://documentation.onesignal.com/docs/ios-sdk-setup#section-3-add-required-capabilities
Please check that this is enabled for both Debug and Release builds. You may need to check your entitlements if these are different.
3 - Other Push Provider SDKs can interfere with this. It is best to remove the other Push SDK from the app. This usually involves removing the other SDK from Cocoapods and running pod install again to get updated.
Finally, if you are still having issues....
Please plug the device into your IDE and use our SetLogLevel method to Verbose. Then uninstall and re-build the app on the device. This will help log any issues to your IDE console.
More on this method in the SDK docs: https://documentation.onesignal.com/docs/sdk-reference#section-set-log-level
Please send these logs through Pastebin or at least a .txt file, that would be much appreciated and help us better see what is happening in the app.
ERROR: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
Make sure your URL is HTTPS. HTTP urls will not work unless you set
NSAllowsArbitraryLoads in your Xcode .plist.
About App Transport Security
Please do not leave NSAllowsArbitraryLoads enabled when releasing your app to the App Store, as this can create a security vulnerability in your app. For more information, please read Apple's Security Overview
1. Open your attachment URL in a web browser. Make sure it is a direct link to the image, it can't be part of an HTML page. Also redirects are not supported.
2. Make sure your URL is HTTPS. HTTP urls will not work unless you set
NSAllowsArbitraryLoads in your Xcode
3. Make sure your url ends with the correct file extension. If the URL doesn't contain a file extension you can add it as a parameter by adding
?filetype=file.jpg for example to the end of your URL.
4. Please double check you have correctly added the NotificationServiceExtension noted in step 1 of the iOS Setup guide.
5. If you correctly added the OneSignal Notification Service Extension and rich push notifications (images, buttons) still don't appear, make sure that the Deployment Target in the Extension service matches the deployment target of your application.
1. Please double check you have correctly added the NotificationServiceExtension noted in step 1 of the iOS Setup guide.
1. Double check that you followed all setup instructions first, please see the SDK docs your are using for more on this.
2. The 2 debugging lines in the .m source we provide are 2 ways to confirm the notification service extension is running.
self.bestAttemptContent.body = [@"[Modified] " stringByAppendingString:self.bestAttemptContent.body];
This line will add "[Modified] " to the beginning of all your notification bodies. You should see this on all notifications on your device.
This will add an entry to the device log when the extension is run. You can view this in Xcode under Window > "Devices and Simulators". Select your device on the left and open the log up arrow at the bottom.
We recommend clearing the log before sending a notification to test as it can grow quickly. Copy the log and search for the debug entry "Running NotificationServiceExtension".
We don't recommend trying to attach to the extension process with the debugger in Xcode through the Debug menu. Doing so can create issues with it launch so we recommend restarting your device if you have tried doing so.
Lastly the Notification Service Extension will only run if you have set our Action Buttons, a Media Attachment, or have set mutable content on the notification so make sure your test notification have one of these set.
CocoaPods: Pods written in Swift should be imported with the
use_frameworks!, and CocoaPods will complain if you don't do this and try to import the pods in Swift code.
Manual Import: One way to solve your issue is to go into your build settings and defining the Framework Search Paths to a folder which contains the frameworks in question. If the OneSignal framework is placed in your project directory, simply set the framework search path to $(SRCROOT) and set it to recursive.
NOTE: For your crash to show in the following steps the crash must happen when your device is not connected to your Mac. Connect it after you reproduce the crash.
1. In Xcode go to
Devices & Simulators.
2. Select your device on the left and press the "Open Console" button.
3. Select "All Messages" (top left)
4. Reproduce issue with the connected device.
Command + A to select all, then
Command + C to copy log
6. Send it to OneSignal support along with details on reproducing the crash.
The OneSignal SDK will automatically clear previously received push notifications when the app is opened under two conditions:
- The badge number is > 0
- The application was opened from a push notification
This behavior is caused by our system to clear the badge number. Most app developers want this behavior, however some do not. In order to prevent this from occurring, you can add
true in your application's
Couldn't read values in CFPrefsPlistSource<0x281514780> (Domain: group.com.onesignal.example.onesignal, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd
This error is normal and results from a bug in iOS. It should appear if you have App Groups added correctly. For more info, read this comment by an Apple employee.
Still having problems? We're happy to help!
We answer most support queries in under 4 hours during the week, and under 24 hours on weekends. Simply email us at [email protected]
Include as much as you can of the following to help us find your issue quicker:
- Version of our SDK
- Device OS version
- Xcode crash lock or stack trace of the app starting and the problem point
- Any other libraries or plugins in your app
- Details on reproducing your problem.
Updated 18 days ago