ben_the_builder
ben_the_builder

Reputation: 309

Facebook IOS SDK 3.1 - reauthorizeWithPublishPermissions?

Just upgraded to the Facebook iOS SDK 3.1 and already running into problems.

My app can't find the facebook method reauthorizeWithPublishPermissions, and it also hasn't got a clue what the static FBSessionDefaultAudienceFriends definition is!

Anyone else seen these problems? Can't believe that the 3.1 SDK would have these basic bugs in it, so I'm blaming my stupidity for now!!

For completeness, here is my code:

[FBSession reauthorizeWithPublishPermissions:[NSArray arrayWithObjects:@"publish_stream", @"publish_actions",nil]
    defaultAudience:FBSessionDefaultAudienceFriends 
    completionHandler:^(FBSession *session, NSError *error) {

        // Do something...

}];

Thanks.

Upvotes: 2

Views: 4466

Answers (4)

Hemang
Hemang

Reputation: 27072

@Zotter, answer is depreciated. Now (with latest Facebook iOS SDK, I guess v.3.19) you've to use - (void)requestNewReadPermissions:(NSArray *)readPermissions completionHandler:(FBSessionRequestPermissionResultHandler)handler; method, to authorise app with publish permissions.

[FBSession.activeSession requestNewPublishPermissions:permissions
defaultAudience:FBSessionDefaultAudienceFriends
completionHandler:^(FBSession *session, NSError *error) {
    if(!error) {

    }
}];

Upvotes: 3

Zotter
Zotter

Reputation: 141

reauthorizeWithPublishPermissions: is an instance method

  [FBSession.activeSession reauthorizeWithPublishPermissions:permissions defaultAudience:FBSessionDefaultAudienceFriends completionHandler:
     ^(FBSession *session,
       NSError *error)
     {
         ...
     }];

Upvotes: 1

Sam Grossberg
Sam Grossberg

Reputation: 1316

I had this problem. I was using an old version of Cocoapods that wasn't properly upgrading the source from 3.0 to 3.1. If you're using Cocoapods, upgrade to 0.14.0 and try again. If not, double check to make sure you have the latest Facebook SDK from master - if you don't see those values in FBSession.h, you probably have an old version of the SDK.

Upvotes: 0

amau96
amau96

Reputation: 857

 /*! No audience needed; this value is useful for cases where data will only be read from Facebook */

    FBSessionDefaultAudienceNone                = 0,
    /*! Indicates that only the user is able to see posts made by the application */
    FBSessionDefaultAudienceOnlyMe              = 10,
    /*! Indicates that the user's friends are able to see posts made by the application */
    FBSessionDefaultAudienceFriends             = 20,
    /*! Indicates that all Facebook users are able to see posts made by the application */
    FBSessionDefaultAudienceEveryone            = 30,

Upvotes: 2

Related Questions