I've already googled this problem, but I've not get any result..
the question is: how can I register a device with a unique identifier in my DB?
I know that:
- the use of the UDID
is deprecated so Apple reject app that use it.
- the identifierForVendor
can change if I reinstall my app two or more times.
- I can use a user registration
to get a unique identification, but I think that isn’t the correct way
Right now I use that code:
NSString *deviceUuid = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
What is the best way to resolve this problem?
You should consider strategies for identifying and authorizing the user instead of the device. Depending on a device-specific identifier prevents authorized users from switching devices without some sort of administrator interaction, and allows non-authorized users access if they happen to find/steal/borrow an authorized device. You can avoid these problems by relying on user credentials instead of device identifiers. Accepted answer iOS7 - Device unique identifier.
so you should use -(void)setAuthorizationToken:(NSString )authorizationToken; -(NSString)authorizationToken; -(void)setIPhoneToken:(NSString *)iPhoneToken; -(Nsstring *)iPhoneToken:(NSString *)iPhoneToken;