3

Looks like Apple has tightened app store submissions staring May 1. I have an app that uses Spotify and have been accepted into the App Store multiple times. On a recent update, the app was rejected for the following reasons...

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.

Doing the following on libspotify

strings libspotify | grep uniqueIdentifier

returned 3 instances of uniqueIdentifier. Another posting stated that this is probably due to openSSL and may have nothing to do with UDID. However, Apple is rejecting the code. Is there a work-around?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
Steve Yung
  • 68
  • 5
  • This question appears to be off-topic because it is about some bug or issue of the libspotify itself. It'd be more suited to post it to their issue tracker, etc. – quetzalcoatl Dec 13 '13 at 15:37

3 Answers3

4

Here is a Cr4zY quick-fix, use only if you are in a real hurry (like I am right now, Ship or Die!)...

Use a tool like 0xED http://www.suavetech.com/0xed/ to change the uniqueIdentifier parts in the libspotify binary to something like uniqueXdentifier. (Note! Has to have same length or it will break hard!!!)

Then add a category method for UIDevice i.e. like this in your project (using same name as was changed to)

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
epatel
  • 45,805
  • 17
  • 110
  • 144
  • Couldn't wait any longer, tried this and looks like it is working fine. App passed the code scan upon submission. – Steve Yung May 15 '13 at 23:57
2

Disclaimer: I work for Spotify

We're aware of the issue and working on making a hot-fix for iOS which removes the need for UDID access. Hang tight!

Edit: Hot-fix is out! Grab it at http://developer.spotify.com/technologies/libspotify . A corresponding release of cocoalibspotify is coming soon, but in the meantime it can be easily changed to support a different version number of libspotify.

Nik Reiman
  • 39,067
  • 29
  • 104
  • 160
  • Will this fix then be folded into cocoalibspotify? – Steve Yung May 09 '13 at 02:12
  • Do you have an idea when this fix will be released? – Igor May 14 '13 at 07:12
  • 1
    Not sure; keep an eye on the github page or ping Dan (he's the maintainer). In the worst case check out the hack posted by @epatel below. – Nik Reiman May 14 '13 at 09:24
  • @NikReiman That's not an issue of CocoaLibSpotify, but libspotify for iOS. Is Daniel also the mantainer for libspotify? Also, the hack below states that libspotify really uses -uniqueIdentifier which is bad. I thought it was because of openssl. – Igor May 15 '13 at 07:34
  • @Igor Dan is a maintainer of libspotify but not the only one. We are preparing a libspotify release here to address this issue; it should have been out much sooner, sorry. =/ – Nik Reiman May 15 '13 at 08:18
  • 2
    Hot-fix is out! See the developer page for more info. – Nik Reiman May 16 '13 at 17:49
2

A hot-fix has been released, removing the usage of uniqueIdentifier:

http://devnews.spotify.com/2013/05/16/libspotify-12-ios-hot-fix/

Nikal
  • 21
  • 2