From c5adfd87018c945f0aa03cd404d20aeefc1a59b6 Mon Sep 17 00:00:00 2001 From: mykyta-frontegg Date: Thu, 16 Apr 2026 12:13:33 +0200 Subject: [PATCH 1/2] Added support for disable automatic token refresh --- application_id/android/app/build.gradle | 2 ++ application_id/ios/Runner/Frontegg.plist | 3 +++ docs/usage.md | 23 +++++++++++++++++++++++ embedded/android/app/build.gradle | 2 ++ embedded/ios/Runner/Frontegg.plist | 3 +++ hosted/android/app/build.gradle | 2 ++ hosted/ios/Runner/Frontegg.plist | 3 +++ 7 files changed, 38 insertions(+) diff --git a/application_id/android/app/build.gradle b/application_id/android/app/build.gradle index b52ff7c3..13124fef 100644 --- a/application_id/android/app/build.gradle +++ b/application_id/android/app/build.gradle @@ -69,6 +69,8 @@ android { buildConfigField "String", 'FRONTEGG_APPLICATION_ID', "\"$fronteggApplicationId\"" buildConfigField "Boolean", 'FRONTEGG_USE_ASSETS_LINKS', "true" buildConfigField "Boolean", 'FRONTEGG_USE_CHROME_CUSTOM_TABS', "true" + // Set to true to disable automatic token refresh. + buildConfigField "boolean", "FRONTEGG_DISABLE_AUTO_REFRESH", "false" testInstrumentationRunner "pl.leancode.patrol.PatrolJUnitRunner" testInstrumentationRunnerArguments clearPackageData: "true" diff --git a/application_id/ios/Runner/Frontegg.plist b/application_id/ios/Runner/Frontegg.plist index e99c8b72..748d9418 100644 --- a/application_id/ios/Runner/Frontegg.plist +++ b/application_id/ios/Runner/Frontegg.plist @@ -14,5 +14,8 @@ f717b75f-e09a-48cc-a84e-e20a8454a9cf logLevel trace + + disableAutoRefresh + diff --git a/docs/usage.md b/docs/usage.md index 28f9c0e6..7c8a174c 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -245,6 +245,29 @@ When `FRONTEGG_ENABLE_OFFLINE_MODE` is `true`, the SDK keeps the session with st **Optional:** if you rely on auto-reconnect after offline, you can tune the ContentProvider debounce via manifest metadata on `com.frontegg.android.init.FronteggInitProvider` (`frontegg.autoreconnect.debounceMs`), as documented for the Android SDK. +#### Disable automatic token refresh + +You can disable automatic token refresh in Flutter projects through the native SDK configuration. + +Android (`android/app/build.gradle`): + +```groovy +buildConfigField "boolean", "FRONTEGG_DISABLE_AUTO_REFRESH", "true" +``` + +iOS (`Frontegg.plist`): + +```xml +disableAutoRefresh + +``` + +Behavior: + +- Default is `false` (automatic refresh stays enabled). +- When enabled, SDK internal/automatic refresh flows are blocked (including timer-based/background auto refresh). +- Manual refresh APIs are still available (for example, `await frontegg.refreshToken()`). + You can access the current state of `FronteggFlutter` in two ways: 1. Get `currentState`: diff --git a/embedded/android/app/build.gradle b/embedded/android/app/build.gradle index 2e960c95..c3cd01cf 100644 --- a/embedded/android/app/build.gradle +++ b/embedded/android/app/build.gradle @@ -68,6 +68,8 @@ android { buildConfigField "String", 'FRONTEGG_DEEP_LINK_SCHEME', "\"test\"" buildConfigField "boolean", "FRONTEGG_ENABLE_OFFLINE_MODE", "true" buildConfigField "int", "FRONTEGG_NETWORK_MONITORING_INTERVAL_SECONDS", "10" + // Set to true to disable automatic token refresh. + buildConfigField "boolean", "FRONTEGG_DISABLE_AUTO_REFRESH", "false" testInstrumentationRunner "pl.leancode.patrol.PatrolJUnitRunner" testInstrumentationRunnerArguments clearPackageData: "true" diff --git a/embedded/ios/Runner/Frontegg.plist b/embedded/ios/Runner/Frontegg.plist index e76c8ecf..17c9009c 100644 --- a/embedded/ios/Runner/Frontegg.plist +++ b/embedded/ios/Runner/Frontegg.plist @@ -21,5 +21,8 @@ networkMonitoringInterval 10 + + disableAutoRefresh + diff --git a/hosted/android/app/build.gradle b/hosted/android/app/build.gradle index ce850a77..57e95f52 100644 --- a/hosted/android/app/build.gradle +++ b/hosted/android/app/build.gradle @@ -65,6 +65,8 @@ android { buildConfigField "String", 'FRONTEGG_CLIENT_ID', "\"$fronteggClientId\"" buildConfigField "Boolean", 'FRONTEGG_USE_ASSETS_LINKS', "true" buildConfigField "Boolean", 'FRONTEGG_USE_CHROME_CUSTOM_TABS', "true" + // Set to true to disable automatic token refresh. + buildConfigField "boolean", "FRONTEGG_DISABLE_AUTO_REFRESH", "false" testInstrumentationRunner "pl.leancode.patrol.PatrolJUnitRunner" testInstrumentationRunnerArguments clearPackageData: "true" diff --git a/hosted/ios/Runner/Frontegg.plist b/hosted/ios/Runner/Frontegg.plist index 2db87b4b..d03a8294 100644 --- a/hosted/ios/Runner/Frontegg.plist +++ b/hosted/ios/Runner/Frontegg.plist @@ -10,5 +10,8 @@ 5f493de4-01c5-4a61-8642-fca650a6a9dc logLevel trace + + disableAutoRefresh + From e6cd4599ac24f63091c792094669e19634e278d5 Mon Sep 17 00:00:00 2001 From: mykyta-frontegg Date: Sun, 19 Apr 2026 16:47:08 +0200 Subject: [PATCH 2/2] Added support for disable automatic token refresh --- android/build.gradle | 2 +- application_id/android/app/build.gradle | 2 +- docs/README.md | 2 +- embedded/android/app/build.gradle | 4 ++-- embedded/ios/Podfile.lock | 4 ++-- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- .../Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- embedded/ios/Runner/Frontegg.plist | 2 +- embedded/lib/main_page.dart | 2 +- hosted/android/app/build.gradle | 2 +- ios/frontegg_flutter/Package.swift | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index fd422700..cc51684f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -66,7 +66,7 @@ dependencies { testImplementation 'org.jetbrains.kotlin:kotlin-test' testImplementation 'org.mockito:mockito-core:5.0.0' - implementation 'com.frontegg.sdk:android:1.3.25' + implementation 'com.frontegg.sdk:android:1.3.26' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' implementation 'androidx.core:core-ktx:1.10.0' diff --git a/application_id/android/app/build.gradle b/application_id/android/app/build.gradle index 13124fef..32c7aa6d 100644 --- a/application_id/android/app/build.gradle +++ b/application_id/android/app/build.gradle @@ -128,5 +128,5 @@ flutter { dependencies { androidTestUtil "androidx.test:orchestrator:1.5.1" - implementation 'com.frontegg.sdk:android:1.3.25' + implementation 'com.frontegg.sdk:android:1.3.26' } diff --git a/docs/README.md b/docs/README.md index f5dc272d..aaa1f8a3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -34,7 +34,7 @@ Sign up here → [https://portal.us.frontegg.com/signup](https://portal.us.front The Flutter SDK supports Frontegg's **per-tenant sessions** feature through the underlying native SDKs. -- On **Android**, the plugin and example apps use `com.frontegg.sdk:android:1.3.25`. +- On **Android**, the plugin and example apps use `com.frontegg.sdk:android:1.3.26`. - On **iOS**, the plugin depends on `FronteggSwift`: - **Flutter 3.41+** (SPM): `1.3.0` from GitHub. Run `flutter config --enable-swift-package-manager`, then `flutter pub get` and build. - Note: CocoaPods fallback is no longer supported for `FronteggSwift`. diff --git a/embedded/android/app/build.gradle b/embedded/android/app/build.gradle index c3cd01cf..9ce78fc7 100644 --- a/embedded/android/app/build.gradle +++ b/embedded/android/app/build.gradle @@ -69,7 +69,7 @@ android { buildConfigField "boolean", "FRONTEGG_ENABLE_OFFLINE_MODE", "true" buildConfigField "int", "FRONTEGG_NETWORK_MONITORING_INTERVAL_SECONDS", "10" // Set to true to disable automatic token refresh. - buildConfigField "boolean", "FRONTEGG_DISABLE_AUTO_REFRESH", "false" + buildConfigField "boolean", "FRONTEGG_DISABLE_AUTO_REFRESH", "true" testInstrumentationRunner "pl.leancode.patrol.PatrolJUnitRunner" testInstrumentationRunnerArguments clearPackageData: "true" @@ -128,5 +128,5 @@ flutter { dependencies { androidTestUtil "androidx.test:orchestrator:1.5.1" - implementation 'com.frontegg.sdk:android:1.3.25' + implementation 'com.frontegg.sdk:android:1.3.26' } diff --git a/embedded/ios/Podfile.lock b/embedded/ios/Podfile.lock index 04ce69d8..f94baf00 100644 --- a/embedded/ios/Podfile.lock +++ b/embedded/ios/Podfile.lock @@ -28,8 +28,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 - fluttertoast: 21eecd6935e7064cc1fcb733a4c5a428f3f24f0f - patrol: cf2cd48c7f3e5171610111994f7b466cd76d1f57 + fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1 + patrol: 51b76cc7c11a2933ee3e72482d930c75b9d4ec73 PODFILE CHECKSUM: c9be09f6a61958d6788db8b9ee489767b65cfa92 diff --git a/embedded/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/embedded/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 274ed81a..57ae5e84 100644 --- a/embedded/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/embedded/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/frontegg/frontegg-ios-swift.git", "state" : { - "revision" : "bcbc16bc0491899587a3d73d606dede773e819e9", - "version" : "1.3.0" + "revision" : "995bd57cf5c3d6d9bcdd0bf80c7677853d7861e0", + "version" : "1.3.2" } }, { diff --git a/embedded/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/embedded/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index 274ed81a..57ae5e84 100644 --- a/embedded/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/embedded/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/frontegg/frontegg-ios-swift.git", "state" : { - "revision" : "bcbc16bc0491899587a3d73d606dede773e819e9", - "version" : "1.3.0" + "revision" : "995bd57cf5c3d6d9bcdd0bf80c7677853d7861e0", + "version" : "1.3.2" } }, { diff --git a/embedded/ios/Runner/Frontegg.plist b/embedded/ios/Runner/Frontegg.plist index 17c9009c..b98e095a 100644 --- a/embedded/ios/Runner/Frontegg.plist +++ b/embedded/ios/Runner/Frontegg.plist @@ -23,6 +23,6 @@ 10 disableAutoRefresh - + diff --git a/embedded/lib/main_page.dart b/embedded/lib/main_page.dart index f5bbfc41..2e00db0d 100644 --- a/embedded/lib/main_page.dart +++ b/embedded/lib/main_page.dart @@ -103,4 +103,4 @@ class MainPage extends StatelessWidget { ), ); } -} +} \ No newline at end of file diff --git a/hosted/android/app/build.gradle b/hosted/android/app/build.gradle index 57e95f52..fc7dbd46 100644 --- a/hosted/android/app/build.gradle +++ b/hosted/android/app/build.gradle @@ -124,5 +124,5 @@ flutter { dependencies { androidTestUtil "androidx.test:orchestrator:1.5.1" - implementation 'com.frontegg.sdk:android:1.3.25' + implementation 'com.frontegg.sdk:android:1.3.26' } diff --git a/ios/frontegg_flutter/Package.swift b/ios/frontegg_flutter/Package.swift index 281d64d1..4798c8bf 100644 --- a/ios/frontegg_flutter/Package.swift +++ b/ios/frontegg_flutter/Package.swift @@ -13,7 +13,7 @@ let package = Package( ], dependencies: [ .package(name: "FlutterFramework", path: "../FlutterFramework"), - .package(url: "https://github.com/frontegg/frontegg-ios-swift.git", exact: "1.3.0"), + .package(url: "https://github.com/frontegg/frontegg-ios-swift.git", exact: "1.3.2"), ], targets: [ .target(