-3

I am making an android app, in which user will share the unique app link to his friends. and if his friend clicks on that link than he/she will be redirected to the play store or app store according to device. and when he/she installs the application then he/she should automatically added to the group of the person who sent the link.

i have successfully done with the creating links.

Thank you in advance

  • Maybe you could use the device IP. You can get it when the server gets the URL request. – adalpari Jul 15 '16 at 12:46
  • in the link which you created, you can append device ID plus referrer ID to uniquely identify it – Boola Jul 15 '16 at 12:48
  • is the ip address of device is UNIQUE?, if the user is connected to wifi when he hits the url and when the application is downloaded he changes himself to mobiledata then IP want change? @adalPaRi – Linesh Bhanushali Jul 15 '16 at 12:59
  • is the ip address of device is UNIQUE?, if the user is connected to wifi when he hits the url and when the application is downloaded he changes himself to mobiledata then IP want change? @Boola – Linesh Bhanushali Jul 15 '16 at 12:59
  • I was asking about IP, Every device has a unique ID. I was talking about that – Boola Jul 15 '16 at 13:09
  • @Boola thanks, can you tell me how to get that unique ID (IP). in android....and at url side also? – Linesh Bhanushali Jul 16 '16 at 04:29
  • @Boola, when you said about the Unique ID i searched , i found all the devices has their own unique WLAN MAC address.. i know how to get it through android app. .... but can you tell me how to get it when server gets URL request in php? – Linesh Bhanushali Jul 16 '16 at 04:51
  • I don't know much about php but you can parse the url and extract different parameters from it. like www.stackoverflow.com?uid=ABCD123&referid=refer123 now extract uid and referid value – Boola Jul 18 '16 at 04:45

1 Answers1

0

This seems more like an "architectural" type question, but it seems to be that you need to setup a workflow in which clicking on the link creates the new users account and associates it w/ the friend/friends without your web server, then forwards that person to the Play store to download the app. This could happen as several steps in the workflow, but appear as one "step" to the end user, if that's the desired goal, or it could be that you want them to go through the process step-by-step.

As far as how to handle getting the friends linked up, when the link is created, you could generate some unique ID string to tack into the URL. When sent to your server, this link would either contain info that tells your app what to do, or point to some pre-populated data table/file that has what you need. Either way, the URL would signal your web app server what needs to happen.

Keep in mind, we know VERY little about your app based on your description. Also, just to restate, this seems more like a design/architecture issue, not a "code" issue, and should probable be posted in on of the other Stack Exchanges.

CodeChimp
  • 7,511
  • 3
  • 35
  • 76
  • I know exactly what has to be done...my workflow is also ready. I am looking for how to get that unique id when my friends click on that link. so i want a code which can generate the unique id when the link is clicked. – Linesh Bhanushali Jul 15 '16 at 13:09
  • There are LOTS of way to do that. Us a UUID generator and store it somewhere. Or, take the info you need and hash it or encrypt it. Again, this depends GREATLY on your architecture of your app, steps it takes, how you plan to use said "generated" ID, and is probably best suited for one of the other exchanges. – CodeChimp Jul 15 '16 at 13:15
  • thank you for the reply..when you said about the UUID i searched , i found all the devices has their own unique WLAN MAC address.. i know how to get it through android app. .... but can you tell me how to get it when server gets URL request in php? – Linesh Bhanushali Jul 16 '16 at 04:55
  • First result of a Google search: http://stackoverflow.com/questions/1420381/how-can-i-get-the-mac-and-the-ip-address-of-a-connected-client-in-php – CodeChimp Jul 18 '16 at 11:54
  • i tried the link you provided. but it does not gets me anywhere because the code gives me the same value again and again not different even i tried many other codes but not working ...can you suggest me any other option. – Linesh Bhanushali Aug 03 '16 at 05:28
  • Sorry, I am not really an Android developer. I do know Java development, and web development as a whole. I'd suggest doing some targeted Google searches on how to find the MAC from a request in the server. How you do that, and if it's even possible, will greatly depend on what your web app portion is developed in. Keep in mind that the MAC you get might be the router, and not the device endpoint. – CodeChimp Aug 03 '16 at 12:38