fix(android): use optBoolean for persistToken to prevent JSONException

Fix configuration error 'No value for persistToken' by using optBoolean()
instead of getBoolean(). The getBoolean() method throws JSONException
when the key doesn't exist, while optBoolean() returns the default value
(false) safely.

This allows configureNativeFetcher() to work when persistToken is not
provided in the options, which is the expected default behavior (tokens
are not persisted by default for security).
This commit is contained in:
Matthew Raymer
2025-12-24 09:35:09 +00:00
parent 11b86f1f2e
commit 973af9b688

View File

@@ -545,7 +545,8 @@ open class DailyNotificationPlugin : Plugin() {
// SECURITY WARNING: JWT token storage
// By default, tokens are NOT persisted to prevent storing bearer credentials at rest
// If persistence is required, caller must explicitly opt-in with persistToken: true
val persistToken = options.getBoolean("persistToken") ?: false
// Use optBoolean() to avoid JSONException when key doesn't exist
val persistToken = options.optBoolean("persistToken", false)
if (persistToken) {
Log.w(TAG, "SECURITY WARNING: JWT token will be persisted to unencrypted database. " +