[英]TestFlight setDeviceIdentifier in production
In TestFlight's documentation , it says that settings the device identifier in production will likely cause your application to be rejected. 在TestFlight的文档中 ,它说在生产环境中设置设备标识符可能会导致您的应用程序被拒绝。
However, it says nothing about using the advertising id as a replacement. 但是,它没有提及使用广告ID进行替换。 I mean, it seems that apple would only reject it because retrieving the UDID is deprecated in iOS 7.
我的意思是,苹果似乎只会拒绝它,因为在iOS 7中不建议使用UDID。
With that said, would apple care if I track my users in TestFlight using the advertising identifier? 话虽如此,如果我使用广告标识符在TestFlight中跟踪我的用户,苹果公司会关心吗?
// Obsolete in iOS 7 and Apple will reject application...
MonoTouch.TestFlight.TestFlight.SetDeviceIdentifier(UIDevice.CurrentDevice.UniqueIdentifier);
// ...but will it reject this?
MonoTouch.TestFlight.TestFlight.SetDeviceIdentifier(ASIdentifierManager.SharedManager.AdvertisingIdentifier.ToString());
MonoTouch.TestFlight.TestFlight.TakeOff(applicationToken);
Thanks! 谢谢!
The UDID is deprecated so they only way to track users is using advertising identifier. UDID已弃用,因此,他们跟踪用户的唯一方法是使用广告标识符。
That's nothing wrong with that and it will not cause any problems during review. 这没什么不对,在审核过程中不会造成任何问题。
Another way to identify a device/user is to use the UUID method of the NSUUID class to create a UUID and write its hex-string representation to the user defaults database. 标识设备/用户的另一种方法是使用NSUUID类的UUID方法创建UUID,并将其十六进制字符串表示形式写入用户默认数据库。
In iOS 6 and later, Apple has done that work for you. 在iOS 6和更高版本中,Apple为您完成了这项工作。 Just call identifierForVendor method on the UIDevice class.
只需在UIDevice类上调用identifierForVendor方法即可。
Here's a code snipped that you can use with iOS6 and up: 这是一段可以在iOS6及更高版本上使用的代码:
#define kApplicationUUIDKey @"kApplicationUUIDKey"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSString *UUID = [[NSUserDefaults standardUserDefaults] objectForKey:kApplicationUUIDKey];
if (!UUID) {
UUID = [[[NSUUID UUID] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""];
[[NSUserDefaults standardUserDefaults] setObject:UUID forKey:kApplicationUUIDKey];
[[NSUserDefaults standardUserDefaults] synchronize];
}
[TestFlight setDeviceIdentifier:UUID];
[TestFlight takeOff:kTestFlightIdentifierKey];
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.