Something went wrong error randomly happens

When logging in with apple i randomly get the error attached. There is no deterministic way to reproduce it, it happens randomly.

  • SDK Version: 3.1.6

  • Platform: iOS 17.3.1

    await Web3AuthFlutter.init(Web3AuthOptions(
    clientId: Constants.web3authClientId,
    network: Network.mainnet,
    redirectUrl: redirectUrl,
    whiteLabel:
    WhiteLabelData(theme: themeMap)));

    await Web3AuthFlutter.initialize();

hi @antonino.abbate,

Your issue has been forwarded to our Dev team and we will get back with further updates.

@antonino.abbate I tried at my end, and I can’t happen to reproduce it. Can you please share the snippet for login function along with screen recording?

Hello,
the code to login is very simple. Video of the failing procedure is here: WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free

  Future<Web3AuthResponse> _withGoogle() {
    return Web3AuthFlutter.login(LoginParams(
      loginProvider: Provider.google,
      mfaLevel: MFALevel.DEFAULT,
    ));
  }

  Future<Web3AuthResponse> _withFacebook() {
    return Web3AuthFlutter.login(LoginParams(loginProvider: Provider.facebook));
  }

  Future<Web3AuthResponse> _withApple() {
    return Web3AuthFlutter.login(LoginParams(loginProvider: Provider.apple));
  }

  Future<Map<String, String>?> login(LoginType type) async {
    Future<Web3AuthResponse> Function()? method;

    switch (type) {
      case LoginType.withGoogle:
        method = _withGoogle;
        break;
      case LoginType.withApple:
        method = _withApple;
        break;
      case LoginType.withFacebook:
        method = _withFacebook;
        break;
    }

    try {
      final Web3AuthResponse response = await method();
      GetStorage box = GetStorage();
      box.write('privateKey', response.privKey.toString());

      privateKey = EthPrivateKey.fromHex(response.privKey.toString());

      return {
        'address': privateKey!.address.toString(),
        'email': response.userInfo!.email!,
        'nickname': response.userInfo!.name!,
      };
    } on UserCancelledException {
      print("User cancelled.");
      return null;
    } on UnKnownException {
      print("Unknown exception occurred");
      return null;
    }
  }

Hello, any news?
This is blocking for us.

Thanks.

Hey @antonino.abbate, sorry for delays. I checked the video you shared. It’s issue of pricing plan. You currently are on free tier and hence, you won’t be able to use white label features. It’s available from growth plan. Please try removing the whitelabel parameter and try again. If you want to try whitelabel, you can create a project on Saphire Devnet instead of Mainnet. If you need to schedule a call to talk about pricing, let us know.

Hello. The problem is partly fixed getting rid of whitelabel features. Now, it just happens the FIRST TIME a user try to register/login. After cancellation and retry it works just fine. What could be the reason? The code on our side is - obviously - the same for every retry.

Hello, any update on this? It is blocking us.

Hey, sorry for the delays. It would be helpful if you can share the Web3AuthFlutter initialisation code, and some details on login provider you are using?

Can you also add a screen-recording? It will help us know what exactly is not working, along with at what step.

Hello, all the init code is posted in this thread.

Video of what is happening: Video

Hey, I tried but I’m not able to reproduce it. Can you confirm if GetStorage is working properly, and it’s not breaking? Are you doing await GetStorage.init()?

Of course we do. Code is:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await GetStorage.init();

  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);

  await SentryFlutter.init(
    (options) {
      options.dsn = Constants.sentryDSN;
    },
    appRunner: () => runApp(const MyApp()),
  );
}

Hello,
any update on this?

Hey, I tried reproducing still no luck. Can you please schedule a call with me so I can have a look at your code? I’ll DM you the Calendly link.

Hello,
we changed the URI from com.onlytechindustries.popup-events://openlogin to com.onlytechindustries.popup-events://auth but the problem still persist.

Any advice?

@Ayush can you help please, we are blocked by this issue

Hey, as I mentioned yesterday on the call, can you please share the API request being sent and parameters from Safari. You can get the details by debugging the simulator web JSContexts from Debug option in Safari.

Hello. Parameters and debug here: https://pastebin.com/2pttkRy4

Thanks.

@Ayush any suggestion or update?

Hey @antonino.abbate, thanks for sharing the details. Can you please also add the response of the APIs? I’ll meanwhile pass the details to the team.