Open
Conversation
Contributor
There was a problem hiding this comment.
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, andsetLocationExtensionToken. - Update the native module
initialize()signature to accept anoptionsobject and forward it to iOSRadarInitializeOptions. - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 forwardRadarInitializeOptions(includingsilentPush,autoLogNotificationConversions, andautoHandleNotificationDeepLinks) to the iOS SDK.New SDK Components
Radar.isInitialized()— Returns aPromise<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-callinginitialize.Radar.setPushNotificationToken(token)— Sets the FCM push notification token for silent push on Android. No-op on iOS, where push tokens are registered viaAppDelegate.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 optionaloptionsobject. On iOS, this forwardssilentPush,autoLogNotificationConversions, andautoHandleNotificationDeepLinkstoRadarInitializeOptions. The options parameter is accepted but currently a no-op on Android.How It Works
On iOS,
initialize()now creates aRadarInitializeOptionsobject from theoptionsdict and callsinitializeWithPublishableKey:options:instead ofinitializeWithPublishableKey:. ThesetAppGroupandsetLocationExtensionTokenmethods call directly through to their native SDK counterparts.setPushNotificationTokenis a no-op since iOS handles push registration inAppDelegate.On Android,
setPushNotificationTokencallsRadar.setPushNotificationToken()to register the FCM token for silent push.setAppGroupandsetLocationExtensionTokenare no-ops since those are iOS-specific concepts. Theoptionsparameter oninitializeis 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.