An AWS cognito plugin for flutter

Overview

Sponsor pub package

Flutter Cognito Plugin

An AWS Cognito plugin for flutter. Supports both iOS and Android.

Installation

First follow the regular flutter plugin installation on Dart Pub.

Make sure you have built the app once for both Android/iOS before continuing.


Since this plugin uses the native AWS sdk, the installation is a little more involved.

Android

Add an awsconfiguration.json file to android/app/src/main/res/raw/awsconfiguration.json.

This is what one should look like :-

{
    "IdentityManager": {
        "Default": {}
    },
    "CredentialsProvider": {
        "CognitoIdentity": {
            "Default": {
                "PoolId": "XX-XXXX-X:XXXXXXXX-XXXX-1234-abcd-1234567890ab",
                "Region": "XX-XXXX-X"
            }
        }
    },
    "CognitoUserPool": {
        "Default": {
            "PoolId": "XX-XXXX-X_abcd1234",
            "AppClientId": "XXXXXXXX",
            "AppClientSecret": "XXXXXXXXX",
            "Region": "XX-XXXX-X"
        }
    }
}

This plugin supports the amplify SDK for android and iOS, and the the amplify cli can be used to generate the awsconfiguration.json file.

Just do $ amplify init from the android & ios folder of your app.

iOS

Run $ pod init from the ios folder of your app.

Now, open ios/Podfile. Ensure ios version is set to a minimum of 9.0.

platform :ios, '9.0'

To add the awsconfiguration.json file to iOS module, you will unfortunately, need to open up your project in XCode.

  1. Start Xcode
  2. Click on ‘File > Open’
  3. Select the ios/Runner.xcworkspace file.

Now just drag-drop the awsconfiguration.json file, from android/app/src/main/res/raw/awsconfiguration.json to XCode Runner (Right next to AppDelegate.swift).

Here is a video.

That should create a symlink to the file in the ios module, and bundle it into the final ios app.

This way you won't need to maintain 2 config files.

Hosted UI

The Hosted UI feature is needed for using Social login. Unfortunately, this requires you to modify native code in your app.

First, add the following section to android/app/src/main/res/raw/awsconfiguration.json -

("myapp://callback" and "myapp://signout" are custom urls you can provide in the "App client settings" section of Cognito User Pools)

{
  ...

  "Auth": {
    "Default": {
      "OAuth": {
        "WebDomain": "XXX.auth.ap-south-1.amazoncognito.com",
        "AppClientId": "XXXXXXXX",
        "AppClientSecret": "XXXXX"
        "SignInRedirectURI": "myapp://callback",
        "SignOutRedirectURI": "myapp://signout",
        "Scopes": ["email, "openid"]
      }
    }
  }
}

Android

  1. Open your app's andorid/app/src/main/com/kotlin/.../MainActivity.kt and replace FlutterActivity() by CognitoPluginActivity("<url scheme>").

Here's what it should look like -

package ...

import androidx.annotation.NonNull
import com.pycampers.flutter_cognito_plugin.CognitoPluginActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity : CognitoPluginActivity("myapp") {
    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }
}
  1. Add the following to android/app/src/main/AndroidManifest.xml -
<manifest ...>
        <application ...>
            ...

            <!-- Add this section for AWS Cognito hosted UI-->
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="myapp" />
            </intent-filter>

        </application>
</manifest>

iOS

  1. Open you apps's ios/Runner/AppDelegate.swift, and replace FlutterAppDelegate with CognitoPluginAppDelegate.

Here's what it should look like -

import Flutter
import flutter_cognito_plugin
import UIKit

@UIApplicationMain
@objc class AppDelegate: CognitoPluginAppDelegate {
    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        GeneratedPluginRegistrant.register(with: self)
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
}
  1. Add the following to ios/Runner/Info.plist
<plist version="1.0">
<dict>
    <!-- YOUR OTHER PLIST ENTRIES HERE -->

    <!-- ADD AN ENTRY TO CFBundleURLTypes for Cognito Auth -->
    <!-- IF YOU DO NOT HAVE CFBundleURLTypes, YOU CAN COPY THE WHOLE BLOCK BELOW -->
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>myapp</string>
            </array>
        </dict>
    </array>
</dict>
</array>

<!-- ... -->
</dict>

Dart

Once the native setup is complete, you can use the following in your flutter app to launch the Hosted UI -

Cognito.showSignIn(
  identityProvider: "Cognito",
  scopes: ["email", "openid"],
);

Usage

The plugin comes with a showcase app that will let you try all features -- given that you setup the awsconfiguration.json correctly.

It's present in the usual example directory

$ git clone https://github.com/pycampers/flutter_cognito_plugin.git
$ cd flutter_cognito_plugin/example
$ flutter run

AppSync

You can use AWS AppSync GraphQL API using this plugin easily. Just pass in the query as a String, and the query variables!

import 'dart:convert';
import 'dart:io';

import 'package:flutter_cognito_plugin/flutter_cognito_plugin.dart';
import 'package:http/http.dart' as http;


static Future<Map> query(
  String query,
  Map<String, dynamic> variables,
) async {
  final tokens = await Cognito.getTokens();

  final response = await http.post(
    graphQLEndpoint,
    headers: {
      HttpHeaders.authorizationHeader: tokens.accessToken,
      HttpHeaders.contentTypeHeader: ContentType.json.mimeType,
    },
    body: jsonEncode({
      "query": query,
      "variables": variables,
    }),
  );

  if (response.statusCode == HttpStatus.ok) {
    return jsonDecode(response.body);
  }

  print(
    "http request failed! { statusCode: ${response.statusCode}, body: ${response.body} }",
  );
  return null;
}
Comments
  • Error when implementing Hosted UI

    Error when implementing Hosted UI

    Hello flutter cognito plugin team! Would you mind helping me with something? When I want to call a hosted UI using

    Cognito.showSignIn(
        identityProvider: "google",
        scopes: ["email", "openid"],
    );
    

    I get this error:

    D/AWSMobileClient(18123): getHostedUIJSON: Failed to read config
    D/AWSMobileClient(18123): java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONObject com.amazonaws.mobile.config.AWSConfiguration.optJsonObject(java.lang.String)' on a null object reference
    D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient.getHostedUIJSONFromJSON(AWSMobileClient.java:641)
    D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient.getHostedUIJSON(AWSMobileClient.java:660)
    D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient.getHostedUIJSON(AWSMobileClient.java:655)
    D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient._showSignIn(AWSMobileClient.java:2679)
    D/AWSMobileClient(18123): 	at com.amazonaws.mobile.client.AWSMobileClient.showSignIn(AWSMobileClient.java:2659)
    D/AWSMobileClient(18123): 	at com.pycampers.flutter_cognito_plugin.Cognito.showSignIn(Cognito.kt:236)
    D/AWSMobileClient(18123): 	at java.lang.reflect.Method.invoke(Native Method)
    D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createPluginScaffold$1$$special$$inlined$let$lambda$1.invoke(PluginScaffoldPlugin.kt:78)
    D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createPluginScaffold$1$$special$$inlined$let$lambda$1.invoke(Unknown Source:0)
    D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt.catchErrors(PluginScaffoldPlugin.kt:172)
    D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt.catchErrors(PluginScaffoldPlugin.kt:179)
    D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createMethodWrapper$2$1.invoke(PluginScaffoldPlugin.kt:132)
    D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createMethodWrapper$2$1.invoke(Unknown Source:0)
    D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.DoAsync.doInBackground(PluginScaffoldPlugin.kt:287)
    D/AWSMobileClient(18123): 	at com.pycampers.plugin_scaffold.DoAsync.doInBackground(PluginScaffoldPlugin.kt:281)
    D/AWSMobileClient(18123): 	at android.os.AsyncTask$3.call(AsyncTask.java:378)
    D/AWSMobileClient(18123): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    D/AWSMobileClient(18123): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
    D/AWSMobileClient(18123): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    D/AWSMobileClient(18123): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    D/AWSMobileClient(18123): 	at java.lang.Thread.run(Thread.java:919)
    

    and then

    E/flutter (18123): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(java.lang.Exception, showSignIn called with HostedUI options in awsconfiguration.json, java.lang.Exception: showSignIn called with HostedUI options in awsconfiguration.json
    E/flutter (18123): 	at com.amazonaws.mobile.client.AWSMobileClient$23.run(AWSMobileClient.java:2684)
    E/flutter (18123): 	at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)
    E/flutter (18123): 	at java.lang.Thread.run(Thread.java:919)
    E/flutter (18123): )
    E/flutter (18123): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
    E/flutter (18123): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:163:17)
    E/flutter (18123): <asynchronous suspension>
    E/flutter (18123): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:337:12)
    E/flutter (18123): #3      Cognito.invokeMethodWithChannel (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:75:36)
    E/flutter (18123): #4      Cognito.invokeMethod (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:92:12)
    E/flutter (18123): #5      Cognito.showSignIn (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:294:11)
    

    And, my awsconfig.json is as follows:

    {
        "IdentityManager": {
            "Default": {}
        },
        "CognitoUserPool": {
            "Default": {
                "PoolId": "XX-XXXX-X_abcd1234",
                "AppClientId": "XXXXXXXX",
                "AppClientSecret": "XXXXXXXXX",
                "Region": "XX-XXXX-X"
            }
        },
      "Auth": {
        "Default": {
          "OAuth": {
            "WebDomain": "XXX.auth.ap-south-1.amazoncognito.com",
            "AppClientId": "XXXXXXXX",
            "SignInRedirectURI": "myapp://callback",
            "SignOutRedirectURI": "myapp://signout",
            "Scopes": ["email"]
          }
        }
      }
    }
    

    Am I doing something wrong?

    opened by Andranjo97 4
  • Update Android dependencies to 2.18.0

    Update Android dependencies to 2.18.0

    Hi!, I updated the android dependencies of "com.amazonaws:aws-android-sdk-mobile-client" and "com.amazonaws:aws-android-sdk-cognitoauth" from 2.16.12 to 2.18.0 This to solve the performance problem when it is called "getTokens()". https://github.com/aws-amplify/aws-sdk-android/issues/1722

    opened by dbbd59 2
  • Fix Xcode 12 build compile issues by updating iOS .podspec dependencies

    Fix Xcode 12 build compile issues by updating iOS .podspec dependencies

    Problem

    I was unable to build the example app and I was also having issues using this plugin as a dependency within another flutter project via Xcode 12 as the build process fails.

    See https://github.com/aws-amplify/aws-sdk-ios/issues/2818

    Solution

    Using the latest flutter version, I re-generated the PodFile, PodFile.lock and updated all the AWS dependencies to the latest 2.15.1

    Readme Changes

    I replaced "google" with "Cognito" for HostedUI as I thought it would take minimal effort to actually test the HostedUI feature of this library.

    Notes

    I was able to successfully build the example app using Xcode 12 and iOS 14. I configured the HostedUI option with the Cognito User pool and was able to sign up and log in.

    I also tested the basic functionality of user sign up and login via the form fields.

    I did not test backward compatibility with lower flutter versions < 1.20. Perhaps it might be good to increase the min flutter SDK limit? Let me know what y'all think.

    iOS 14

    Including the below link for visibility if people switched to Mac OS 12 and iOS 14 beta. https://flutter.dev/docs/development/ios-14

    opened by srimajji 2
  • unexpected character in attributes field

    unexpected character in attributes field

    /flutter ( 9995): #12     TapGestureRecognizer.handleTapUp (package:flutter/src
    I/flutter ( 9995): FormatException: Unexpected character (at character 1)
    I/flutter ( 9995): [email protected]
    I/flutter ( 9995): ^
    I/flutter ( 9995): #0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1405:5)
    I/flutter ( 9995): #1      _ChunkedJsonParser.parseNull (dart:convert-patch/convert_patch.dart:996:7)
    I/flutter ( 9995): #2      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:879:22)
    I/flutter ( 9995): #3      _parseJson (dart:convert-patch/convert_patch.dart:40:10)
    I/flutter ( 9995): #4      JsonDecoder.convert (dart:convert/json.dart:506:36)
    I/flutter ( 9995): #5      JsonCodec.decode (dart:convert/json.dart:157:41)
    I/flutter ( 9995): #6      jsonDecode (dart:convert/json.dart:96:10)
    I/flutter ( 9995): #7      MyAppState.signUp.<anonymous closure> (package:flutter_cognito_plugin_example/main.dart:166:61)
    I/flutter ( 9995): #8      MyAppState.onPressWrapper.wrapper (package:flutter_cognito_plugin_example/main.dart:109:26)
    I/flutter ( 9995): #9      MyAppState.onPressWrapper.wrapper (package:flutter_cognito_plugin_example/main.dart:102:12)
    I/flutter ( 9995): #10     _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:989:21)
    I/flutter ( 9995): #11     GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:193:24)
    I/flutter ( 9995): #12     TapGestureRecognizer.handleTapUp (package:flutter/src
    
    
    opened by nyck33 1
  • social  login in iOs doesnt get token

    social login in iOs doesnt get token

    I'm trying social login at iOs but when I done login with google and then callback to my application the additionalInfo is null without token, this work fina at Android.

    image

    dependencies:
      flutter:
        sdk: flutter
      amplify_flutter: ^0.2.0
      amplify_auth_cognito: ^0.2.0
    
    $ flutter --version
    Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision f4abaa0735 (3 weeks ago) • 2021-07-01 12:46:11 -0700
    Engine • revision 241c87ad80
    Tools • Dart 2.13.4
    
    
                      try {
                        var res = await Amplify.Auth.signInWithWebUI(
                            provider: AuthProvider.google);
    
                        print(res);
                        print(
                            'TOKEN: ${res.nextStep?.additionalInfo['token'] ?? ''}');
                      } on AmplifyException catch (e) {
                        print(e.message);
                      } catch (e) {
                        print(e);
                      }
    
    opened by toshiossada 1
  • Login with wrong password ios crashing

    Login with wrong password ios crashing

    Thread 26: Fatal error: Unexpectedly found nil while unwrapping an Optional value

    Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/user/FlutterHome/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_aws_amplify_cognito-1.0.0+7/ios/Classes/SwiftFlutterAwsAmplifyCognito.swift, line 275

    https://github.com/jonsaw/amazon-cognito-identity-dart

    opened by midhilaj-com-06 1
  • Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = provider

    Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = provider

    I tryed generete my apk folowing Flutter Tutorial and now my app is broken.

    I don't understood the error...

    D/PluginScaffold( 7236): invoke { channel: com.pycampers.flutter_cognito_plugin, method: isSignedIn(), args: null }
    E/AWSKeyValueStore( 7236): com.amazonaws.internal.keyvaluestore.KeyNotFoundException: Error occurred while accessing AndroidKeyStore to retrieve the key for keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
    I/AWSKeyValueStore( 7236): Deleting the encryption key identified by the keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
    E/AWSKeyValueStore( 7236): Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = provider
    E/AWSKeyValueStore( 7236): com.amazonaws.internal.keyvaluestore.KeyNotFoundException: Error occurred while accessing AndroidKeyStore to retrieve the key for keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
    I/AWSKeyValueStore( 7236): Deleting the encryption key identified by the keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
    E/AWSKeyValueStore( 7236): Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = token
    E/AWSKeyValueStore( 7236): com.amazonaws.internal.keyvaluestore.KeyNotFoundException: Error occurred while accessing AndroidKeyStore to retrieve the key for keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
    I/AWSKeyValueStore( 7236): Deleting the encryption key identified by the keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
    E/AWSKeyValueStore( 7236): Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = cognitoIdentityId
    E/AWSKeyValueStore( 7236): com.amazonaws.internal.keyvaluestore.KeyNotFoundException: Error occurred while accessing AndroidKeyStore to retrieve the key for keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
    I/AWSKeyValueStore( 7236): Deleting the encryption key identified by the keyAlias: com.amazonaws.mobile.client.aesKeyStoreAlias
    E/AWSKeyValueStore( 7236): Error in retrieving the decryption key used to decrypt the data from the persistent store. Returning null for the requested dataKey = isFederationEnabled
    D/AWSMobileClient( 7236): Inspecting user state details
    

    pleas help-me

    opened by JoaquimFlavio 1
  • RuntimeException: Failed to read awsconfiguration.json please check that it is correctly formed.

    RuntimeException: Failed to read awsconfiguration.json please check that it is correctly formed.

    Until a few hours ago where I made a pub get to refresh my dependencies, this was working fine. I currently have my awsconfiguration.json file within the res/raw directory inside of my android file when running 'flutter run' within the console, it throws the following error:

    I/flutter (16510): java.lang.RuntimeException: Failed to read awsconfiguration.json please check that it is correctly formed.
    I/flutter (16510):      at com.amazonaws.mobile.config.AWSConfiguration.readInputJson(AWSConfiguration.java:125)
    I/flutter (16510):      at com.amazonaws.mobile.config.AWSConfiguration.<init>(AWSConfiguration.java:109)
    I/flutter (16510):      at com.amazonaws.mobile.config.AWSConfiguration.<init>(AWSConfiguration.java:94)
    I/flutter (16510):      at com.amazonaws.mobile.config.AWSConfiguration.<init>(AWSConfiguration.java:71)
    I/flutter (16510):      at com.amazonaws.mobile.client.AWSMobileClient.initialize(AWSMobileClient.java:434)
    I/flutter (16510):      at com.pycampers.flutter_cognito_plugin.Cognito.initialize(Cognito.kt:22)
    I/flutter (16510):      at java.lang.reflect.Method.invoke(Native Method)
    I/flutter (16510):      at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createPluginScaffold$1$$special$$inlined$let$lambda$1.invoke(PluginScaffoldPlugin.kt:75)
    I/flutter (16510):      at com.pycampers.plugin_scaffold.PluginScaffoldPluginKt$createPluginScaffold$1$$special$$inlined$let$lambda$1.invoke(Unknown
    I/flutter (16510): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
    I/flutter (16510): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
    I/flutter (16510): <asynchronous suspension>                            
    I/flutter (16510): #2      Cognito.invokeMethodWithChannel (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:70:30)
    I/flutter (16510): #3      Cognito.invokeMethod (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:86:12)
    I/flutter (16510): #4      Cognito.initialize (package:flutter_cognito_plugin/flutter_cognito_plugin.dart:107:11)
    I/flutter (16510): #5      MyAppState.doLoad (package:flutter_cognito_plugin_example/main.dart:30:29)
    I/flutter (16510): #6      MyAppState.initState (package:flutter_cognito_plugin_example/main.dart:54:5)
    I/flutter (16510): #7      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4355:58)
    I/flutter (16510): #8      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
    I/flutter (16510): #9      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
    I/flutter (16510): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
    

    This then stops initialization within the app and once the user tries to install the apk on an android device, they get a MissingPluginException from flutter. This also occurs currently in the example app when being installed.

    opened by ilikepi63 1
  • The app is working on iPhone XS but giving error on iPhone 11 and others method are working fine

    The app is working on iPhone XS but giving error on iPhone 11 and others method are working fine

    D/PluginScaffold: invoking { channel: com.pycampers.flutter_cognito_plugin, method: signIn(), args: Optional({ password = 123456; username = "[email protected]"; }) } D/PluginScaffold: piping exception to flutter (Cannot set the result on a completed task. ( 0 CoreFoundation 0x00000001942a6768 4FBDF167-161A-324C-A233-D516922C67E5 + 1218408 1 libobjc.A.dylib 0x00000001a8d6d7a8 objc_exception_throw + 60 2 CoreFoundation 0x000000019419b7e0 4FBDF167-161A-324C-A233-D516922C67E5 + 124896 3 AWSMobileClient 0x0000000100cb08fc $s15AWSMobileClientAAC6signIn8username8password14validationData17completionHandlerySS_SSSDyS2SGSgyAA04SignD6ResultVSg_s5Error_pSgtctF + 1236 4 flutter_cognito_plugin 0x000000010caa2818 $s22flutter_cognito_plugin7CognitoC6signIn4call6resultySo17FlutterMethodCallC_yypSgctF + 636 5 flutter_cognito_plugin 0x000000010caa8770 $sSo17FlutterMethodCallCypSgIegn_Ieggg_ABxq_r0_lyACytIsegnr_ytIegnnr_TRTA + 88 6 plugin_scaffold 0x000000010cb31f54 $s15plugin_scaffold20createPluginScaffold9messenger11channelName9methodMapSo20FlutterMethodChannelCSo0K15BinaryMessenger_p_SSSDySSypGtFySo0kL4CallC_yypSgctcfU_yycfU_TA + 4532 7 plugin_scaffold 0x000000010cb30834 $s15plugin_scaffold11catchErrorsyyyypSgc_yyKctFyycfU_TA + 44 8 plugin_scaffold 0x000000010cb2f9a4 $sIeg_IeyB_TR + 20 9 plugin_scaffold 0x000000010cb2ed9c +[PluginScaffoldHelper tryCatch:onCatch:onElse:]

    • 72 10 plugin_scaffold 0x000000010cb2f958 $s15plugin_scaffold11catchErrorsyyyypSgc_yyKctF + 356 11 plugin_scaffold 0x000000010cb30ccc $s15plugin_scaffold20createPluginScaffold9messenger11channelName9methodMapSo20FlutterMethodChannelCSo0K15BinaryMessenger_p_SSSDySSypGtFySo0kL4CallC_yypSgctcfU_TA + 148 12 plugin_scaffold 0x000000010cb30380 $sSo17FlutterMethodCallCypSgIegn_Ieggg_AByXlSgIeyBy_IeyByy_TR + 96 13 Flutter 0x0000000101479958 Flutter + 5560664 14 Flutter 0x0000000100f5c618 Flutter + 198168 15 Flutter 0x0000000101222f6c Flutter + 3108716 16 Flutter 0x0000000100f656c4 Flutter + 235204 17 Flutter 0x0000000100f6733c Flutter + 242492 18 CoreFoundation 0x000000019422122c 4FBDF167-161A-324C-A233-D516922C67E5 + 672300 19 CoreFoundation 0x0000000194220e28 4FBDF167-161A-324C-A233-D516922C67E5 + 671272 20 CoreFoundation 0x0000000194220278 4FBDF167-161A-324C-A233-D516922C67E5 + 668280 21 CoreFoundation 0x000000019421a02c 4FBDF167-161A-324C-A233-D516922C67E5 + 643116 22 CoreFoundation 0x0000000194219360 CFRunLoopRunSpecific + 600 23 GraphicsServices 0x00000001ab857734 GSEventRunModal + 164 24 UIKitCore 0x0000000196c94584 33B02AB5-5DAF-3249-8DC6-5872DF830EC5 + 12363140 25 UIKitCore 0x0000000196c99df4 UIApplicationMain + 168 26 Runner 0x0000000100347558 main + 64 27 libdyld.dylib 0x0000000193ed5cf8 E574A365-9878-348A-8E84-91E163CFC128 + 7416 )) 2021-06-23 14:19:39.616336+0530 Runner[5314:1435083] [VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: type 'PlatformException' is not a subtype of type 'String' #0 CognitoService.signIn (package:qure/services/cognito_service.dart:173)
    opened by androidshivam 0
  • changePassword method usage

    changePassword method usage

    Can the changePassword(String oldPassword, String newPassword) method be used to update a user's password when their SignInState is SignInState.NEW_PASSWORD_REQUIRED?

    opened by DrBanner97 0
  • Support for multi-environment configuration

    Support for multi-environment configuration

    You can override the Default configuration by using the Cognito.initialize(configuration:) method.

    {
        "AppSync": {
            "Default": {
                "ApiUrl": "YOUR-GRAPHQL-ENDPOINT",
                "Region": "us-east-1",
                "ApiKey": "YOUR-API-KEY",
                "AuthMode": "API_KEY"
            },
            "Custom": {
                "ApiUrl": "YOUR-GRAPHQL-ENDPOINT",
                "Region": "us-east-2",
                "ApiKey": "YOUR-API-KEY",
                "AuthMode": "API_KEY"
            }
       }
    }
    
    Cognito.initialize(configuration: 'Custom');
    
    opened by zuvola 0
  • Cognito iOS SDK 2.18.1 (Bug Fix)

    Cognito iOS SDK 2.18.1 (Bug Fix)

    Hello, this is really a question more than an issue. I need to pick up a critical bug fix that went into the latest version 2.18.1 of the iOS SDK for Cognito -- https://github.com/aws-amplify/aws-sdk-ios/blob/main/CHANGELOG.md

    The bug fix I need is here -- https://github.com/aws-amplify/aws-sdk-ios/issues/2886 The PR is here -- https://github.com/aws-amplify/aws-sdk-ios/pull/3190

    The bug impacts iOS only, not Android.

    It looks like the current podpsec for flutter_cognito_plugin points to version 2.13, so this will be a big jump to 2.18:

      s.dependency 'AWSMobileClient', '~> 2.13.0'
      s.dependency 'AWSAuth', '~> 2.13.0'
      s.dependency 'AWSCognito', '~> 2.13.0'
      s.dependency 'AWSAuthUI', '~> 2.13.0'
      s.dependency 'AWSUserPoolsSignIn', '~> 2.13.0'
    

    I can open a PR and run the example app, but is there is any other recommendation on process to do the upgrade?

    Thanks in advance for your help, and thanks again for the great library.

    opened by doc-rj-celltrak 3
  • Disable logs to logcat

    Disable logs to logcat

    I having a problem with security requirements of my app, because any time i call the signIn method the user credentials are logged by invoke method in debug console and in android logcat. Is there any way to disable this behavior, because it is preventing my release.

    This is an example of what is shown: PluginScaffold D invoke { channel: com.pycampers.flutter_cognito_plugin, method: signIn(), args: {password=PASSWORD123, username=USERNAME} }

    opened by OrgesKreka 1
Owner
Scientific Hackers
Dedicated hackers that live by the scientific method
Scientific Hackers
This is just the simplyfied Flutter Plugin use for one of the popular flutter plugin for social media login.

social_media_logins Flutter Plugin to login via Social Media Accounts. Available Social Media Logins: Facebook Google Apple Getting Started To use thi

Reymark Esponilla 3 Aug 24, 2022
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.

Flutter permission_handler plugin The Flutter permission_handler plugin is build following the federated plugin architecture. A detailed explanation o

Baseflow 1.7k Dec 31, 2022
Unloc customizations of the Permission plugin for Flutter. This plugin provides an API to request and check permissions.

Flutter Permission handler Plugin A permissions plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check perm

Unloc 1 Nov 26, 2020
Klutter plugin makes it possible to write a Flutter plugin for both Android and iOS using Kotlin only.

The Klutter Framework makes it possible to write a Flutter plugin for both Android and iOS using Kotlin Multiplatform. Instead of writing platform spe

Gillian 33 Dec 18, 2022
A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also have privilege for fully customization from user side. like flipkart, amazon, myntra, meesho.

step_tracker plugin A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also

Roshan nahak 5 Oct 21, 2022
Boris Gautier 1 Jan 31, 2022
A Side Menu plugin for flutter and compatible with liquid ui for flutter

Liquid Shrink Side Menu A Side Menu plugin for flutter and compatible with liquid ui Side Menu Types There are 8 configuration of Liquid shrink side m

Raj Singh 18 Nov 24, 2022
FlutterBoost is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts

中文文档 中文介绍 Release Note v3.0-preview.17 PS: Before updating the beta version, please read the CHANGELOG to see if there are any BREAKING CHANGE Flutter

Alibaba 6.3k Dec 30, 2022
Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable.

Flutter Counter (iOS & Android) Description Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable. Create i

Salmaan Ahmed 15 Sep 18, 2022
Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Image Zoom and Cropping plugin for Flutter A simple and easy used flutter plugin to crop image on iOS and Android. Installation Add simple_image_crop

null 97 Dec 14, 2021
Flutter-ffmpeg - FFmpeg plugin for Flutter. Not maintained anymore. Superseded by FFmpegKit.

flutter_ffmpeg FFmpeg plugin for Flutter. Supports iOS and Android. Not maintained anymore, superseded by FFmpegKit. See FlutterFFmpeg to FFmpegKit Mi

Taner Şener 635 Dec 22, 2022
Rave flutter - A Flutter plugin for Flutterwaves's rave.

Rave Flutter A robust Flutter plugin for accepting payment on Rave with Card Nigerian Bank Account ACH Payments Mobile money Francophone Africa Mpesa

Wilberforce Uwadiegwu 30 Oct 6, 2022
A flutter plugin to add login with facebook in your flutter app

Features Login on iOS, Android and Web. Express login on Android. Granted and declined permissions. User information, picture profile and more. Provid

Darwin Morocho 157 Jan 6, 2023
Flutter blue plus - Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android and iOS

Introduction FlutterBluePlus is a bluetooth plugin for Flutter, a new app SDK to

null 141 Dec 22, 2022
This is a Flutter plugin that takes a JSON string and converts it onto a customizable Flutter Widget.

Colored JSON Convert JSON string into customizable widget. Getting Started ColoredJson is a stateless widget that produces a structured view of JSON s

null 4 May 20, 2022
Flutter plugin to manage home screen widget within flutter app.

Flutter App Widget App Widget / Home Screen widget plugin for flutter app Usage Please see app_widget subdirectory for the usage documentation. Plafor

Alexander Dischberg 6 Dec 16, 2022
Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter Shortcuts Show some ❤️ and ⭐ the repo Why use Flutter Shortcuts? Flutter Shortcuts Plugin is known for : Flutter Shortcuts Fast, performant &

Divyanshu Shekhar 39 Sep 26, 2022
Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

advance_image_picker Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edi

Weta Vietnam 91 Dec 19, 2022