Reputation: 339
hello i have a app that connects and post to user wall but when i try to post it always open the persmission page and in that page it writes you already give permission to this app.I want it to come only 1 time can anyone help me to do that?
- (id)init {
if (self == [super init]) {
facebook = [[Facebook alloc] initWithAppId:kAppId];
facebook.sessionDelegate = self;
if(permissions==nil){
permissions = [[NSArray arrayWithObjects:
@"read_stream", @"user_birthday",
@"publish_stream", nil] retain];
}
[self login];
}
return self;
}
- (void)login {
if (![_session isConnected]) {
[self postToWall];
}
// only authorize if the access token isn't valid
// if it *is* valid, no need to authenticate. just move on
if (![facebook isSessionValid]) {
[facebook authorize:permissions delegate:self];
}
is it because i init method?
Upvotes: 1
Views: 258
Reputation: 5523
See this page - https://developers.facebook.com/docs/guides/mobile/. Basically what you want to do is save the authentication information (access_token) when the user is authorized, then next time you can check for the saved values and skip the authentication.
Upvotes: 1