Giter VIP home page Giter VIP logo

gigya-flutter-plugin's People

Contributors

ajinkyapatil8190 avatar arok avatar dooks123 avatar escargot9101 avatar galunecandrey avatar mewanwa avatar navaronbracke avatar nemscep avatar sagishm avatar tal-mi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gigya-flutter-plugin's Issues

Session not being kept

Hey, I am having trouble with keeping the session.

After I log in with the SDK, I am not able to keep the session. If I kill the app and open it again, I am logged out, and I need to log in again.

I tried your example as well, and it seems like that I am doing quite close with what you are doing. Any behind the scene configuration that I need to do?

I added the URL Types as well.

Thanks!

Changelog lists oldest version first

The CHANGELOG.md file lists the oldest version first, which is wrong.

The changelog should list the most recent version first, so that the newest changes are visible immediately, without having to scroll to the bottom.

LinktToSite conflicting accounts throw an Unhandled Exception

image

When logging with Google, and having an Interruption because of Login identifier exists, following the example app behavior, linking to site throws an unhandled exception even when it is inside a Try Catch block.
Stack trace points to the platform channel

The code after caching the initial exception after loging is:

if (e.getInterruption() == Interruption.conflictingAccounts) {
   handleGigyaInterruption(e);
}

.....


Future<void> handleGigyaInterruption(GigyaResponse e) async {
  try {
    LinkAccountResolver resolver =
        GigyaSdk.instance.resolverFactory.getResolver(e);
    final ConflictingAccounts conflictingAccounts =
        await resolver.getConflictingAccounts();
    if (conflictingAccounts.loginProviders.contains('site')) {
      _showLinkToSiteBottomSheet(
        conflictingAccounts.loginID,
        resolver,
      );
    } else {
      _showLinkToSocialBottomSheet(SocialProvider.google, resolver);
    }
  } catch (e, s) {
    print('---------------  Social Login Google INTERRUPTION ERROR: $e, $s');
    print('STATUS ${e.statusCode}: ${e.statusReason}');
    print('ERROR ${e.errorCode}: ${e.errorDetails} ${e.mapped}');
    print('------------------------------------------');
  }
}

The functions _showLinkToSiteBottomSheet and _showLinkToSocialBottomSheet are exactly the same than the example application's ones.

Captcha required when social login with Google

Hello, when logging in with google, it throws an error:

ERROR 401020: Login Failed Captcha Required {callId: 264bd1b9ba6a4b67805dd59d5931cb2a, errorCode: 401020, errorDetails: Login Failed Captcha Required, errorMessage: Login Failed Captcha Required, apiVersion: 2, statusCode: 401, statusReason: Unauthorized, time: 2021-06-10T10:05:28.931Z, errorFlags: captchaNeeded}

How should we implement that captcha?

SDK swallows login exception details

When logging in with invalid username and password, the method GigyaError.fromPlatformException returns const GigyaError(). The interesting details of the exception are not passed through to the calling method.

Getting error message on register users

Hi there!
We are using your awesome plugin in our app, and we encountered a problem with getting the exact error message.

We are using:

  • gigya-flutter-plugin - 0.0.2
  • Swift SDK (on IOS)

For example, on login error, we get the exact error message in the errorDetails property:

Screenshot 2021-02-22 at 17 23 21

But, if we get an error on register a new user, we get a Validation failed on the errorDetails property:

Screenshot 2021-02-22 at 16 22 08

We looked a bit in the source code of the plugin and we found that the error message is on a property called ValidationErrors:

Screenshot 2021-02-19 at 12 39 25

But this property is not included in the gigya_models.dart file:

Screenshot 2021-02-19 at 12 48 39

We are not sure if it is intended to be this way, or if it is possible to retrieve the error in another way?

We tried to add to the models file an attribute like validationErrors = json['validationErrors']?.elementAt(0)['message'], and it works on registration error, but gives some trouble on succesful login.

Just for some context, we used your code in the example folder on this repo:

void onLoginPress(user, password) async {
    setState(() {
      _inProgress = true;
    });
    GigyaSdk.instance.login(user, password).then((result) {
      final response = Account.fromJson(result);
      setState(() {
        _inProgress = false;
        _requestResult = 'Login success:\n\n ${response.uid}';
      });
      Get.offAll(GigyaLoginChecker());
    }).catchError((error) {
      setState(() {
        _inProgress = false;
        _requestResult = 'Register error\n\n${error.errorDetails}';
      });
    });
  }

We will much appreciate your help :)

Web Support

The extension types language feature is scheduled to ship in Dart 3.3, which is the next stable release for Q1 2024. This is currently available on the Flutter beta channel.

The Gigya SDK provides a web implementation as defined here

Proposal

Add support to the gigya_flutter_plugin using this API so that the plugin also works on the web.
Preferably this is done using Dart's JavaScript interop, which is the new way of implementing web specific functionality for plugins.

