Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rynslmns

macrumors newbie
Original poster
Apr 23, 2015
1
0
Hi, Trying to implement a referral program and was curious if you can save data to a phone (from a webpage) so that whenever the app is installed, it can be retrieved from the app. Ideally, once a referral code is shared, the user would go to a custom url which would save the referral code to the phone. Once the app was downloaded and installed, that referral code would be retrieved. Is this possible? Any advice/suggestions would be appreciated!
 
I think if there is a solution, it's to create an SQLite database in the Webpage, then access that database in the app. Unfortunately, I don't know if it's even possible to retrieve that database in the app.
 
I think if there is a solution, it's to create an SQLite database in the Webpage, then access that database in the app. Unfortunately, I don't know if it's even possible to retrieve that database in the app.

You can downliad everything to the documents folder of your app. So you can also download full sqlite databases.
But what the OP needs is a way to identify the device which runs the app, and so find out if yhe user been on his site for refersl or w.e.

There is a way to do this.
Make your site store a cookie.

For the app, use urlscheme to load your site again and with serverside scripting you can fetch the cookie if exists, double check and use urlscheme in a redirect function, like php's header() function to your app (also urlscheme'd app) with parameters of desired info.

Your app will load woth parameters, and you have your result.

Ofcourse its a workaround to access your cookie, but iOS apps can't access the user's safari, unless its jailbroken etc.

This is your only sollution or you must find a wsy to store sone great unique device number serverside and countercheck it from the app.

This might be a tough one, and closest you might get is a combination of browseragent,browserverdion,ios version

But this is not quite reliable. The best but not nicest option would be bouncing apps with utlscheme.

Good luck!
 
Another method would be to have the user save a watermarked image to their photo library from a web page. Then the app can act like a photo editing app and detect whether the appropriate image is present. The app will have to have a valid reason to access photos though, or it won't get approved.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.