IPhone: transferring information from a web page to an application downloaded from the App Store

I am trying to stick information from a web page to an iPhone application that offers a web page for download. I control both the web page and the downloadable application.

The scenario is as follows:

The user visits my web page on which I recognize the user (he may have logged in and I store his information in a cookie). I then submit a link to it in the app on the App Store, which it must download for the “advanced experience” of this web service. Now, when the user launches the downloaded application on his iPhone, I like to re-identify the user who previously visited the specified web page.

Everything would be easy if the iPhone application could read Safari cookies. But he cannot.

A somewhat outdated solution may be that the web server stores the visitor’s IP address and uses it to recognize it as soon as it launches the iPhone app. But it is unreliable.

Another would be to give the user a token (code), which he must remember, and then re-enter into the application. In my opinion, it’s still quite uncomfortable.

Any best deals?

+4
source share
5 answers

OK, we found some working solutions: HTML can create a cookie. Later, when the application is running, it cannot read this cookie directly, of course (due to the sandbox of the iPhone applications). However, he can connect to the server and then open the http URL that points to the server and enable the unique token that he received from the server in advance. This causes Safari to start accessing the server. Now the server can read the aforementioned cookie and, finally, establish a connection using the token.

0
source

Simply put, you cannot do this.

One thing you might consider is a custom URL scheme to run the application. You can send the user an email that uses this custom link. However, there are a couple of problems with this:

  • the user may not have the account that they used to register on your site configured on their iPhone. This may seem unlikely, but say that the user signed up for your site 5 years ago with their Hotmail account, and since then they switched to Gmail.

  • it is unlikely that the letter fits into the workflow. Perhaps they downloaded the application and simply launched it by touching the icon and not clicking the link in the received message.

You can also put the custom URL as a link to your web page, but again this will not fit into the workflow, because the App Store app is required to download.

Consider this - if you have some kind of website that has an authentication step, a fair bid probably means that the user is the type of person who already has an application, such as Facebook, installed on their iPhone. They’re already used to the paradigm of having to enter their credentials into the application, even though they may have already done so in Safari.

+1
source

If you can read the unique iPhone device identifier from javascript on your web page, you can find it again when the application is connected ...

But I cannot find any means to read this from Javascript in Mobile Safari, I thought I would post it in case there is a way to give you another option.

+1
source

Just stumbled upon this question, and I'm curious if you would think about using UIWebView. Where's the question: does UIWebView exchange cookies with safari?

If everything else should be easy.

0
source

UIWebView DO NOT make cookies with Safari. Unfortunately, this is not an option.

0
source

All Articles