43

I was having this warning when submitting my app with Application Loader.

The app references non-public selector in MyApp : id

This warning can potentially reject my app from Apple AppStore's validation.

My app is using Facebook SDK iOS 3.1.1 (also tried with 3.1)

Kalzem
  • 7,320
  • 6
  • 54
  • 79

8 Answers8

65

This problem happens because of the Facebook SDK for iOS.

Application Loader forbids the use of the variable "id" from any FBGraphUser related class (maybe others variables too, didn't test) - e.g. :

id<FBGraphUser> friend
id<FBGraphUserExtraFields>user

Facebook is informed about this problem as of january 2013 : Bug Report

The workaround for the moment is to use these:

[user objectForKey:@"id"]
[friend objectForKey:@"id"]

instead of user.id and friend.id as shown in the different Facebook samples.

JohnK
  • 6,865
  • 8
  • 49
  • 75
Kalzem
  • 7,320
  • 6
  • 54
  • 79
  • 3
    Would the application be rejected from the app store due to this? – Rahul Singh Jun 17 '13 at 07:07
  • Moreover I am using the same way as BabyAzerty has described,but I am still getting this warning.Could you let me know what other may be the cause for this.I have used KVC everywhere.Thanks. – Rahul Singh Jun 17 '13 at 07:27
  • 1
    In my case, the application was directly and clearly refused by the automatic robots validators, I couldn't push it to the AppStore. Maybe today it is different (but I hardly believe it) ? Unfortunatly, this was my only problem. I recommand you to double check that EVERY facebook variables/arrays are used with the ForKey function. Good luck ! – Kalzem Jun 17 '13 at 22:28
  • Now,I have double checked it for the Facebook ForKey function issue.I am using Forkey function everywhere in my code.I have also read that this issue can also occur due to implementation of some third party library which in my case there are 3-4 third party library namely ParseSDK,MixpanelSDK,Reachability,BugsenseSDK,FacebookSDK.Could any of these be a problem for the issue? – Rahul Singh Jun 18 '13 at 06:55
  • As far as I am concerned, Reachability has no problem at all. I only experienced this ForKey problem with the FacebookSDK. I haven't fully tested this SDK but their OpenGraph shouldn't cause any problem though. As for Parse,Bugsens and Mixpanel, I never tried them. You can always try to upload your app through the validator and not publish it (so you can see the different errors). – Kalzem Jun 18 '13 at 08:54
  • They have taken an `NSString` variable with name `id` **ex: NSString *id** while it should not be taken as it is already a class. – TheTiger Aug 02 '13 at 11:01
  • 2
    Sounds like this is a returning issue. I wasn't getting it before iOS7. Using latest FB SDK. Swapping out the dot notation got rid of the error. – WCByrne Sep 24 '13 at 19:58
  • 4
    The problem is there in SDK 3.8. Using `user[@"id"]` as opposed to `user.id` works for getting rid of the warnings. – Gabriele Petronella Sep 25 '13 at 19:44
  • @WCByrne I am getting the same warning, but have done a project wide search for user.id / friend.id with no results. Is there anywhere else the dot notation needs to be removed please? – RunLoop Oct 02 '13 at 22:16
  • meh.. I use phonegap lol, should I go on and hack the plugin. – Jay Mayu Oct 09 '13 at 11:43
  • I ran across this issue with iOS 7 and FB SDK 3.9 and this answer cleared the warning. Thanks! Interestingly the June 24th, 2013 reply to the bug report says, "This should now be resolved in the SDK 3.5.3. Thanks for your patience." The second sentence is right on target. – JohnK Oct 28 '13 at 19:35
  • This is still not fixed in 3.14 – Andy May 06 '14 at 10:41
3

Just to update for people coming here from search engines, this is fixed in the latest Facebook SDK (have just moved our project to library version 3.7.1 and validation warnings went away).

3

For anyone new coming here looking for an answer on this. The problem seem to have been fixed in v3.14.1 according to Facebook SDK change log

https://developers.facebook.com/docs/ios/change-log-3.x/

  • The id property on the types FBGraphObject, FBGraphPlace, FBOpenGraphAction, and FBOpenGraphObject have been deprecated in favor of objectID to avoid app store submission warnings.

  • The description property of FBLinkShareParams and FBOpenGraphObject
    has been deprecated in favor of linkDescription and
    objectDescription, respectively, to avoid app store submission
    warnings.

Alejandro Alcalde
  • 5,990
  • 6
  • 39
  • 79
Out of Orbit
  • 543
  • 2
  • 5
  • 17
2

Facebook iOS SDK 3.12 the same problem in FBGraphUser.h.

Change

@property (retain, nonatomic) NSString *id;

to

@property (retain, nonatomic) NSString *UserId;
gabemorales
  • 146
  • 6
0

File FBGraphUser.h

change

@property (retain, nonatomic) NSString *id;

by

@property (retain, nonatomic) NSString *FbUserId;

Carlos Avalos
  • 247
  • 4
  • 8
0

Use Facebook iOS SDK 3.13. there won't be any validation warnings.

Nookaraju
  • 1,668
  • 13
  • 24
0

I solved this issue (where 13.1 would still generate warnings and produce an invalid binary in itunesconnect) by downloading the FacebookSDK source from Github (link) and using the "build_framework.sh" script in the scripts dir. Then added the generated framework to my Xcode project - and got no more warnings.

Nicolinux
  • 169
  • 3
  • 8
0

The validation warnings are also present in v3.13. I don't know if this will work for other people but he's a quick workaround that got rid of the error. In FBGraphUser.h around line 41 I changed...

@property (retain, nonatomic) NSString *id;

to

@property (retain, nonatomic) NSString *FBUserID; 

I was also getting the same validation warning about setProfileId so I went to FBProfilePictureView.h and changed profileID on line 54 & 76 to FBID.

I then updated my FBLoginView information in my game's ViewController to reflect the changes. Everything FB related still seems to work in my app and it passed the Application Loader validation.

ASHISHT
  • 305
  • 1
  • 14
  • I wouldn't advise changing in inners of FB as your changes will break when you will update the SDK. – Kalzem May 06 '14 at 08:26