Enable ScreenSet WebView debugging in Debug mode#85
Enable ScreenSet WebView debugging in Debug mode#85
Conversation
|
I have created a PR on the Android SDK so both iOS and Android can use the same solution on the gigya-flutter-plugin. |
|
@navaronbracke @tal-mi Sorry to disturb, but if you have time, can this one be given a quick review? |
| ?: mutableMapOf() | ||
|
|
||
| (arguments["isDebug"] as? Boolean)?.let { isDebug -> | ||
| if (isDebug) WebView.setWebContentsDebuggingEnabled(true).also { Log.d("SCREENSET_TAG", "Screenset Debuggable") } |
There was a problem hiding this comment.
Do we really need the Log.d() here?
There was a problem hiding this comment.
I have removed all the log functions from the PR
example/ios/Podfile.lock
Outdated
| PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b | ||
|
|
||
| COCOAPODS: 1.13.0 | ||
| COCOAPODS: 1.15.2 |
There was a problem hiding this comment.
IIRC Cocoapods currently recommends 1.16.0 ?
There was a problem hiding this comment.
Update my Cocoapods to the latest and now it references 1.16.2
example/lib/routes/home_page.dart
Outdated
|
|
||
| try { | ||
| screenSetSubscription = widget.sdk.showScreenSet(screenSet).listen( | ||
| screenSetSubscription = widget.sdk |
There was a problem hiding this comment.
The formatting is a bit off, due to the last comma?
| screenSetSubscription = widget.sdk | |
| screenSetSubscription = widget.sdk.showScreenSet(screenSet, isDebug: kDebugMode) |
ios/Classes/GigyaSdkWrapper.swift
Outdated
| guard let screenSet = arguments["screenSet"] as? String | ||
| if let isDebug = arguments["isDebug"] as? Bool, isDebug { | ||
| GigyaLogger.setDebugMode(to: isDebug) | ||
| print("Screenset Debuggable") |
There was a problem hiding this comment.
Do we need the print here?
| import android.content.pm.PackageInfo | ||
| import android.content.pm.PackageManager | ||
| import android.os.Build | ||
| import android.util.Log |
There was a problem hiding this comment.
The Log import can be removed.
| import android.util.Log |
Aims to resolve the issue (#84) where we are not able to interact with the Gigya ScreenSet webview as the debuggable property is not set. This issue is faced if we are using Appium with the Appium Flutter driver. Within the NATIVE_APP context we can access the webview, but not in FLUTTER context.
Implemented Fix
Accept a
isDebugvalue inshowScreenSetSDK function. If this istrue, we will setGigyaLoggerto debug in iOS and in Android we will callWebView.setWebContentsDebuggingEnabled(true).Alternate Implementation
Instead of adding a new
isDebugbool value, we can also useBuildConfig.DEBUG(Android) or#if DEBUG(iOS). Although this would make it a bit restricted for the users as those values are tied to the build rather than what the Flutter app passes via a function. But in most cases, this would work fine.