Skip to content

FENCE-2730: Add Silent Push#435

Open
alanjcharles14 wants to merge 5 commits intomasterfrom
alancharles/fence-2730-finish-silent-push-in-react-native
Open

FENCE-2730: Add Silent Push#435
alanjcharles14 wants to merge 5 commits intomasterfrom
alancharles/fence-2730-finish-silent-push-in-react-native

Conversation

@alanjcharles14
Copy link
Copy Markdown
Contributor

Summary

Exposes silent push notification methods from the native Radar SDKs to React Native. These methods enable apps to configure silent push for background location updates, manage push tokens on Android, and set up iOS location extensions with app groups. This also extends initialize() to forward RadarInitializeOptions (including silentPush, autoLogNotificationConversions, and autoHandleNotificationDeepLinks) to the iOS SDK.

New SDK Components

Radar.isInitialized() — Returns a Promise<boolean> indicating whether the Radar SDK has been initialized. Useful for Android silent push re-initialization logic where you need to check state before re-calling initialize.

Radar.setPushNotificationToken(token) — Sets the FCM push notification token for silent push on Android. No-op on iOS, where push tokens are registered via AppDelegate.

Radar.setAppGroup(groupId) — Sets the app group identifier for sharing data between the main app and iOS location extensions. No-op on Android.

Radar.setLocationExtensionToken(token) — Sets the token used by the iOS location extension for authenticated background location updates. No-op on Android.

Radar.initialize(publishableKey, fraud?, options?) — Updated to accept an optional options object. On iOS, this forwards silentPush, autoLogNotificationConversions, and autoHandleNotificationDeepLinks to RadarInitializeOptions. The options parameter is accepted but currently a no-op on Android.

How It Works

On iOS, initialize() now creates a RadarInitializeOptions object from the options dict and calls initializeWithPublishableKey:options: instead of initializeWithPublishableKey:. The setAppGroup and setLocationExtensionToken methods call directly through to their native SDK counterparts. setPushNotificationToken is a no-op since iOS handles push registration in AppDelegate.

On Android, setPushNotificationToken calls Radar.setPushNotificationToken() to register the FCM token for silent push. setAppGroup and setLocationExtensionToken are no-ops since those are iOS-specific concepts. The options parameter on initialize is accepted for API parity but is not yet forwarded to the Android SDK.

Both platforms support isInitialized(), which resolves the native SDK's initialization state as a boolean promise.

Copilot AI review requested due to automatic review settings March 26, 2026 21:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes silent push-related configuration and state APIs from the native Radar SDKs to the React Native surface area, including forwarding RadarInitializeOptions from initialize() on iOS.

Changes:

  • Extend the JS/TS public API with isInitialized, setPushNotificationToken, setAppGroup, and setLocationExtensionToken.
  • Update the native module initialize() signature to accept an options object and forward it to iOS RadarInitializeOptions.
  • Add corresponding native implementations on iOS and Android (old arch + new arch).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/index.native.ts Adds platform-gated JS API methods and extends initialize() to accept an options arg.
src/NativeRadar.ts Updates TurboModule spec with new methods and extended initialize() signature.
src/@types/RadarNativeInterface.ts Exposes new methods on the exported TS interface.
ios/RNRadar.mm Implements iOS options forwarding + new exported methods (no-op where appropriate).
android/src/oldarch/java/com/radar/RadarModule.java Updates initialize() signature and exports new ReactMethods.
android/src/newarch/java/com/radar/RadarModule.kt Updates new-arch module interface to include new methods/signature.
android/src/main/java/com/radar/RadarModuleImpl.java Implements Android-side logic for new methods (and no-ops for iOS-only concepts).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants