Back

Password recovery with flutter

  • 0
  • Flutter
  • Cloud
_lk_7t2_
14 Jun, 2023, 11:58

Hi there

After clicking on the link for password recovery, the link does not redirect to my flutter ( android app ) It only open cloud.appwrite.io

So I'm wondering if there's any extra steps to make this work

TL;DR
The user is asking about password recovery with Flutter and is unsure whether to use the intent in the description or just keep Appwrite one. They mention a package called uni_links for deep linking. They share code for a DeepLinkHandler class and ask which package it is from. They mention using an event observer. They also mention needing to redirect to the app after password update and ask about navigating to a specific page or showing a snack bar. Another user suggests using `window.location.replace()` for the redirect and shares a link to their project as an example. The user mentions that this is a complex topic and shares a resource for further information.
otik
14 Jun, 2023, 12:15

Did you put a returning address into recovery function?

_lk_7t2_
14 Jun, 2023, 12:17

As parameters of the function , I added email and URL ( cloud.appwrite.io )

otik
14 Jun, 2023, 12:21

The url should be your domain for app (yourdomain.com)

_lk_7t2_
14 Jun, 2023, 12:25

When passing another URL the console says URL host must be one of: localhost , cloud.appwrite.io

_lk_7t2_
14 Jun, 2023, 12:34

So where should I use my app domain

_lk_7t2_
14 Jun, 2023, 12:46

And to be sure, we understand ourselves, what does domain refers to in case of a flutter android app

otik
14 Jun, 2023, 12:56

Oh, sorry, flutter app.... I dont really know how is it there.

otik
14 Jun, 2023, 13:30
_lk_7t2_
14 Jun, 2023, 13:38

I've already seen this , but it's unclear

Binyamin
14 Jun, 2023, 13:48

That's a pretty complex topic. You'll need to add deep linking to your app, by that you'll send the user to a custom URL in which your app is connected.

Also, check here https://discord.com/channels/564160730845151244/1108537125160353802/1108537840826073199

hortigado
14 Jun, 2023, 15:35

in my project your can see how implement the redirect

hortigado
14 Jun, 2023, 15:35

you need window.location.replace( "appwrite-callback-645117a4024fbb32ed34://updateRecovery" );

_lk_7t2_
14 Jun, 2023, 15:48

Thanks I'll check

_lk_7t2_
14 Jun, 2023, 15:49

Okay I'll check

_lk_7t2_
15 Jun, 2023, 15:25

I finally managed to redirect to the app , now I'm searching how to handle it like navigating to a specific page after password update , or just showing a snack bar

hortigado
15 Jun, 2023, 16:35
TypeScript
  WidgetsFlutterBinding.ensureInitialized();
  final deepLinkHandler = DeepLinkHandler(onLinkReceived: (Uri uri) {
    // watch snackbar o redirect
    print('URL recibido: $uri');
  });
  WidgetsBinding.instance!.addObserver(deepLinkHandler);
  runApp(MyApp());
}```
hortigado
15 Jun, 2023, 16:37

you need a event observator

_lk_7t2_
15 Jun, 2023, 16:58

Which package is DeepLinkHandler from ?

hortigado
15 Jun, 2023, 17:18
TypeScript
  final Function(Uri) onLinkReceived;

  DeepLinkHandler({required this.onLinkReceived});

  @override
  Future<void> didChangeAppLifecycleState(AppLifecycleState state) async {
    if (state == AppLifecycleState.resumed) {
      final initialLink = await getInitialLink();
      if (initialLink != null) {
        onLinkReceived(initialLink);
      }
    }
  }
}```
Use is package https://pub.dev/packages/uni_links
_lk_7t2_
15 Jun, 2023, 17:58

When setting up, should I use the intent in the description or just keep appwrite one

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more