Code Monkey home page Code Monkey logo

shomniauthfacebook's Introduction

shomniauthfacebook's People

Contributors

seivan avatar zintus avatar

Stargazers

Bob Edmonston avatar  avatar James Miller avatar Romain Briche avatar

Watchers

 avatar James Cloos avatar

shomniauthfacebook's Issues

pickAccountBlock(nil) signs in user?

Hej again,

I'm trying to use SHOmniAuthFacebook in the same way as I used SHOmniAuthTwitter.

So, the code below is the same as I used for Twitter (in twitter the first word is SHOmniAuthTwitter)

[SHOmniAuthFacebook performLoginWithListOfAccounts:^(NSArray *accounts, SHOmniAuthAccountPickerHandler pickAccountBlock) { 

        UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:@"Pick account"];
        [accounts each:^(id<account> account) {
            [actionSheet addButtonWithTitle:account.username handler:^{
                pickAccountBlock(account);
            }];
        }];

    NSString * buttonTitle = nil;
        if(accounts.count > 0)
            buttonTitle = @"Add account";
        else
            buttonTitle = @"Connect";

        [actionSheet addButtonWithTitle:buttonTitle handler:^{
            pickAccountBlock(nil);
        }];

        [actionSheet addButtonWithTitle:@"Cancel" handler:^{
            [MBProgressHUD hideHUDForView:self.view animated:YES];
        }];

        [actionSheet showInView:self.view];

    } onComplete:^(id<account> account, id response, NSError *error, BOOL isSuccess) { 
// etc

What I'm finding is that, in Twitter, when I click Add Account in the Action Sheet (the actionsheet shows cannyboy.twitter, Add Account, Cancel), it does what I expect, and goes to Safari to log in to an account.

However, when I click Add Account using SHOmniAuthFacebook, it logs in using the existing FB credentials (in Settings app)

Is this the expected behaviour? Should I not display Add Account for FB?

Adding birthday to the permissions?

SHOmniAuthFacebook seems to default to asking for the email only (from Facebook). Is there a way to ask for the birthday too?

I've managed to get it working by changing the library, in SHOmniAuthFacebook.m, +(void)performLoginForNewAccount:(SHOmniAuthAccountResponseHandler)completionBlock; to:

[FBSession openActiveSessionWithReadPermissions:@[@"email", @"user_birthday"]

.. but is there a better way to do this, without altering the library?

Are you suppose to use registerProvidersWith...?

[SHOmniAuth registerProvidersWith:^(SHOmniAuthProviderBlock provider) {
    provider(SHOmniAuthFacebook.provider, kFacebookAppID,kFfacebookAppSecret, @"email,user_birthday", @"shopcade://fbsuccess");

... I'm not sure @"email,user_birthday" gets passed to the right place?

Is the App Secret necessary?

I think for Twitter it is necessary, but can I leave it out when using SHOmniAuth for Facebook? Like:

[SHOmniAuth registerProvidersWith:^(SHOmniAuthProviderBlock provider) {
    provider(SHOmniAuthFacebook.provider, facebookAppID, @"", @"email", @"myApp://fbsuccess");
}];

Facebook request returning nil

I've had an issue since January 17... Coincidently, the date of the 3.11.1 Facebook SDK release. https://developers.facebook.com/docs/ios/change-log-3.x/

performLoginWithListOfAccounts is returning a response of null and and isSuccess of 0. Before it worked fine.

Strangely, I went into my Facebook app permissions, and removed my apps permission to Post on my wall (this was granted via the web version of my app). Then I was able to login with Facebook on my iOS app.

Can I use FBSession in other parts of the app?

Forgive me if this is a stupid question...

Does SHOmniAuthFacebook retain some kind of session when a user logs in?

I'd like to be able to invite FB friends to my app. I think the best way of doing this is something like this:

[FBWebDialogs presentRequestsDialogModallyWithSession:nil
                     message:@“Check out my app."
                     title:@"Invite Friends"
                     parameters:nil
                     handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {

                     }
                     ];

..but this asks the user to login again. Is their a way to use the existing SHOmniAuthFacebook session to login, so that the user doesn't have to login again?

Exception in SHOmniAuthFacebook.m

On line 151 in SHOmniAuthFacebook.m

authHash[@"token"] = account.credential.oauthToken;

.. I get this error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: token)'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.