I'm trying to signup User in React Native. There are 2 steps to do it When I enter the info of user Like (FirstName, LastName, and email), the User got a link in his/her mail. When the User is clicking on this link, its redirecting to New Signup Page with two more fields Like Password and Address. I want to send a inviation code to a user through a link. How can we send invitation code along with app link and how to handle this when user open app??
3 Answers
Let's break down the problem into sub-problems.
1. Deep link and Universal Linking
Register your app for the deep link with custom myapp://path/to/resource
and universal link https:yourcompany.com/path/to/ressource
.
Note: Apple required domain name ownership verification for universal linking.
React Native CLI - https://venturedevs.com/en/blog/implementing-deep-linking-react-native-apps/
Expo - https://docs.expo.dev/guides/linking/
2. Sending verification code to email.
Logic to send email should be handled on the backend or using third-party mail services like sendGrid.
Assume that the user receives an email with a verification link like https://auth.yoursecret-server.com/myapp?authCode=35467809876
3. Deep link to the code verification screen
React Navigation has first-class support for deep linking, I recommend it for handling screen-based deep linking. Consult their documentation for further. https://reactnavigation.org/docs/deep-linking

- 4,242
- 1
- 8
- 14
I am not sure if I understand your query completely but, you would need to use react-native-branch or react-navigation-linking.
Please follow through with the documents to get a roadmap.

- 537
- 4
- 9
-
Second link helped me in understanding this Thanks for your help Will Comment later If I Stucked again in any Problem – Muhammad Umar Feb 03 '22 at 13:52
In such case what we have done is we have added invitation code in custom URL like below
testapp://singup/invite/abc123456
and completed android and ios native setups
next in app
import { Linking } from "react-native"
React.useEffect(() => {
Linking.addEventListener("url", _handleDeepLinkURL)
return () => {
Linking.removeEventListener("url", _handleDeepLinkURL)
}
}, [])
const _handleDeepLinkURL= async ({ url }) => {
let inviteCode = parseUrlForCode(url)
let validation = await api.validate(inviteCode,userEmail)
}

- 240
- 2
- 8
-
Brother How can i send invitation code along with link Now I'm sending link like this demo://SignUp to open SignUp Page demo://ForgotPassword to open Forgot Password Page directly – Muhammad Umar Feb 03 '22 at 13:32
-
you can use query params demo://SignUp?inviteCode=123 and parse the url using any of the method they have mentioned https://stackoverflow.com/questions/44038180/react-native-parse-url-to-get-query-variable/48217789 – Dheeraj Feb 03 '22 at 13:42
-
1Done it with the help of Following Link https://reactnavigation.org/docs/configuring-links/ – Muhammad Umar Feb 03 '22 at 13:51