Methods

  • initSdk() #45
    • add cname argument to web platform interface, per #71
    • handle network error when trying to load the SDK (intercept script.onError event & remove the script tag from the DOM)
  • isLoggedIn() #45
  • logout() #45
  • addConnection() #53
  • finalizeRegistration() (only supported on the web?) #50
  • forgotPassword() #64
  • getAccount() #52
  • getSession()
  • linkToSite()
  • login() #45
    • Add the user's preferences and subscriptions to the account response where needed
  • register() #50
  • removeConnection() #53
  • send() (not supported on the web?)
  • setAccount() #52
  • setSession()
  • showScreenSet() #54
  • dismissScreenset() see f5b4314 for context
  • socialLogin() #51
  • sso()
  • getJWT() (port for native using send("accounts.getJWT"))

Services

  • InterruptionResolverFactory
  • OtpService
  • WebAuthenticationService

Other

  • use the new package:web instead of dart:html for accessing the window and such
    • Bump package:web to version 0.5.0
  • fixup the stub for Promise, which should have been a JSPromise from dart:js_interop
  • fix the generic type for JSArray / JSPromise (fix has landed upstream in the Dart SDK)
  • audit any missing thisArg arguments for callAsFunction() invocations (otherwise we'll run into type errors)
  • Add missing const to empty list literals, const <Foo>[]
  • Migrate existing bindings to extension types
    • We can also get rid of the helper class for the Response interop layer for our use case. The new extension types have access to the representation type. Thus we can have the 'overridden' methods redeclared, using the supertype for implementation purposes.
  • Migrate to using the explicit Javascript types (JSObject, JSFunction, JSPromise once the interop API is further along) Primitive types are still allowed (int, double, null, bool, String) See https://github.com/dart-lang/sdk/blob/main/sdk/lib/js_interop/js_interop.dart
  • Audit uses of // ignore_for_line / // ignore_for_file (There are 4~ uses, but these are needed to keep API variable names)
  • Audit whether the web implementation forwards the error details (errorCode, errorMessage, errorDetails) to GigyaError()
  • Remove exports in web/static_interop/response.dart
  • Remove the WebErrorCode enum (it only has one usage in the Dart implementation of the Web SDK, which is not what I expected it to have. Keeping it around probably is not worth it)
  • Run dart format on the web implementation sources (the formatter doesn't yet support extension types)
  • Replace dart:js_util, package:js, and dart:js imports with dart:js_interop and dart:js_interop_unsafe, as the former is now unsupported in dart2wasm
  • Replace uses of allowInterop(Function) with Function.toJS, as the latter is what the web compilers do for the Function type
  • Remove the redundant @staticInterop and @anonymous annotations, these are not needed for extension types

Nice to have

  • WASM support (see also the upcoming kIsWasm constant)
  • Fix the manual is checks for JS types. On the JS backends (dart2js, DDC, dart2wasm) these checks will always succeed due to an implementation detail. Instead we should use the new isA<T extends JSAny>() function from dart:js_interop. This new function is only available in Dart 3.4, so it will have to wait a little.
  • Support dynamically structured JS objects in the interop layer, using dartify()/ jsify() interop API's
    • context parameter
    • data parameter for get/set accountInfo
    • customButtons parameter (showScreenset)
    • customLang parameter (showScreenset)
    • Support global configuration, as defined here: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/415942c570b21014bbc5a10ce4041860.html
      • I think just documenting how to do this yourself is the better option, since initSdk() manually loads the Gigya script on-demand, which prevents uers from including the global config there. We should just tell users to add a <script> tag in the <head> of their index.html, which initializes window.__gigyaConf. We could also add a Dart API to set the configuration, but in my opinion this is not worth the effort.

Missing plugin exception in obfuscated build

Hello there! πŸ‘‹

When app is build in release (minified R8) mode, I keep getting this exception:

Unhandled Exception: MissingPluginException(No implementation found for method isLoggedIn on channel com.sap.gigya_flutter_plugin/methods)

If I set minify to false, it is working as expected, but this is a "dirty" workaround since minification is a must for all android builds going live.
So, instead of disabling minification globally, a kinda better workaround I found is utilizing proguard to skip minification for only gigya sdk stuff like this:

-keep class com.gigya.** { *; }

Even though proguard is an optimal workaround, this seems like a library issue which needs fixing πŸ€·β€β™‚οΈ

Version: 1.0.1
Platform: Android
Flutter version: 3.10.3

Cheers ✌️

Google Social Login generic error

We are getting a generic 400 gigya error when using Google Login. It happens in random time intervals.

We are not able to reproduce locally, only when uploaded to the Play Store.

The plugin's public API needs documentation & typing improvements

The current public API of the plugin, as viewed under the LIBRARIES section on pub.dev is rather hard to understand.

I note the following:

  • methods that return a Future<Map<String, dynamic>> never document what exactly is in the returned Map.
    • I also wonder if the return type of those methods can be changed to a specific model class to make the typing more resilient
  • the method showScreenSet() returns dynamic, which does not make sense. Is it void/Future/something else?
  • when passing a Map<String, dynamic> as arguments to a function, the function never documents what should be in the Map
  • don't use dynamic for the type of a method parameter
  • if a method has some Dartdoc documentation, it is very short and does not really explain what the method does.
    Consider writing a paragraph of documentation that clearly explains the purpose of the method

I am aware that the plugin is in its early stages, I just wanted to highlight some things I noticed.
I am not sure if pull requests are welcome, I would certainly help out with cleaning this up a little.

[Android] Crash when canceled `showScreenSet()`

On Android devices, when back from Web Screen-Set with hardware back key, EventChannel('screensetEvents') throws the following error (uncatchable) and the application crashes.

PlatformException(200001, Operation canceled, null, null)

The cause of this is the flutter side implementation of the plugin do not pass onError to EventChannel('screensetEvents').receiveBroadcastStream().listen().

    const EventChannel _stream = EventChannel('screensetEvents');
    _screenSetsEventStream = _stream.receiveBroadcastStream().listen((onData) {
      onScreenSetEvent(
        onData['event'],
        onData['data'],
      );
      if (onData['event'] == 'onHide' || onData['event'] == 'onCanceled') {
        _screenSetsEventStream = null;
      }
    });

But, I think, Android's onCanceled should be returned by success() instead of error() like onError in the first place.

Not really good:

            override fun onCanceled() {
                screenSetsEventsSink?.error("200001", "Operation canceled", null)
                screenSetsEventsHandler = null
                screenSetEventsChannel = null
                screenSetsEventsSink = null
            }

LGTM:

            override fun onCanceled() {
                screenSetsEventsSink?.success(
                    mapOf(
                        "event" to "onCanceled",
                        "data" to mapOf<String, Any>()
                    )
                )
                screenSetsEventsHandler = null
                screenSetEventsChannel = null
                screenSetsEventsSink = null
            }

Thank you.

[Technical debt] Update the README to mention iOS 13 as the minimum

The readme indicates the minimum Android version that is supported.
However, for iOS this is not the case.

Since we recently bumped the iOS version to iOS 13 (to make specific code paths easier, since they no longer require #available checks), we should mention iOS 13.0 as the minimum version.

Also, there is a typo for the iOS AppDelegate setup, which mentions "Android" instead of "iOS", see https://github.com/SAP/gigya-flutter-plugin/blob/main/README.md#ios-setup

Show screenset inAppWebview

Hi devs,
using your sdk we are able to show screensets in a standalone webview.
How is it possible to open the screenset in a inAppWebview or in another container to avoid to see an other view on top of our main view?

MissingPluginException(No implementation found for method showScreenSet on channel gigya_flutter_plugin)

HI,
I'm facing an error when I try to use an apk built in release mode.

Unhandled Exception: MissingPluginException(No implementation found for method showScreenSet on channel gigya_flutter_plugin)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154)

#1 GigyaSdk.showScreenSet (package:gigya_flutter_plugin/gigya_flutter_plugin.dart:298)

Can you help us?
Thanks

Login session is lost after reopen the app

Hi @tal-mi
I noticed that after I log in with an active user in the gigya-flutter-plugin app, the active login session is not retained if I close the app and reopen it again.
Could you please help me if there is any parameter set to retain the login session even after I close the app and reopen.

Regards
Suresh

Finalize registration

Hi, we have required fields in our user schema, and so when users use social login, some fields are missing.

If I'm not wrong, we should call finalizeRegistration with the missing data:

https://help.sap.com/viewer/8b8d6fffe113457094a17701f63e3d6a/GIGYA/en-US/228cd8bc68dc477094b3e0e9fe108e23.html

Pointed in gigya's docs:

Account pending registration (error code 206001) - returned when you call a method that performs social login, such as this method, and the registration process has not been finalized, or the schema defines fields as required and one or more of these fields are missing from the user Profile or custom data fields. The expected next step is: if the schema defines fields that are required and one or more of these fields are missing from the user profile or data, call accounts.setAccountInfo. If the registration process has not been finalized, call accounts.finalizeRegistration with the regToken.

How should we handle this situation with Flutter SDK? We tried to use setAccount to set missing fields, but we can't call setAccount if the user is not logged in. (and he can't log in if his registration process has not finished)

UPDATE:

I've advanced in the flux, which is similar to conflictingAccounts.

Now I need to update the account using the resolver:

                resolver.setAccount({
                  "profile": json.encode({
                    "birthMonth": '5',
                    "birthYear": '5',
                  }),
                });

I'm just getting this error:

E/flutter (22965): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: type 'ArgumentError' is not a subtype of type 'PlatformException'
E/flutter (22965): #0      PendingRegistrationResolver.setAccount.<anonymous closure> (package:gigya_flutter_plugin/interruption/interruption_resolver.dart:72:48)
E/flutter (22965): #1      _rootRunUnary (dart:async/zone.dart:1362:47)
E/flutter (22965): #2      _CustomZone.runUnary (dart:async/zone.dart:1265:19)
E/flutter (22965): #3      _FutureListener.handleError (dart:async/future_impl.dart:172:20)
E/flutter (22965): #4      Future._propagateToListeners.handleError (dart:async/future_impl.dart:719:47)
E/flutter (22965): #5      Future._propagateToListeners (dart:async/future_impl.dart:740:24)
E/flutter (22965): #6      Future._completeError (dart:async/future_impl.dart:550:5)
E/flutter (22965): #7      _completeOnAsyncError (dart:async-patch/async_patch.dart:274:13)
E/flutter (22965): #8      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart)
E/flutter (22965): <asynchronous suspension>
  • First, could you documentate how to use that method?

  • Second, there is an error trying to parse an exception as you can see above.

Hide screenset programatically

When using this to show a screenset:

GigyaSdk.instance.showScreenSet(screenSet, (event, map) {
  debugPrint('Screen set event received: $event');
  debugPrint('Screen set event data received: $map');
  if (event == 'onHide' || event == 'onLogin') {
    setState(() {});
  }
});

How can I close the screenset shown if there is an error event coming through?

`cname` argument missing in sdk.init call

Hello there!
It seems that configuring the sdk with json or cname is not possible in 1.0.1 πŸ€”
Would it be possible to add cname argument in sdk init method, since android and ios support it and currently just don't use it, or generally to support initialization of the sdk using a json file πŸ€·β€β™‚οΈ

Thanks! ✌️

[Technical Debt] Update Swift wrappers for Facebook & GoogleSignIn

Currently the Swift wrapper classes for Facebook & GoogleSignIn are out of date, which breaks the example app on iOS.
You can run the example if you comment out the Swift wrappers, but that is not ideal for a fully featured example app.

Proposal

  1. Bump the google_sign_in & facebook_auth dependencies (the versions are a bit out of date)
  2. Update the Swift wrappers for the integrations

when forcing logout from init, in case of errors the plugin content is blank

from the plugin:

  /// Init SDK using apiKey and apiDomain
  Future<Map<String, dynamic>?> initSdk(String apiKey, String apiDomain,
      [bool forceLogout = true]) async {
    if (forceLogout) {
      await logout();
    }

sometimes, when there's some issue with the method logout:

 await _channel.invokeMethod(Methods.logOut.name).catchError((error) {
      debugPrint('Error logging out');
    }).timeout(getTimeout(Methods.logOut), onTimeout: () {
      debugPrint('A timeout that was defined in the request is reached');
      return timeoutError();
    });

the message "Error logging out" is shown on the console, and the login page inside the plugin is blank, no actions can be taken. Any way to handle the error and ignore the force logout?

Screenshot 2022-11-17 at 10 03 56

Google Social Login missing error info

Hi, we have setup google social login. When we launch google's social login, the native google login screen is launched, but after selecting a google account and coming back to our application, we receive a 400 error with no errorReason, so we cannot find out what's failing.

We have followed all the instructions in Gigya's core SDK to enable Google sign-in.

Code fragment:

try {
              var result =
                  await GigyaSdk.instance.socialLogin(SocialProvider.google);
              print('---------------  Social Login Google OK');
              print('---------------  $result');
            } on GigyaResponse catch (e) {
              print('---------------  Social Login Google ERROR');
              print('STATUS ${e.statusCode}: ${e.statusReason}');
              print(
                  'ERROR ${e.errorCode}: ${e.errorDetails} callId: ${e.callId}');
              print('INTERRUPTION ${e.getInterruption()}');
              print('------------------------------------------');

Output

I/flutter ( 2970): ---------------  Social Login Google ERROR
I/flutter ( 2970): STATUS 0: null
I/flutter ( 2970): ERROR 400: null callId:
I/flutter ( 2970): INTERRUPTION null
I/flutter ( 2970): ------------------------------------------

Versions:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Versión 10.0.19042.985], locale es-ES)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.5)
[!] Android Studio (not installed)
[√] VS Code (version 1.56.2)
[√] Connected device (4 available)
  gigya_flutter_plugin:
    dependency: "direct main"
    description:
      name: gigya_flutter_plugin
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.0.6"

Error when linking accounts

I'm getting the following error when following these steps:

  • Create a new account using Apple Social Login
  • Logout
  • Try to logging using Google Social Login with the same email
  • A conflicting account is triggered, so I link the account to the existing apple with:
    var res = await resolver.linkToSocial(SocialProvider.apple);
  • It fails with the next error:
NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling: []("callId"), #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:63:5)
#1      new GigyaResponse.fromJson (package:gigya_flutter_plugin/models/gigya_models.dart:35:22)
#2      new Account.fromJson (package:gigya_flutter_plugin/models/gigya_models.dart:82:42)
#3      _showLinkToSiteBottomSheet.<anonymous closure> (package:reactions/components/SocialButtons.dart:344:61)
<asynchronous suspension>

These steps works corretly for other linkings, for example Facebook -> Google, Google -> Facebook, etc

The executing code is (inside a try catch):

var res = await resolver.linkToSocial(SocialProvider.apple);
final Account account = Account.fromJson(res);

It looks like linkToSocial don't throw any error, but it returns null. The apple webview never opens.

GigyaError with all null values - 1.0.0

Hi. I am using the latest version(1.0.0) of this plugin and when I use GetIt.I().send() function, whenever an error occurs, the GigyaError object seems to be having all null values when debugging from Flutter side. But when debugging the native code, I can see that the error is returned with data. There seems to be some data loss when sending the data from iOS/Android to Flutter.

gigya_flutter_plugin - 1.0.0
iPhone SE 3rd Gen Simulator - iOS 16.2
Pixel 4 (API 29)

Differing behaviour between platforms on account linking

When a user links a social media account to an existing account from the showScreensets view, the plugin behaves differently on Android and iOS.

On Android, after a successful linking, the user is automatically logged in and an onLogin event is emitted.

On iOS, after a successful linking, the user is not automatically logged in (can be verified with the isLoggedIn function), and the screen sets automatically close. The user then needs to login again.

The preferred behaviour would be for both Android and iOS to automatically log in the user after linking their accounts.

Show Screenset fullscreen

We are using the plugin to show screenset on our app. Using iOS We can see the webpage almost correct. Using Android, in the webview there is a white border and the page is not fullscreen. Looking at the Android Sdk, in the method showScreenset there is a parameter fullScreen to use but in your sdk this parameter is not present. Could be this parameter the problem? Can you help me? Please
flutter_gigya_android

Forgot Password error

Hi!
We are using this plugin in our app and so far implemented login, register and social register, but we encountered a problem with the forgot password function. The problem occurs on IOS and Android.

We are using:
gigya-flutter-plugin - 0.1.1
Swift SDK (on IOS)

We get to the point where the source code enters the forgot password function and we can see that it receives successfully the email (loginId) :

Screenshot 2021-11-02 at 12 05 37

But it won't return the result, it just exits the app with the following error:

Screenshot 2021-11-02 at 12 06 01

Sometimes inside the parenthesis, there is a long id or a 200 status code, but it never reaches the line of returning the result (and therefore never enters our then or catch block).

To clarify, we DO get the email for resetting the password and this part works well!

Screenshot 2021-11-02 at 12 21 02

Our implementation of the forgot password function is taken from your example code

 void sendRequest(
    String email,
  ) async {
      if (!_formKey.currentState.validate()) {
      return;
    }
    setState(() {
      _inProgress = true;
    });
      GigyaSdk.instance.forgotPassword(email).then((result) {
        setState(() {
        _inProgress = false;
        _requestResult = 'Forgot password success';
        showError = false;
        finished = true;
        });
        Get.back();
      }).catchError((err) {
        debugPrint('error $err');
        setState(() {
        _inProgress = false;
        _requestResult = '${err?.errorDetails}';
        showError = true;
        });
      });
  }

Thank you, we will much appreciate your help :)

Error creating Gigya SDK

I'm getting this error when creating a release APK:

E/AndroidRuntime(13063): java.lang.RuntimeException: Unable to start activity ComponentInfo{es.sonypictures.reactions/es.sonypictures.reactions.MainActivity}: java.lang.RuntimeException: Error creating Gigya SDK (did you forget to Gigya.setApplication or missing apiKey?)
E/AndroidRuntime(13063):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3322)
E/AndroidRuntime(13063):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3471)
E/AndroidRuntime(13063):        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
E/AndroidRuntime(13063):        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(13063):        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(13063):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2058)
E/AndroidRuntime(13063):        at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(13063):        at android.os.Looper.loop(Looper.java:226)
E/AndroidRuntime(13063):        at android.app.ActivityThread.main(ActivityThread.java:7592)
E/AndroidRuntime(13063):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(13063):        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/AndroidRuntime(13063):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

I've tried configuring Gigya's ApiKey using the two methods available:

https://sap.github.io/gigya-android-sdk/sdk-core/
I've configured the Gigya SDK following the instructions, and it works when running in debug mode.

[Technical debt] Consider configuring the workspace to specify the recommended line length for `dart format`

I currently have dart format set to formatting to 120 characters per line, globally in my Visual Studio Code user settings.
However, the default formatting for Dart projects is 80 characters per line.

We should enforce the line length for the project's Dart files.
In Visual Studio Code, adding this setting to the .vscode folder/settings file should do it.
Not sure about other editors though.

onLogin sessionInfo missing on iOS

Hello,
using version 1.0.1 with screen-sets I correctly receive sessionInfo as the event.data of onLogin on Android, but not on iOS.
I just upgraded from 0.1.7 where it was working on both platforms.

showScreenSet parameters include
"include": "profile, data, id-token, preferences, subscriptions, groups"

On iOS sessionInfo is missing.

Thanks

Account sessionInfo is null

Hey all, when calling:

final response = await GigyaSdk.instance.login();
final account = Account.fromJson(response);

I'm seeing the sessionInfo property as null. When I inspect the network response - I see this sessionInfo in the response, but it seems to not de-serialize succesfully.

Screen Shot 2021-04-14 at 2 29 29 PM

Gradle plugin support for Kotlin Gradle plugin version 1.5.20 and higher

When using Gradle 7 for the build, and error is thrown:

FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':gigya_flutter_plugin' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50

A kotlin garde plugin upgrade would be required for the next releases.

Sign in with Apple is throwing an error

Configuration on CDC done.

Using the example app provided with the flutter SDK, the apple login is not working.

A popup screen appears and mentions "failed connecting. Please try again later."

Here is the code relevant to the GigyaSDK setup:

case SocialAuthenticationType.apple:
  {
    GigyaSdk.instance
        .socialLogin(SocialProvider.apple)
        .then((result) {
      print(result);
    });
  }

Your help would be much appreciated.
Screenshot 2022-11-11 at 10 11 09 PM

accounts.register returning isRegistered: true when "finalizeRegistration": false in Android alone

Hi there,
I hope someone can please help with this as I do not seem able to figure out on my own.

Here is our gigyaSdkConfiguration.json:
{ "apiKey": "secret", "apiDomain": "eu1.gigya.com", "accountCacheTime": 60, "account": { "cacheTime": 1, "include": [ "data", "profile", "emails" ], "extraProfileFields": [ "locale", "phones" ] }, "sessionVerificationInterval": 0 }

We are moving from a single step registration to a three steps one.

What we currently have is this:

await _gigya.register(options.email, options.password, params: { "profile": ..., "data": ...data, "preferences": ...preferences, "subscriptions": ...subscriptions, "finalizeRegistration": true, });

moving on to:
final Map<String, dynamic>? initRegistrationResponse = await _gigya.send("accounts.initRegistration",{}); await _gigya.register(options.email, options.password, params: { "profile": ..., "data": ...data, "preferences": ...preferences, "subscriptions": ...subscriptions, "finalizeRegistration": false, "regToken": initRegistrationResponse?['regToken'].toString(), });
which works correctly on iOs, as it returns something like:

{ "errorCode": 206001, "errorMessage": "Account Pending Registration", "statusCode": 206, "statusReason": "Partial Content"}

For some reason the same flow in Android will return a success such as:

{ errorCode: 0, apiVersion: 2, statusCode: 200, statusReason: OK, isActive: true, isRegistered: true, isVerified: false }

the expected response should be the same as the one from iOs, so as to be able to then call accounts.finalizeRegistration and effectively change the value of "isRegistered" to true.

Any idea why this is happening?

The sdk is correctly configured, I am currently using ^0.2.1, but have also tested several previous ones, and we have been using a dozen other endpoints for months without a single issue.

Kakao Support

Hello, I am wondering whether you will implement Login with Kakao support anytime soon. Are there any plans in the pipeline for this?

Thanks!

Login - id_token is null

I've created a fork and added the following parameters to the login request:

GigyaSdk.instance.login(loginId, password, params: {
  'include': 'id_token',
})

And added the idToken property to the GigyaBaseResponse:

class GigyaResponse {
  String callId;
  int statusCode = 200;
  int errorCode = 0;
  String errorDetails;
  String statusReason;
  int apiVersion;
  String regToken;
  String idToken;
  dynamic mapped;

  GigyaResponse.fromJson(dynamic json)
      : callId = json['callId'],
        statusCode = json['statusCode'],
        errorCode = json['errorCode'],
        errorDetails = json['errorDetails'],
        statusReason = json['statusReason'],
        apiVersion = json['apiVersion'],
        regToken = json['regToken'],
        idToken = json['id_token'],
        mapped = json;

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = {};
    data['callID'] = callId;
    data['statusCode'] = statusCode;
    data['errorCode'] = errorCode;
    data['errorDetails'] = errorDetails;
    data['statusReason'] = statusReason;
    data['apiVersion'] = apiVersion;
    data['regToken'] = regToken;
    data['idToken'] = idToken;
    data['mapped'] = mapped;
    return data;
  }
}

This is the resulting request:

curl -H 'Host: accounts.us1.gigya.com' -H 'User-Agent: gigya_flutter_plugin_example/0.0.1 CFNetwork/1220.1 Darwin/20.3.0' -H 'Accept: */*' -H 'Accept-Language: en-us' -H 'Cache-Control: no-cache' --data "apikey=key&format=json&gmid=PudcthEJK05kuv6OQlCQlBiZgngoKO19I0fg0G2iWb0%3D&httpStatusCodes=false&include=id%5Ftoken&loginID=rob%2Eg%2B50%40test%2Ecom&password=Thanks%211&sdk=flutter%5F0%2E0%2E2%5Fios%5Fswift%5F1%2E2%2E0&targetEnv=mobile&ucid=U%2BB0tfmrvDUTfLVgdXt4uQ%3D%3D" --compressed 'https://accounts.us1.gigya.com/accounts.login'

And response:

{
  "callId": "98cfb8da6c14463788d9a38a633aa492",
  "errorCode": 0,
  "apiVersion": 2,
  "statusCode": 200,
  "statusReason": "OK",
  "time": "2021-04-29T18:22:24.217Z",
  "registeredTimestamp": 1616620187,
  "UID": "f47731bedd834272b410ee280165db4c",
  "UIDSignature": "yASDFK7zuBeCuPTQwQSudtVuw2c=",
  "signatureTimestamp": "1619720544",
  "created": "2021-03-24T21:09:47.242Z",
  "createdTimestamp": 1616620187,
  "isActive": true,
  "isRegistered": true,
  "isVerified": false,
  "lastLogin": "2021-04-29T18:22:24.159Z",
  "lastLoginTimestamp": 1619720544,
  "lastUpdated": "2021-03-24T21:09:47.341Z",
  "lastUpdatedTimestamp": 1616620187341,
  "loginProvider": "site",
  "oldestDataUpdated": "2021-03-24T21:09:47.242Z",
  "oldestDataUpdatedTimestamp": 1616620187242,
  "registered": "2021-03-24T21:09:47.341Z",
  "socialProviders": "site",
  "newUser": false,
  "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlJFUTBNVVE1TjBOQ1JUSkVNemszTTBVMVJrTkRRMFUwUTBNMVJFRkJSamhETWpkRU5VRkJRZyIsImRjIjoidXMxIn0.eyJpc3MiOiJodHRwczovL2ZpZG0uZ2lneWEuY29tL2p3dC8zXzhydUE0TFc5UjY4bFdURWxid25fbk94TlIzVFlBdGZFaHZtNFhMRlR1QUlZcl95UHVUYnFuWHRmOWFxNGRCLUYvIiwic3ViIjoiZjQ3NzMxYmVkZDgzNDI3MmI0MTBlZTI4MDE2NWRiNGMiLCJpYXQiOjE2MTk3MjA1NDQsImV4cCI6MTYxOTcyMDYwNCwiaXNMb2dnZWRJbiI6dHJ1ZX0.iGA13Nwy2WwolpGjpodsnZuDg9DaGHkF3OhRzcaRnvvuDM5BWg2O8pkiRqjtRAzqTbfkaW2G9dd-5vl3HYFU86Trj4ZxWQgpDMpVVjVBOAsAbheSy3GEifPc8v1Rk6swq6MM3uga9nz-n4qI6X7t0fd-GAJ3PYaPayk5n6Q4LqW6DJ6CjhFg2B5gzf2zE8s22ojaqW_h2g3OMahNBf5erOeVqblXe54_zJpz8CBiqvEWd5d00CExOlge1NVZgx4Vp07Ns3ngwiJsar_jR8XbES-olEwbFEr85v66rrRE8Lsis2FMZMma39h6tBtMFAOBpkuqv43CuWXi4hGaiNbwOQ",
  "sessionInfo": {
    "sessionToken": "st2.s.AcbHNHMzAg.hQQZrMBDaTcmDHt_ICm6ya1vOAEZt7W7glhG09_AgdMmAsYdEVBMS5a0ge2l2hv-ARTihTRsu7z_m9nblRQjmQMNGPZd3EI0HQjK-9a47O8.bEeyTDhp9kVw_emYQ753Ejxs2Z9-yrYidZ7T1UK9-KMG3nqed0IwOZuKvWDmNkCawEFo7FPnmZa71Bu6sXF52Q.sc3",
    "sessionSecret": "oUt9hiXi9bK4V0/6JlbrxVSelXc=",
    "expires_in": "0"
  }
}

But the property is still null:

    GigyaSdk.instance.login(loginId, password, params: {
      'include': 'id_token',
    }).then((result) {
      debugPrint(json.encode(result));
      final response = Account.fromJson(result);
      print('token: ${response.idToken}'); // token: null
    })

Gigya social login error + Split mode + FireTab/AndroidTab

I am facing an issue while doing gigya social login. It happens when we run the App in split mode in fireTab/AndroidTab. We are using android sdk "gigya-android-sdk-4.0.6"

Login works fine when we run the app in single mode(No Split screen)

Error logs

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.scripps.android.foodnetwork, PID: 14777
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gigya.android.sdk.ui.WebLoginActivity}: java.lang.NullPointerException: uriString
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2934)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3075)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1824)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:6740)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.NullPointerException: uriString
at android.net.Uri$StringUri.(Uri.java:490)
at android.net.Uri$StringUri.(Uri.java:480)
at android.net.Uri.parse(Uri.java:452)
at com.gigya.android.sdk.ui.WebLoginActivity.onCreate(WebLoginActivity.java:72)
at android.app.Activity.performCreate(Activity.java:7161)
at android.app.Activity.performCreate(Activity.java:7151)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)

Could not retrieve gigya-android-sdk:sdk-core:core-v6.2.1

Hello,

On Android, when I want to run my application in debug mode, I have an error to retrieve sdk-core dependency for gigya-android-sdk.

Could not find com.github.SAP.gigya-android-sdk:sdk-core:core-v6.2.1.

When I go to https://jitpack.io/com/github/SAP/gigya-android-sdk/sdk-core/core-v6.2.1/sdk-core-core-v6.2.1.pom to see the dep. I have the following error :

Build failed. See the log at jitpack.io

On release mode, I have this issue :

