看来 Apple 从 5 月 1 日起收紧了应用程序商店提交。我有一个使用 Spotify 的应用程序,并且已多次被 App Store 接受。在最近的更新中,该应用程序因以下原因被拒绝...
Non-public API usage:
Apps are not permitted to access the UDID and must not use the uniqueIdentifier method of UIDevice. Please update your apps and servers to associate users with the Vendor or Advertising identifiers introduced in iOS 6.
在 libspotify 上执行以下操作
strings libspotify | grep uniqueIdentifier
返回了 3 个 uniqueIdentifier 实例。另一篇帖子指出,这可能是由于 openSSL 造成的,可能与 UDID 无关。然而,苹果拒绝了该代码。有解决办法吗?
最佳答案
这里有一个 Cr4zY 快速修复,仅当您非常着急时才使用(就像我现在一样,要么发货,要么死!)...
使用像 0xED http://www.suavetech.com/0xed/ 这样的工具将 libspotify
二进制文件中的 uniqueIdentifier
部分更改为 uniqueXdentifier
之类的内容。 (注意!必须具有相同的长度,否则会很难折断!!!)
然后为 UIDevice
添加一个类别方法,即在您的项目中像这样(使用与更改为相同的名称)
static NSString *alternativeUniqueIdentifier = nil;
#define DEFAULTS_KEY @"heartbreakridge" // "Improvise, adapt, overcome" - Clint Eastwood in DEFAULTS_KEY
@interface UIDevice (CrazyFix)
- (NSString *)uniqueXdentifier;
@end
@implementation UIDevice (CrazyFix)
- (NSString *)uniqueXdentifier
{
if (!alternativeUniqueIdentifier) {
@synchronized(self) {
alternativeUniqueIdentifier = [[NSUserDefaults standardUserDefaults] stringForKey:DEFAULTS_KEY];
if (!alternativeUniqueIdentifier) {
// XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX (capital hex)
CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef);
CFRelease(uuidRef);
alternativeUniqueIdentifier = [(NSString*)CFBridgingRelease(uuidStringRef) lowercaseString];
alternativeUniqueIdentifier = [alternativeUniqueIdentifier stringByReplacingOccurrencesOfString:@"-" withString:@""];
alternativeUniqueIdentifier = [NSString stringWithFormat:@"%@%@", [alternativeUniqueIdentifier substringToIndex:8], alternativeUniqueIdentifier];
[[NSUserDefaults standardUserDefaults] setValue:alternativeUniqueIdentifier forKey:DEFAULTS_KEY];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
}
return alternativeUniqueIdentifier;
}
@end
关于spotify - libspotify 导致苹果应用商店拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16433621/