Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions sdk/src/main/java/io/radar/sdk/Radar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3882,20 +3882,6 @@ object Radar {
return RadarUtils.sdkVersion
}

internal fun showInAppMessages(inAppMessages: Array<RadarInAppMessage>) {
if (!initialized || !this::inAppMessageManager.isInitialized) {
return
}
inAppMessageManager.showInAppMessages(inAppMessages)
}

internal fun dismissInAppMessage() {
if (!initialized || !this::inAppMessageManager.isInitialized) {
return
}
inAppMessageManager.dismiss()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to where all the internal helper functions are at the bottom

/**
* Loads an image from a URL using the existing API pattern.
*
Expand Down Expand Up @@ -3934,6 +3920,28 @@ object Radar {
RadarSettings.pushNotificationToken = token
}

@JvmStatic
fun setPublishableKey(key: String) {
if (!initialized) {
return // do nothing if not initialized, because we need this.context
}
RadarSettings.setPublishableKey(this.context, key)
}
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The new public method setPublishableKey lacks KDoc documentation. Most other public @JvmStatic methods in this class (such as setUserId, setDescription, setMetadata, etc.) include KDoc comments explaining their purpose and parameters. Adding documentation would help developers understand when and how to use this method, especially since changing the publishable key at runtime may have important implications.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

There is no test coverage for the new setPublishableKey method. Other similar setter methods in the codebase have corresponding tests (e.g., test_Radar_setUserId, test_Radar_setDescription). Consider adding tests to verify that the method correctly updates the publishable key in RadarSettings when initialized, and that it silently returns when not initialized.

Copilot uses AI. Check for mistakes.

internal fun showInAppMessages(inAppMessages: Array<RadarInAppMessage>) {
if (!initialized || !this::inAppMessageManager.isInitialized) {
return
}
inAppMessageManager.showInAppMessages(inAppMessages)
}

internal fun dismissInAppMessage() {
if (!initialized || !this::inAppMessageManager.isInitialized) {
return
}
inAppMessageManager.dismiss()
}

internal fun handleLocation(context: Context, location: Location, source: RadarLocationSource) {
if (!initialized) {
initialize(context)
Expand Down