繁体   English   中英

生产中的TestFlight setDeviceIdentifier

[英]TestFlight setDeviceIdentifier in production

在TestFlight的文档中 ,它说在生产环境中设置设备标识符可能会导致您的应用程序被拒绝。

但是,它没有提及使用广告ID进行替换。 我的意思是,苹果似乎只会拒绝它,因为在iOS 7中不建议使用UDID。

话虽如此,如果我使用广告标识符在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);

谢谢!

UDID已弃用,因此,他们跟踪用户的唯一方法是使用广告标识符。

这没什么不对,在审核过程中不会造成任何问题。

标识设备/用户的另一种方法是使用NSUUID类的UUID方法创建UUID,并将其十六进制字符串表示形式写入用户默认数据库。

在iOS 6和更高版本中,Apple为您完成了这项工作。 只需在UIDevice类上调用identifierForVendor方法即可。

这是一段可以在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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM