Back

Invalid `url` param: URL host must be one of: localhost, cloud.appwrite.io, appwrite.io

  • 0
  • React Native
SwordSaint
28 Sep, 2024, 20:44

Hello everyone, new to appwrite here. so I'm trying to implement email verification, I'm creating a mobile app with react native, but I don't know what to pass to the account.createVerification() function. I don't really know what needs to be there, is it a path to the home screen of my app?

TL;DR
Developers are encountering an error with 'Invalid url param.' The solution involves configuring the URL properly in the appwrite console. For redirecting users to a specific page in React Native, utilize a router system in your app or implement deep linking. Use account.createVerification() with the correct URL to handle email verification.
Steven
28 Sep, 2024, 20:49

it's supposed to take the user to something you've written that can pull out the secret and user id from the URL.

You can create a standalone web page. Or, for react native, you can implement deep linking

Pondia
28 Sep, 2024, 21:20

Here is an exemple

TypeScript
await this.account.createVerification(
  `${process.env.NEXT_PUBLIC_APP_URL}/register/verification`
);
Pondia
28 Sep, 2024, 21:22

You should get an email like that. So bassicaly ur user will be redirected to this route

SwordSaint
29 Sep, 2024, 05:44

Thanks for the clarification, but I just have a question, what if I want to redirect the user to a jsx page in my project? When I looked at your code, I assumed that the path you wrote there does just that. For context, I don't think I'm using Next.js (I honestly don't even know what it does, I'm a beginner app developer)

Pondia
29 Sep, 2024, 08:28

It does not matter if what framework or library you use here. You just need to redirect to a frontend route. So create a route using the router system of your app and redirect to it. Then youll have to capture the userId and secret to verify is they are correct

SwordSaint
1 Oct, 2024, 06:36

Hello everyone, I'm deeply moved by your efforts in helping me, but I just don't seem to know where to go from here, it displays on my error log this message: "Invalid 'url' param: URL host mush be one of: localhost, cloud.appwrite.io, appwrite.io", as you can see, I have an IP in the URL, which might be making this issue, I actually go this IP from appwrite console -> overview -> platforms -> web -> hostname I can't find any tutorials for expo-react-native related to this issue, can someone please help

D5
1 Oct, 2024, 07:47

Your localhost seems to be at a specific port?

D5
1 Oct, 2024, 07:48

If so, you will need to add localhost:your port to the appwrite console in the platforms section

SwordSaint
1 Oct, 2024, 08:39

this gives me an error

D5
1 Oct, 2024, 09:59

The IP should not be there I think?

D5
1 Oct, 2024, 09:59

You should enter the IP or localhost:port

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