The app references non-public selector in id (Facebook SDK iOS)

前端 未结 8 1916
清歌不尽
清歌不尽 2020-11-30 03:29

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

The app references non-public selector in MyApp : id

This warning

相关标签:
8条回答
  • 2020-11-30 04:06

    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.

    0 讨论(0)
  • 2020-11-30 04:08

    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.

    0 讨论(0)
  • 2020-11-30 04:15

    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.

    0 讨论(0)
  • 2020-11-30 04:19

    File FBGraphUser.h

    change

    @property (retain, nonatomic) NSString *id;

    by

    @property (retain, nonatomic) NSString *FbUserId;

    0 讨论(0)
  • 2020-11-30 04:23

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

    Change

    @property (retain, nonatomic) NSString *id;
    

    to

    @property (retain, nonatomic) NSString *UserId;
    
    0 讨论(0)
  • 2020-11-30 04:26

    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.

    0 讨论(0)
提交回复
热议问题