Back

Magic URL with Deep Link URI in Flutter Mac App

  • 0
  • Flutter
  • Apple
  • Cloud
  • Auth
Clifton
28 Nov, 2024, 04:42

I have a Flutter app for Mac with a myapp://test custom URI. If I visit that URI in my web browser, it redirects to my app.

But when I try to create a magic URL token like this:

TypeScript
final session = await account.createMagicURLToken(
  userId: 'test', 
  email: 'test@example.com', 
  url: 'myapp://test'
);

...I get this error:

AppwriteException: general_argument_invalid, Invalid url param: URL host must be one of: localhost, cloud.appwrite.io, appwrite.io (400)

How can I make the link in the email point to my custom myapp:// URI? 🤔

TL;DR
The error is due to Appwrite restrictions. Add `cloud.appwrite.io` to the host whitelist in your Appwrite console. Update the code where you set the URL parameter.
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