Failed to transform sdk-core-core-v6.2.1.aar (com.github.SAP.gigya-android-sdk:sdk-core:core-v6.2.1) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find sdk-core-core-v6.2.1.aar (com.github.SAP.gigya-android-sdk:sdk-core:core-v6.2.1).
Searched in the following locations:
https://jitpack.io/com/github/SAP/gigya-android-sdk/sdk-core/core-v6.2.1/sdk-core-core-v6.2.1.aar

Thank you in advance for your support.

Account linking behaviour not consistent on iOS and Android

Hello Everyone.

We are currently using this plugin to help us communicate with the Gigya plugin to Auth using email/password and a few social media providers. We are using showScreenSet to show the Auth page. In the below explanation, I was trying to Sign In via Apple.

I created an account using email and password first. Then I tried to sign in via Apple where the AppleID is the same email as the one used to create an account using email and password. Once the AppleID auth and 2FA is done, we are taken to an Account Linking page where I need to enter the password I used when creating the account with email and password.

On iOS, after we enter the password in the Account Linking page, we get a 200009 response as an onError event which says that the accounts are linked and we can easily proceed with the auth flow of the app.

However, on Android, we just get an onHide event after we enter the password in the Account Linking page. At this time, GigyaSdk.instance.isLoggedIn returns us false and if we try to call GigyaSdk.instance.send('accounts.verifyLogin', {},) it just throws an error which is expected. A workaround is to add a delay until GigyaSdk.instance.isLoggedIn returns true, but this does not work as required if the internet connection is not fast enough.

Any help would be appreciated.

iOS showScreenSet "startScreen" parameter not taken into account

I have implemented the following code:

GigyaSdk.instance.showScreenSet(screenSet, (event, map) async {
  if (event == 'onHide' || event == 'onLogin') {
    setState(() {});
  }
}, parameters: {
  "startScreen": 'MobileLogin', <--- (Default is 'gigya-login-screen')
  "deviceType": 'mobile',
  "mobileScreenSet": screenSet,
});

On Android it shows the correct startScreen, but on iOS it doesn't take the startScreen parameter into account.

iOS Log:

Data - {data: {profile: {}, data: {}, preferences: {}, eventName: beforeScreenLoad, sourceContainerID: pluginContainer, source: showScreenSet, response: {}, instanceID: pluginContainer, subscriptions: {}, nextScreen: gigya-login-screen}, event: onBeforeScreenLoad}

As you can see the nextScreen: gigya-login-screen is wrong, doesn't show the correct screen there.

Android Log:

Data - {data: {profile: {}, data: {}, preferences: {}, eventName: beforeScreenLoad, sourceContainerID: pluginContainer, source: showScreenSet, response: {}, instanceID: pluginContainer, subscriptions: {}, nextScreen: MobileLogin}, event: onBeforeScreenLoad}

This is the correct screen nextScreen: MobileLogin.

Gigya signup using credential getting Null error code.

I am trying to implement Gigya signup using credentials and forgetPassword in Flutter. I are getting this 400106 Not connected User is not connected to the required network or to any network. error code and description when I am trying to call gigya.register(..) via gigya_flutter_plugin ^0.1.6 version. How to resolve this error.

Also I am not able to initialize gigya using 1.0.0 version. I have followed step by step guide given on https://github.com/SAP/gigya-flutter-plugin. Any implemented working code in flutter using 1.0.0 will also be helpful.

Also using example app provided on flutter plugin repo is also giving null error on Signup using credential. Sending this parameter.

Map<String,dynamic>();
profile["${FIRST_NAME_KEY}"] = 'Harsh';
profile["${COUNTRY_KEY}"] = COUNTRY_VALUE;

final temp = Map<String,dynamic>();
temp["${NUMBER_KEY}"] = '9********0';

profile["${PHONE_KEY}"] = temp;

param["${PROFILE_KEY}"] = profile;

final finalparam = HashMap<String,dynamic>();
finalparam["${PROFILE_KEY}"] = profile;

response = await gigya.register(
'hars*******@gmail.com',
'Password@1234', params: finalparam);

Error's message is a null, Android

Hi,
We are using your plugin in a project and, when we tried to extract the error message on Android, we had a problem.

In MainActivity.kt, for implementation we added:

val plugin: GigyaFlutterPlugin = flutterEngine.plugins.get(GigyaFlutterPlugin::class.java) as GigyaFlutterPlugin
 plugin.registerWith(application, GigyaAccount::class.java, flutterEngine.dartExecutor.binaryMessenger)

And in AndroidManifest.xml file we have this:

       <meta-data
            android:name="apiKey"
            android:value="3_-MkajnAgr6HgZsps35bl_aYNMG338riz8FjDzDiBMRhzYw3wswmZQwyuzOubo2z4" />

        <meta-data
            android:name="apiDomain"
            android:value="us1.gigya.com" />

        <meta-data
            android:name="accountCacheTime"
            android:value="1" />

        <meta-data
            android:name="sessionVerificationInterval"
            android:value="60" />

The problem is that the error message has all values null

image

We also have tried the solution in the other open issue, but the mapped is also null. On IOS everything works fine, including the mapped object.

Do you have any solution or any idea why this is happening?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.