Reputation: 565
I'm building a game for ios on unity3d, and I want to know how downloaded the game so I want to get permissions to the user's iphone, and get the phone number of the user and send it back to me.
I want the user's phone number or the user's IMEI number for example.
Is it possible doing that through Unity and IOS?
Thanks.
Upvotes: 2
Views: 2860
Reputation: 398
You cannot take IMEI and phone number of user mobile, Apple is restricted to get these uniqueID's.
You have to store UDID in keychain. for this you have to download keychainwrapper class and store the UDID generated by above code:
UIDevice *device = [[UIDevice alloc]init];
NSString *idForVend = [NSString stringWithFormat:@"%@", [device identifierForVendor]];
NSLog(@"%@",idForVend);
follow this link it will solve your problem for sure: https://stackoverflow.com/questions/16459879/how-to-store-a-string-in-keychain-ios
Upvotes: 0
Reputation: 786
I think the only info you can get is the identifierForVendor.
The identifier for vendor is :
An alphanumeric string that uniquely identifies a device to the app’s vendor.
Not Sure you can do this in Unity.
Objective C code to do it is :
UIDevice *device = [[UIDevice alloc]init];
NSString *idForVend = [NSString stringWithFormat:@"%@", [device identifierForVendor]];
NSLog(@"%@",idForVend);
If you want to get more info about the user, you should ask him to fill out forms field in your app. Then your app can send back the info to you.
Hope this can help you.
Upvotes: 0
Reputation: 3436
Unfortunately, you can NOT get anything like IMIE number or Phone number from iOS any more if you want to submit app to App Store. There is not any public api available for this.
You can get carrier info like carrierName, country code, network code- but these are not unique to device.
You can check what information available from UIDevice from : https://developer.apple.com/reference/uikit/uidevice
To check what you can get from core telephony https://developer.apple.com/reference/coretelephony
To check what you can get from System Configuration: https://developer.apple.com/reference/systemconfiguration
Upvotes: 1