From 678f78e0778af884541bc807dae6075bfb99e253 Mon Sep 17 00:00:00 2001 From: Mewan Date: Thu, 14 Nov 2024 16:04:00 +0800 Subject: [PATCH 01/10] Update showScreenSet to accept isDebug optional bool --- ios/Classes/GigyaSdkWrapper.swift | 6 +++++- lib/gigya_flutter_plugin.dart | 2 ++ .../gigya_flutter_plugin_method_channel.dart | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ios/Classes/GigyaSdkWrapper.swift b/ios/Classes/GigyaSdkWrapper.swift index e818d6cb..74233d37 100644 --- a/ios/Classes/GigyaSdkWrapper.swift +++ b/ios/Classes/GigyaSdkWrapper.swift @@ -426,7 +426,11 @@ public class GigyaSdkWrapper :GigyaInstanceProtocol { return } - guard let screenSet = arguments["screenSet"] as? String + if let isDebug = arguments["isDebug"] as? Bool, isDebug { + GigyaLogger.setDebugMode(to: isDebug) + } + + guard let screenSet = arguments["screenSet"] as? String else { result(FlutterError(code: PluginErrors.missingParameterError, message: PluginErrors.missingParameterMessage, details: nil)) return diff --git a/lib/gigya_flutter_plugin.dart b/lib/gigya_flutter_plugin.dart index 11aa71e2..7b08a24f 100644 --- a/lib/gigya_flutter_plugin.dart +++ b/lib/gigya_flutter_plugin.dart @@ -201,10 +201,12 @@ class GigyaSdk { Stream showScreenSet( String name, { Map parameters = const {}, + bool isDebug = false, }) { return GigyaFlutterPluginPlatform.instance.showScreenSet( name, parameters: parameters, + isDebug: isDebug, ); } diff --git a/lib/src/platform_interface/gigya_flutter_plugin_method_channel.dart b/lib/src/platform_interface/gigya_flutter_plugin_method_channel.dart index 75f5ff2c..2118bca9 100644 --- a/lib/src/platform_interface/gigya_flutter_plugin_method_channel.dart +++ b/lib/src/platform_interface/gigya_flutter_plugin_method_channel.dart @@ -346,6 +346,7 @@ class MethodChannelGigyaFlutterPlugin extends GigyaFlutterPluginPlatform { Stream showScreenSet( String name, { Map parameters = const {}, + bool isDebug = false, }) async* { try { await methodChannel.invokeMethod( @@ -353,6 +354,7 @@ class MethodChannelGigyaFlutterPlugin extends GigyaFlutterPluginPlatform { { 'screenSet': name, 'parameters': parameters, + 'isDebug': isDebug, }, ); } on PlatformException catch (exception) { From 69923776708eb38e50ddc6384d41e802aa1d1a00 Mon Sep 17 00:00:00 2001 From: Mewan Date: Thu, 14 Nov 2024 16:04:39 +0800 Subject: [PATCH 02/10] Update Gigya to latest version in example app --- example/ios/Podfile.lock | 49 +++++++++++-------- ...gya_flutter_plugin_platform_interface.dart | 1 + 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index b2046e2f..3b79da1a 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -6,29 +6,36 @@ PODS: - AppAuth/ExternalUserAgent (1.7.5): - AppAuth/Core - Flutter (1.0.0) - - Gigya (1.6.2) + - Gigya (1.7.1) - gigya_flutter_plugin (1.0.0): - Flutter - - Gigya (>= 1.6.2) + - Gigya (>= 1.7.1) - GigyaAuth (>= 1.1.2) - GigyaAuth (1.1.2): - Gigya (>= 1.6.0) - google_sign_in_ios (0.0.1): + - AppAuth (>= 1.7.4) - Flutter - - GoogleSignIn (~> 6.2) - - GoogleSignIn (6.2.4): - - AppAuth (~> 1.5) - - GTMAppAuth (~> 1.3) - - GTMSessionFetcher/Core (< 3.0, >= 1.1) - - GTMAppAuth (1.3.1): - - AppAuth/Core (~> 1.6) - - GTMSessionFetcher/Core (< 3.0, >= 1.5) - - GTMSessionFetcher/Core (2.3.0) + - FlutterMacOS + - GoogleSignIn (~> 7.1) + - GTMSessionFetcher (>= 3.4.0) + - GoogleSignIn (7.1.0): + - AppAuth (< 2.0, >= 1.7.3) + - GTMAppAuth (< 5.0, >= 4.1.1) + - GTMSessionFetcher/Core (~> 3.3) + - GTMAppAuth (4.1.1): + - AppAuth/Core (~> 1.7) + - GTMSessionFetcher/Core (< 4.0, >= 3.3) + - GTMSessionFetcher (3.5.0): + - GTMSessionFetcher/Full (= 3.5.0) + - GTMSessionFetcher/Core (3.5.0) + - GTMSessionFetcher/Full (3.5.0): + - GTMSessionFetcher/Core DEPENDENCIES: - Flutter (from `Flutter`) - gigya_flutter_plugin (from `.symlinks/plugins/gigya_flutter_plugin/ios`) - - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`) + - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) SPEC REPOS: trunk: @@ -45,19 +52,19 @@ EXTERNAL SOURCES: gigya_flutter_plugin: :path: ".symlinks/plugins/gigya_flutter_plugin/ios" google_sign_in_ios: - :path: ".symlinks/plugins/google_sign_in_ios/ios" + :path: ".symlinks/plugins/google_sign_in_ios/darwin" SPEC CHECKSUMS: AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - Gigya: 0e6fa3447def67739461c489305cd1a82278857d - gigya_flutter_plugin: d0b75ee89ad68a01978c349d96e238e6582579d3 + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + Gigya: 69f7dbb2d2195930a5c3fc23c1a98f66595afa3f + gigya_flutter_plugin: 89ad5341d277cca4b6c3e637d8d3d72fb6892c80 GigyaAuth: 32cd49aa9eb380275ad10d85543a90ce326fe4fb - google_sign_in_ios: 1256ff9d941db546373826966720b0c24804bcdd - GoogleSignIn: 5651ce3a61e56ca864160e79b484cd9ed3f49b7a - GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd - GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2 + google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38 + GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db + GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de + GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b -COCOAPODS: 1.13.0 +COCOAPODS: 1.15.2 diff --git a/lib/src/platform_interface/gigya_flutter_plugin_platform_interface.dart b/lib/src/platform_interface/gigya_flutter_plugin_platform_interface.dart index 5dc5b7a8..81cc0381 100644 --- a/lib/src/platform_interface/gigya_flutter_plugin_platform_interface.dart +++ b/lib/src/platform_interface/gigya_flutter_plugin_platform_interface.dart @@ -177,6 +177,7 @@ abstract class GigyaFlutterPluginPlatform extends PlatformInterface { Stream showScreenSet( String name, { Map parameters = const {}, + bool isDebug = false, }) { throw UnimplementedError('showScreenSet() is not implemented.'); } From b2ee227a130fec78e2cfb7c266ccf69f79a574b9 Mon Sep 17 00:00:00 2001 From: Mewan Date: Thu, 14 Nov 2024 17:06:15 +0800 Subject: [PATCH 03/10] Add setWebContentsDebuggingEnabled if isDebug is true in showScreenSet --- .../kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt b/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt index 6cc72a15..dd8d5285 100644 --- a/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt +++ b/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt @@ -5,6 +5,7 @@ import android.app.Application import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.os.Build +import android.webkit.WebView import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.IntentSenderRequest import com.gigya.android.sdk.* @@ -723,6 +724,10 @@ class GigyaSDKWrapper(application: Application, accountObj: Cl arguments["parameters"] as MutableMap? ?: mutableMapOf() + (arguments["isDebug"] as? Boolean)?.let { isDebug -> + if (isDebug) WebView.setWebContentsDebuggingEnabled(true).also { Log.d("SCREENSET_TAG", "Screenset Debuggable") } + } + sdk.showScreenSet(screenSet, true, parameters, object : GigyaPluginCallback() { override fun onError(event: GigyaPluginEvent?) { handler.addScreenSetEvent( From 66528954d4fe34ddca8019502f9724987961a2b8 Mon Sep 17 00:00:00 2001 From: Mewan Date: Thu, 14 Nov 2024 17:07:01 +0800 Subject: [PATCH 04/10] Update initSdk to pass kDebugMode for isDebug in example app --- example/lib/routes/home_page.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/example/lib/routes/home_page.dart b/example/lib/routes/home_page.dart index 9f309808..53c92412 100644 --- a/example/lib/routes/home_page.dart +++ b/example/lib/routes/home_page.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:gigya_flutter_plugin/gigya_flutter_plugin.dart'; @@ -244,7 +245,12 @@ class _HomePageState extends State with WidgetsBindingObserver { const String screenSet = 'Default-RegistrationLogin1'; try { - screenSetSubscription = widget.sdk.showScreenSet(screenSet).listen( + screenSetSubscription = widget.sdk + .showScreenSet( + screenSet, + isDebug: kDebugMode, + ) + .listen( (ScreensetEvent event) { print('event type: ${event.type}'); print('event data: ${event.data}'); From 677b46a05af2982cbf27db02fe70e76049c9d429 Mon Sep 17 00:00:00 2001 From: Mewan Date: Thu, 14 Nov 2024 17:18:19 +0800 Subject: [PATCH 05/10] Add print Screenset Debuggable into iOS GigyaSdkWrapper --- ios/Classes/GigyaSdkWrapper.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/ios/Classes/GigyaSdkWrapper.swift b/ios/Classes/GigyaSdkWrapper.swift index 74233d37..a43e5f1d 100644 --- a/ios/Classes/GigyaSdkWrapper.swift +++ b/ios/Classes/GigyaSdkWrapper.swift @@ -428,6 +428,7 @@ public class GigyaSdkWrapper :GigyaInstanceProtocol { if let isDebug = arguments["isDebug"] as? Bool, isDebug { GigyaLogger.setDebugMode(to: isDebug) + print("Screenset Debuggable") } guard let screenSet = arguments["screenSet"] as? String From 8d8b044b8834955f1cd5720f05ea2f516af9a25c Mon Sep 17 00:00:00 2001 From: Mewan Date: Thu, 14 Nov 2024 18:04:28 +0800 Subject: [PATCH 06/10] Add Log util import in GigyaSDKWrapper for Android --- .../main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt b/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt index dd8d5285..1d311fba 100644 --- a/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt +++ b/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt @@ -5,6 +5,7 @@ import android.app.Application import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.os.Build +import android.util.Log import android.webkit.WebView import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.IntentSenderRequest From fc8052ed70c2c5f1ae0dce06c0229033ccbf16b5 Mon Sep 17 00:00:00 2001 From: Mewan Date: Mon, 9 Dec 2024 15:22:25 +0800 Subject: [PATCH 07/10] Update podfile.lock after using Cocoapods 1.16.2 --- example/ios/Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 3b79da1a..961dc639 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -67,4 +67,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 From a8ee0451b33bdc8b7864fb2dc40dd1a8ee225195 Mon Sep 17 00:00:00 2001 From: Mewan Date: Mon, 9 Dec 2024 15:23:29 +0800 Subject: [PATCH 08/10] Remove debug prints --- .../main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt | 2 +- ios/Classes/GigyaSdkWrapper.swift | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt b/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt index 1d311fba..fd1dff0d 100644 --- a/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt +++ b/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt @@ -726,7 +726,7 @@ class GigyaSDKWrapper(application: Application, accountObj: Cl ?: mutableMapOf() (arguments["isDebug"] as? Boolean)?.let { isDebug -> - if (isDebug) WebView.setWebContentsDebuggingEnabled(true).also { Log.d("SCREENSET_TAG", "Screenset Debuggable") } + if (isDebug) WebView.setWebContentsDebuggingEnabled(true) } sdk.showScreenSet(screenSet, true, parameters, object : GigyaPluginCallback() { diff --git a/ios/Classes/GigyaSdkWrapper.swift b/ios/Classes/GigyaSdkWrapper.swift index a43e5f1d..74233d37 100644 --- a/ios/Classes/GigyaSdkWrapper.swift +++ b/ios/Classes/GigyaSdkWrapper.swift @@ -428,7 +428,6 @@ public class GigyaSdkWrapper :GigyaInstanceProtocol { if let isDebug = arguments["isDebug"] as? Bool, isDebug { GigyaLogger.setDebugMode(to: isDebug) - print("Screenset Debuggable") } guard let screenSet = arguments["screenSet"] as? String From fb28727f9e484f22ffebf9a5452421a39dcc4d8d Mon Sep 17 00:00:00 2001 From: Mewan Date: Mon, 9 Dec 2024 15:23:45 +0800 Subject: [PATCH 09/10] Fix code styling --- example/lib/routes/home_page.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/example/lib/routes/home_page.dart b/example/lib/routes/home_page.dart index 53c92412..561cfd71 100644 --- a/example/lib/routes/home_page.dart +++ b/example/lib/routes/home_page.dart @@ -245,12 +245,8 @@ class _HomePageState extends State with WidgetsBindingObserver { const String screenSet = 'Default-RegistrationLogin1'; try { - screenSetSubscription = widget.sdk - .showScreenSet( - screenSet, - isDebug: kDebugMode, - ) - .listen( + screenSetSubscription = + widget.sdk.showScreenSet(screenSet, isDebug: kDebugMode).listen( (ScreensetEvent event) { print('event type: ${event.type}'); print('event data: ${event.data}'); From f621c03843fa0c793cefd266aef08a5df033d54f Mon Sep 17 00:00:00 2001 From: Mewan Date: Mon, 9 Dec 2024 15:36:18 +0800 Subject: [PATCH 10/10] Remove unused import in GigyaSDKWrapper --- .../main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt b/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt index fd1dff0d..8142cbc9 100644 --- a/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt +++ b/android/src/main/kotlin/com/sap/gigya_flutter_plugin/GigyaSDKWrapper.kt @@ -5,7 +5,6 @@ import android.app.Application import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.os.Build -import android.util.Log import android.webkit.WebView import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.IntentSenderRequest