android - How can I know my app was previously installed on a phone? -


i trying make app allows single account per device. trying know property of phone never changes. @ first thought save mac address of device in database read in 1 of question on know in android when try access mac address programatically constant same every device. know never changing property of android device can access programatically.

also in future develop app ios, there same non changing property of ios phone can access programatically ? thank you.

for purpose, have differentiate between devices.

for android, can use device id

for ios, can use vendor id link.

for ios : when app deleted , reinstalled vendor id changes better store vendor id in keychain using below code.

-(nsstring *)getuniquedeviceidentifier {   nsstring *yourappname=[[[nsbundle mainbundle] infodictionary] objectforkey:(nsstring*)kcfbundlenamekey];   nsstring *applicationuuidstr = [sskeychain passwordforservice:appname account:@“your_app_name”];  if (applicationuuidstr == nil)  {     applicationuuidstr  = [[[uidevice currentdevice] identifierforvendor] uuidstring];     [sskeychain setpassword:strapplicationuuid forservice:appname account:@"your_app_name"];  }   return applicationuuidstr; } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -