Conversation
| } | ||
| inAppMessageManager.dismiss() | ||
| } | ||
|
|
There was a problem hiding this comment.
moved to where all the internal helper functions are at the bottom
There was a problem hiding this comment.
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.
| @JvmStatic | ||
| fun setPublishableKey(key: String) { | ||
| if (!initialized) { | ||
| return // do nothing if not initialized, because we need this.context | ||
| } | ||
| RadarSettings.setPublishableKey(this.context, key) | ||
| } |
There was a problem hiding this comment.
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.
| @JvmStatic | ||
| fun setPublishableKey(key: String) { | ||
| if (!initialized) { | ||
| return // do nothing if not initialized, because we need this.context | ||
| } | ||
| RadarSettings.setPublishableKey(this.context, key) | ||
| } |
There was a problem hiding this comment.
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.
No description provided.