Live Activities troubleshooting

A guide on troubleshooting potential issues related to Live Activities

Please review the following for common issues based on iOS Setup. We also provide an example project on our Github repository if you would like to test.

Requirements

SDK Version

Here are the minimum SDK Versions needed for live activities (not including updates that allow for push to start, only for live activity support):


Device

If you have not done so already, please try running the build on a different device (preferably a physical iPhone/iPad) and reinstall the app to generate a new subscription record on your OneSignal app.

  • Are all of the requirements met for Live Activities to work properly
    • An iOS / iPadOS Application (Live Activities are only available on the iPhone and iPad)
    • You are using a .p8 key (Check out our guide, iOS: Establishing a Token-Based Connection to APNs (.p8 Key), if migrating away from a .p12 certificate)
    • You are using an OS version for your device that supports Live Activities. They will be available on iOS 16.1+, which is supported on iPhones made in 2017 o'ar newer, and iPadOS 17 and later.
    • You are using Xcode 14 or later.
    • You are on the latest iOS SDK or Wrapper SDK.

After running through the rest of this Troubleshooting guide, use the OneSignal SDK setLogLevel method to Verbose to check the full output from the device when reproducing the behavior.

If you need help interpreting the logs, you can share them with [email protected] as a .txt file to help our support and engineering teams assist you.


No recipients

In order for your users to be found when trying to send or update a Live Activity, you must ensure that the activity type, widget, and cURL request all have matching values.

  1. First, check the path parameters in your request to ensure that you are sending a correctly formatted request to the server. The App ID must match your App ID used in the OneSignal.Initialize method in your app and the activity type must match that of the type you've defined in your Live Activity file.

🚧

The upper and lower case letters in your path matter! If you have an activity with the activity type: struct UpperCaselowercaseAttributes, it should match what is in the url here too /activities/activity/UpperCaselowercaseAttributes

  1. In the body of the Push To Start request, you should have the following parameters:
--data '{
	"event": "start",
  "event_updates": {`
    `"dynamicData": "test"`
  `},
  "event_attributes": {
    "staticData": "test"
  },
  "included_segments": \["Subscribed Users"\],
  "activity_id": "my-id",
	"name": "Zenni Showcase",
	"contents": {
		"en": "English Message"
	}
}'
  • Event should be set to "start" for push to start requesets
  • Event Updates should contain any dynamic data you have defined in your struct under activity type (e.g. var dynamicData: String and that is used in your widget (e.g. contex.state.dynamicData). Ensure the letter casing and variables all match between the request, the type and the widget.
  • Event Attributes follows the same logic as Event Updates and must include all variables in use, and must match across all parts of the live activity and the request
  • Like with a push notification, the target of the message (included_segments in this case) and contents are required. All targets available to push can be used in this request.
  • Lastly, ensure that the Activity ID is included, as this will assign an ID to the widget and is what will be used to update the activity after it has been launched on the user's device.

Activity shows as sent, but was not received

  1. First we must ensure that the request is formatted, including the requirements in step 2 above. If any fields are omitted, where they are being used in the widget, the activity may not launch or update as expected.

  2. In your cURL request, determine the priority level you are setting under the priority parameter in the body of the request. If you are setting this to 10 (highest priority), try to lower this to 5 and test again. Apple will throttle requests being sent out too frequently per their own internal rate limits.

    1. If your use case for Live Activities relies on frequent updates, and messages should be sent with higher priority or frequency, please ensure that you've set the option to enable frequent updates in your plist:

No such module 'OneSignalLiveActivities':

In order for the Live Activities module to be found, the target must contain a reference to the OneSignalXCFramework dependency.

For builds using Swift Package Manager:

  • Ensure that the OneSignal dependency is added under any target importing the OneSignalLiveActivities package under "General" in the "Frameworks and Libraries" section here:

For builds using cocoapods (or wrapper SDK's):

  • You should have a Podfile in your project that defines dependencies to be installed for each target. In your Podfile, ensure that you have the added OneSignal to the target where you are importing OneSignalLiveActivities
target 'OneSignalWidgetExension' do
  pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
end
  • After adding this, ensure that you run pod install --repo-update from your terminal in the directory where the Podfile is located.

  • If you continue to see this error after doing this, you can add the dependency for this target manually by going to the Widget Extension Target > General > Click the '+' icon under "Frameworks and Libraries". Here you can select the dependencies you'd like added:


If stuck, contact support directly or email [email protected] for help.

For faster assistance, please provide:

  • Your OneSignal App Id
  • Details, logs, and/or screenshots of the issue.
  • Steps to reproduce

Please follow all steps below. If you are still having issues, please reach out to support with answers to the following questions and a log generated following the steps below.