flutter_account_kit icon indicating copy to clipboard operation
flutter_account_kit copied to clipboard

Getting Error: Invalid OAuth 2.0 Access Token in iOS

Open sosuren opened this issue 5 years ago • 0 comments

I tried to get account info after successful login but got all properties of Account object as null and also prints error log:

[AccountKit][Error]: Invalid OAuth 2.0 Access Token

Snippet:

await flutterAccountKit.configure(Config()
      ..facebookNotificationsEnabled = true
      ..receiveSMS = true
      ..readPhoneStateEnabled = true
      ..theme = FacebookitTheme.theme);
LoginResult result = await flutterAccountKit.logInWithPhone();
switch (result.status) {
    case LoginStatus.loggedIn:
      bool isLoggedIn = await flutterAccountKit.isLoggedIn;
      print(isLoggedIn) // false
       Account account = await flutterAccountKit.currentAccount;
       if (account != null) {
          print(account.phoneNumber); // null
          print(account.accountId); // null
       }
      return true;
    default:
       // do something else
 }
  1. Values in Info.plist is correct (triple checked it) and also enabled Enable Client Access Token Flow in App Dashboard.
  2. Only fails in iOS
$ flutter doctor -v
[✓] Flutter (Channel beta, v1.2.1, on Mac OS X 10.14.4 18E226, locale en-GB)
    • Flutter version 1.2.1 at /usr/local/flutter
    • Framework revision 8661d8aecd (3 months ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

sosuren avatar May 13 '19 10:05 sosuren