Before ios7.0 came out, we used the WiFi Mac as a unique identifier for the iOS device. How to get the Mac of the device under iOS, you can parameter this article: get the MAC address of iOS
Before using IDFA, we used cfuuid in the iOS7 and above versions.
string createcuid ()
{
string strret = ;
Cfuuidref uuid_ref = cfuuidcreate (NULL);
Cfstringref uuid_string_ref= cfuuidcreatestring (NULL, uuid_ref);
Cfrelease (UUID_REF);
NSString *uuid = [nsstring stringwithformat:@ "%@" , (nsstring*) uuid_ STRING_REF];
Cfrelease (UUID_STRING_REF);
strret = [uuid utf8string];
return strret;
}
It is then stored on the keychain so that the next installation value persists (similar to MAC) even if the app is deleted.
--The use of keychain can be consulted here:
>>ios Development--the use of the keychain of password storage
>>IOS7: How to get the unchanging Udid
For more information on iOS unique identifiers, refer to this: iOS unique identifier boot
Written here, the application still does not use the IDFA, until later need to access the CPA promotion. CPA Advertisers in the IOS7 use is IDFA, so we have to use it, with it can not be bypassed the question is: How to choose when the version will not be called back by Apple?
About IDFA related information, the online has been many, here the main note two points:
1, how to obtain IDFA and save to keychain;
2, how to choose when submitting the application;
stringstrret;
NSString *identifier = [[NSBundle mainbundle] bundleidentifier];
NSString *keyname = [[NSString stringWithFormat:@ "%@.adfa.name", Identifier]init];
NSString *keyvalue = [[NSString stringWithFormat:@ "%@.adfa.value", Identifier]init];
Nsmutabledictionary *keynamevalue = (nsmutabledictionary *) [Chkeychain load:keyname];
NSString *valueadfa= [Keynamevalue Objectforkey:keyvalue];
if(VALUEADFA)
{
strret = [[Valueadfa uppercasestring] utf8string];
}
Else
{
NSString *adid =[[[asidentifiermanager Sharedmanager] advertisingidentifier] uuidstring];
//nslog (@ "adId:%@", adId);
strret = [[AdId uppercasestring] utf8string];
Nsmutabledictionary *usernamepasswordkvpairs = [Nsmutabledictionary dictionary];
[Usernamepasswordkvpairs Setobject:adid Forkey:keyvalue];
[Chkeychain Save:keyname Data:usernamepasswordkvpairs];
}
returnstrret;
As far as possible to ensure the uniqueness of the IDFA, if the Ad alliance using manual operation, each download application once after the manual to reset the ad tracking, and then download. So for it is two times to download, for us, such users are actually "cheating". So I did not save the IDFA to the Userdefault, and each time I took it from Keychain.
Using IDFA, the program must refer to Adsupport.framework, because our project does not use the Friend Alliance or other third-party SDK, so the submission of the situation and other references to the relevant SDK may not be the same. But there are a lot of questions on the Internet, and there are not many suggestions and solutions on the line. Because our project has been submitted and approved, this is just a record
First of all, be sure to tick the IDFA in the application, then our project is "Serve advertisements within the app"
With regard to this option, stackoverflow someone has proposed the scheme (original link: http://stackoverflow.com/questions/22979151/improper-advertising-identifier-idfa-usage)
Not involved in advertising, just tracking user conversion rate and so on, tick the first item. How to show ads on the second to third tick, how to use all to tick it. I understand for the time being, if there is a wrong place, welcome treatise:)
Hope that the use of IDFA partners, in the submission of the application is not too distressed, after all, submitted once, waiting for review also need a period of time to go back and forth quite toss