Skip to content

add setPublishableKey#485

Open
ShiCheng-Lu wants to merge 2 commits intomasterfrom
shicheng/set-publishable-key
Open

add setPublishableKey#485
ShiCheng-Lu wants to merge 2 commits intomasterfrom
shicheng/set-publishable-key

Conversation

@ShiCheng-Lu
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings December 22, 2025 21:53
}
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

Copy link
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

This PR adds a new public method setPublishableKey() to allow updating the Radar SDK's publishable API key at runtime. The PR also relocates two internal methods (showInAppMessages and dismissInAppMessage) to a different position in the file.

Key Changes

  • Adds setPublishableKey(String) method with initialization check to update the publishable key after SDK initialization
  • Moves internal in-app message methods to appear after the new public method

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

Comment on lines 3923 to 3929
@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.
Comment on lines 3923 to 3929
@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.

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.
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.

1 participant