Back

[SOLVED] Deep link with Email verification

  • 1
  • Flutter
Tanner Meade
14 Feb, 2023, 22:03

If you put a normal webpage at the URL you provide when creating the verification, you could use javascript to retrieve the userId and secret. Then you use the appwrite SDK to confirm the verification.

TL;DR
The thread discusses the process of deep linking with email verification. The issue was solved and the solution involved adding a web platform and specifying the hostname. It is suggested to host a static webpage to convert query parameters into path parameters. Additionally, setting up deep linking for Flutter using systems like Universal Links and Deep Links/Dynamic Links/App Links is recommended. Using javascript on a normal webpage to retrieve the userId and secret is another option.
Tanner Meade
14 Feb, 2023, 22:09

Since you want to use deep linking into Flutter, you have to set that up. There are separate systems that android and iOS use for deep linking called Universal Links (iOS) and Deep Links/Dynamic Links/App Links (Android). Flutter provides a package that Joyti linked to which helps set this up for Flutter. These systems are a part of the operating system and Flutter, not Appwrite. But if you set them up correctly you can forward the query parameters into your app when the operating system opens your app due to the link being clicked.

Tanner Meade
14 Feb, 2023, 22:12

One hard problem you'll have to figure out is how to forward the query parameters into Flutter. It can be done, but it'll be a bit more involved since Flutter runs on both Android and iOS (but neither operating system supports deep link parameters automatically).

Tanner Meade
14 Feb, 2023, 22:15

You may find it easier to just write a small static webpage that verifies the account, then forwards the user to a deep link into the app. Since URL paths are supported well on both platforms, you could forward the user to a fail or a success path in your app. You can host static webpages for free.

Tanner Meade
14 Feb, 2023, 22:18

Optionally, you could just host a static webpage that converts the query parameters into path parameters inside your app. Those will be easier to forward into Flutter and verify. It'll be like yourdomain.com/verifyAccount/$23nj3434n34/sdfkn53 where $23nj3434n34 is the userId and sdfkn53 is the secret.

Tanner Meade
14 Feb, 2023, 22:22

All of the solutions I've mentioned won't require the user to do anything other than click a link in the email. This provides a better user experience than how some other services email the user a code that they have to copy over.

hamed
15 Feb, 2023, 12:46

That explains everything, thanks a lot. I'm trying your second option ,what shoud i do about invalid url: URL host must be one of:..... when passing the static webpage url?

gidrokolbaska
15 Feb, 2023, 14:13

same question here... I guess we have to add a custom domain in the appwrite console, but let's see what appwrite developers have to say about that

Drake
15 Feb, 2023, 16:15

You need to add a platform, not domain

Drake
15 Feb, 2023, 16:16

Make sure to add a web platform and specify the hostname

gidrokolbaska
15 Feb, 2023, 16:18

Ahaaa, gotcha

gidrokolbaska
15 Feb, 2023, 16:18

Thanks

joeyouss
15 Feb, 2023, 17:27

@hamed if your query is solved, shall I mark this thread as solved so others can see it?

hamed
15 Feb, 2023, 17:32

Yes it solved.

joeyouss
15 Feb, 2023, 18:18

awesome!

joeyouss
15 Feb, 2023, 18:18

can you please add [SOLVED] in the title of this post?

hamed
15 Feb, 2023, 18:51

[SOLVED] Deep link with Email verification

gidrokolbaska
16 Feb, 2023, 11:19

have you actually made it work? It works for me but only if i click the link from desktop. On mobile it just throws an exception

hamed
16 Feb, 2023, 14:16

What a coincidence 🙂 i was gonna ask you...Yeah it worked, i passed the static website url and the appwrite did sent that link with query , but im still trying to figure out why this website couldnt connect to my endpoint. Let me know if you wanna work together on our issue!

gidrokolbaska
16 Feb, 2023, 14:18

Your current appwrite instance is on localhost now, right?

hamed
16 Feb, 2023, 14:18

Yes

gidrokolbaska
16 Feb, 2023, 14:19

Alright. Give me a few minutes, I think I've figured it out. The procedure to verify your account when the appwrite instance is on localhost is a littble bit different than we were doing previously. Just allow me a few minutes to finish testing and I'll explain how to make it work in dev environment

hamed
16 Feb, 2023, 14:20

Alright.

gidrokolbaska
16 Feb, 2023, 14:27

Yes, finally been able to handle this annoying process

gidrokolbaska
16 Feb, 2023, 14:28
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