diff --git a/docs/campaigns.mdx b/docs/campaigns.mdx index e106c5ecf..1a6a4dc58 100644 --- a/docs/campaigns.mdx +++ b/docs/campaigns.mdx @@ -74,7 +74,7 @@ The SDK will only sync up to the frequency cap number of notifications. As such, With Radar [Conversions](/api#log-a-conversion), you can log an event whenever a user interacts with a campaign notification. -Refer to the [iOS SDK Conversions reference](/sdk/ios#conversions) for setup instructions. +Refer to the [iOS SDK Conversions reference](/sdk/ios#conversions) or [React Native Conversion references](/sdk/react-native#conversions) for setup instructions. With Radar [Conversions](/api#log-a-conversion), you can also retrieve the source of an *opened_app* conversion for iOS apps. Within the *metadata* object of the [logged conversion](/sdk/ios#conversions), we will return a *conversion_source* with either - **`notification`** (app was opened using an external 3rd party notification) @@ -108,7 +108,7 @@ func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive respo } ``` -### Automated React Native setup (iOS only) +### React Native setup (iOS only) Radar's React Native SDK can automatically set up deep linking for you. To enable this feature, set the `autoHandleNotificationDeepLinks` option to `true` in the `radarInitializeOptions` via the `AppDelegate.mm`. ```Objective-C @@ -124,6 +124,16 @@ Radar's React Native SDK can automatically set up deep linking for you. To enabl return res; } ``` + +Alternatively perform the manual setup if you are setting the `AppDelegate` as the `UNUserNotificationCenterDelegate`. + +```objc +- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { + [Radar openURLFromNotification:notification:response.notification]; + completionHandler(); +} +``` + ### Handle system deep link Opening the notification will result in the SDK calling `[application openURL:url options:@{} completionHandler:nil];` This will open the URL in the app if it is registered for the scheme, or open the URL in the browser if it is not. diff --git a/docs/sdk/ios.mdx b/docs/sdk/ios.mdx index 5fd330e3f..348eeda39 100644 --- a/docs/sdk/ios.mdx +++ b/docs/sdk/ios.mdx @@ -1801,7 +1801,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { -Alternatively, perform the manual setup: + + When using the automatic setup `Radar.initialize()` must be called after the `UNUserNotificationCenterDelegate` has been set. Be aware of third party SDK setup that may also set `UNUserNotificationCenterDelegate` and override the setup. + + +Alternatively, implement the `UNUserNotificationCenterDelegate` and perform the following manual setup: + `[Radar nativeSetup:options];` must be called after the `UNUserNotificationCenterDelegate` has been set. Be aware of third party SDK setup that may also set `UNUserNotificationCenterDelegate` and override the automatic setup. + + +If you are setting the `AppDelegate` to be the `UNUserNotificationCenterDelegate`, you should perform the following manual setup: + +```objc +- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { + [Radar logConversionWithNotificationResponse:response]; + completionHandler(); +} +``` + ### Notification options On Android, you can call `setNotificationOptions` to set the icon and the background color of the foreground service and event notifications: