Home » Javascript » How can I share a cookie from my website to a React Native app?

How can I share a cookie from my website to a React Native app?

Posted by: admin November 1, 2017 Leave a comment

Questions:

I’m trying to implement a form of deferred deep linking where a user follows a Universal Link and gets sent to my web site because they do not have the app installed. What I want to do is the following, but I am unsure how to do it:

  1. When they land on the web site, I will create a cookie with information pertinent to how they got there.
  2. I will then direct them to the App Store to install the app.
  3. When they install the app and open it, I should be able to read the previously created cookies to figure out where to direct them in the app.

Step 1 and 2 are easy, but I’m not sure how to read cookies from Safari on iOS and Chrome on Android (presumably no other browser would even be possible) from React Native.

Answers: