Вопрос

I am having feature of login via Facebook and posting to Facebook in my application.

I am having issue in one use case.

  • If user logs in and then tries to post then it works.

  • if user logs in goes to back ground and then tries to post still it works.

If I get active session using this.

    FBSession *session = [FBSession activeSession];

I am able to see that it already has all the permission.But if i try to post with this session it returns me that "An active access token must be used to query information about the current user." and getting 400 as error code.

But when user logs in goes to back ground stops app and then starts it again and try to post then it showing fbsession is closes.

I am still on developer mode. So i am running it through xCode. But once user stops the app I am not able to see the logs in xCode.

Is there a way to open a this fbsession from cache or anywhere else if user has stopped my app?

Это было полезно?

Решение

You can use this to open active session. If you pass yes it will create new session if it doesn't exists.

    [FBSession openActiveSessionWithAllowLoginUI:NO];
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top