45

Today we received a feedback about our submission and we do not understand the reported problem: "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.".

We know about the rejections about udid, but our App do not use this! After read this, our team reevaluated the App and we do not found occurrences from "UIDevice uniqueIdentifier". We also revised all used libraries and really we do not find any call from UDID.

Someone have ideas?

After research, I executed "greap" command and I am suspecting about FacebookSDK:

my-app-directory $ grep -Rnis 'uniqueIdentifier' *
Binary file MyApp/FacebookSDK.framework/FacebookSDK matches
Binary file MyApp/FacebookSDK.framework/Versions/A/FacebookSDK matches
Binary file MyApp/FacebookSDK.framework/Versions/Current/FacebookSDK matches
Binary file MyApp/MyApp.xcodeproj/project.xcworkspace/xcuserdata/myuser.xcuserdatad/UserInterfaceState.xcuserstate matches

FacebookSDK uses uniqueIdentifier?? Whats the resolution?

Nishant Tyagi
  • 9,615
  • 3
  • 36
  • 61
Tiago
  • 451
  • 1
  • 4
  • 4
  • 6
    Are you using third party libraries or classes that could contain UDIDs? – sangony May 07 '13 at 02:15
  • Are you passing anything, maybe something you are constructing, from your App to your servers that identifies the iPhone? – GoZoner May 07 '13 at 02:40
  • 1
    Maybe some analytics libraries? – Undo May 07 '13 at 03:45
  • 1
    Do you have any other methods in your app called `uniqueIdentifier`? Sometimes Apple will incorrectly flag private/deprecated selector use even when the selector is not on an Apple-class. – Mike Weller May 08 '13 at 13:58
  • This answer may help you: http://stackoverflow.com/a/14448057/1431728. – JohnK Oct 28 '13 at 20:20

14 Answers14

86

In My case it was ibGoogleAnalytics_debug.a library.

To find which library is using uniqueidentifier method, go to your project folder and type in:

$ find . | grep -v .svn  | grep "\.a" | grep -v "\.app" | xargs grep uniqueIdentifier

I got this: Binary file ./My_Project/libGoogleAnalytics_debug.a matches

scurioni
  • 2,344
  • 1
  • 16
  • 14
  • 2
    This should be the accepted answer, it cuts through and nails the offending code dead on. – MobileVet May 09 '13 at 18:14
  • is there any room for false positives? Millennial SDK (v5.0.1) is being thrown, even when they claim it's no longer used. – Emanuel May 14 '13 at 03:15
  • 2
    Some 3rd party libraries don't use a ".a" extension, and instead use no extension. This command will find API usage in those files as well: `grep -lr "uniqueIdentifier" * | grep -v .svn | grep -v .md` – CornPuff Jun 25 '13 at 22:01
  • Perfect!Must keep it as a sample. – SONIC3D Jun 27 '13 at 13:24
7

Solved it: The problem is that your project still refer to the old SDK and it compiles the code with your old sdk methods including the UDID which apple rejects.

Fix it in your build properties of SEARCH PATH Framework Search Paths Library Search Paths

remove unnecessary values such as old sdk path and put there your current sdk path

clean all project's files: Window->Organizer->Project - delete your project Product->Clean

Now rebuild it and resubmit it to apple.

Enjoy :)

5

Check the binary you generated with the strings command, and look for uniqueIdentifier:

$ strings YOUR_BINARY | grep uniqueIdentifier

It is likely you're going to find it in there.

I found that OpenSSL has a string uniqueIdentifier declared in their headers, so it's probable your application (or any static library you're providing with your app) has included it.

In my case the culprit was libspotify.

Igor
  • 4,508
  • 2
  • 20
  • 11
  • How can I use String command ? I have a xyz.app then ?? I am using $ strings xyz.app | grep uniqueIdentifier and getting can't map file: xyz.app (Invalid argument). Thanks – Mangesh May 09 '13 at 06:59
  • Search for a file with the same name of your app inside the ".app" directory. Assuming my app is called "Foo.app" run "find Foo.app -type f -name Foo", and then run strings against it. – Igor May 10 '13 at 20:43
  • @Igor - I seem to have the same problem with libspotify. It's not in plaintext anywhere in my source code, so it seems to be inside the libspotify binary. Did you find a solution? – Grav May 10 '13 at 22:07
  • @Grav - Send an email to Apple stating you aren't using uniqueIdentifier but libspotify links to OpenSSL which has the string defined. – Igor May 11 '13 at 20:15
  • +1 Thanks Igor, But I am still unable to run. I have xyz.app file on desktop and it is not working :( – Mangesh May 13 '13 at 10:11
  • The uniqueIdentifier within openSSL is a preprocessor similar to #define _name "uniqueIdentifier", so it doesn't get compiled into the symbol table for apple to grep after compiling the binary. – mskw May 30 '13 at 15:46
3

In my case for this problem was responsible BugSense SDK (I used obsolete version). After upgrading to the newest version (3.1.3) everything is ok.

Tomasz Wojtkowiak
  • 4,855
  • 1
  • 26
  • 34
  • Thanks Tomasz for the clarification. Actually the latest version of the plugin is 3.3.1 You can download it and read the release notes here http://www.bugsense.com/releases/ios/3.3.1 – PanosJee May 08 '13 at 07:41
  • Thank You very much. It helped me a lot. – Krish Jun 11 '13 at 15:12
3

I had the same issue, but was able to pin-point the file containing uniqueIdentifier using the following command in terminal, within my project folder.

grep -Rnis 'uniqueIdentifier' *

This echo'd out a bunch of lines in my terminal window, with the culprit being libGoogleAdModAds.a - even though I wasn't actually using it in my code, it was still referenced in my project and therefore added to the build.

my source was: http://www.commandlinefu.com/commands/view/3573/search-for-a-string-inside-all-files-in-the-current-directory

roycable
  • 291
  • 1
  • 9
3

I filed a bug with Facebook, but here is a workaround:

https://developers.facebook.com/bugs/193119420841692

In the sdk, edit facebook-ios-sdk/src/FBSession.m

Comment out the

- (BOOL)isMultitaskingSupported {
/*
UIDevice *device = [UIDevice currentDevice];
return [device respondsToSelector:@selector(isMultitaskingSupported)] &&
[device isMultitaskingSupported];*/
return TRUE;
}

Its not needed since IOS 4.0 anyhow.

that removes the reference, and re-build the .a

Eric
  • 442
  • 1
  • 5
  • 13
2

I have the same issue today. I upgrade AdMob SDK to 6.4.1 and submit again but no use. But it passed upload check after I disabled AdMob code and don't link to its library.

According to Google's announcement, AdMob SDK 6.4 and above do not access UDID anymore. Obviously, Apple doesn't think so.

Suyuan Chang
  • 781
  • 1
  • 5
  • 6
  • Upgrading the AdMob SDK solved the problem for me. I think you may have an other thrid part library using uniqueIdentifier. – ant_one May 07 '13 at 17:21
  • I submitted today the same binary that was rejected some days ago and it has not been rejected. I guess the problem was in the itunes connect side and not in the admob lib. – hectr May 14 '13 at 07:25
  • I submitted a new version with same AdMob SDK and iTunes connect didn't complain that. I think the problem was in iTunes connect and they already fixed it as others said. – Suyuan Chang May 23 '13 at 03:00
2

Usually third party libraries for analytics and beta testing use uniqueIdentifier to track users (for example test flight or old versions of GA), check if any of the third party library you are using use this. If is not the case, you can ask for a clarification at http://itunesconnect.apple.com.

JP Illanes
  • 3,545
  • 41
  • 56
1

I had the same problem yesterday updating my applications.
After search for third parties libraries using UDID I realized I was using Conversion Tracking for iOS. This library used UDID but the the April 10 released an update fixing this problem:

The iOS conversion tracking SDK v1.2.0 no longer accesses UDID (released April 10, 2013).

I hope it helps.

mlabraca
  • 892
  • 1
  • 11
  • 17
1

I tried all the day, my app is always rejected.

First, I tried find . | grep -v .svn | grep ".a" | grep -v ".app" | xargs grep uniqueIdentifier in my project folder.

It appeared that Google Analytics, AdMob and Wikitude SDK were using uniqueIdentifier. So I removed GA, and I updated AdMob and Wikitude. Now, there is no more calls to the uniqueIdentifier method. When I do grep, the result is nothing. I cleaned everything in my project, but my app is always rejected !

What can I do now ? Any help will be appreciated ...

EDIT : I found this line :

IDEWorkspaceWindowController***UniqueIdentifier***_IDEActiveWorkspaceTabController_IDE

In this file :

MYPROJECT.xcodeproj/project.xcworkspace/xcuserdata/MYUSERNAME.xcuserdatad/UserInterfaceState.xcuserstate

Do you think the problem can come from this line ?

BoloG
  • 81
  • 1
  • 4
1

I don't think the Facebook IOS SDK itself uses the deprecated 'uniqueIdentifier'. I looked into the sources at https://github.com/facebook/facebook-ios-sdk.

But when the Facebook SDK is generated from this sources, the created binary contains the string. The only library, that is used by the SDK is the --> Accounts.framework <-- from IOS itself!

So looks like Apple has shot their own foot!

Edit: Eric gave the correct answer. UIDevice is used in facebook-ios-sdk/src/FBSession.m. The Accounts.framework wasn't the problem.

Community
  • 1
  • 1
Gernot Ullrich
  • 149
  • 1
  • 6
1

This is all Apple does, all you need to do is:

strings - -a -arch armv7 "App.app/App" | grep uniqueIdentifier

App.app is after you unzip the App.ipa, it will then be inside the payload directory.

Just run that command inside the payload directory. You can do a test by greping a known method you use.

You can substitute armv7 to all if you want to search for all architectures it is built for.

mskw
  • 8,915
  • 7
  • 37
  • 60
0

I'm facing the same issue today. There is a variable in openssl named uniqueIdentifier. Maybe it causing the problem.

user1349923
  • 673
  • 7
  • 22
  • Are you by any chance using libspotify? I found it being the culprit on my submission today. – Igor May 07 '13 at 15:05
0

I had the same issue. It turned out to be RevMob sdk. The latest 5.9.0 (2013/05/30) seams to fix the issue.

Aaron Stephenson
  • 112
  • 1
  • 11