проверка методов делегата
-(void)fbDidLogin
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
[defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"];
[defaults synchronize];
[facebook requestWithGraphPath:@"me/picture" andDelegate:self];
NSLog(@"Login Success with :%@ %@",facebook.accessToken,facebook.expirationDate);
}
-(void)fbDidLogout
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if([defaults objectForKey:@"FBAccessTokenKey"] && [defaults objectForKey:@"FBExpirationDateKey"])
{
[defaults removeObjectForKey:@"FBAccessTokenKey"];
[defaults removeObjectForKey:@"FBExpirationDateKey"];
[defaults synchronize];
}
NSLog(@"Logout Success");
}
-(void)request:(FBRequest *)request didLoad:(id)result
{
if(c==0)
{
NSData *data = [NSData dataWithData:(NSData*)result];
UIImage *profilePic = [[[UIImage alloc] initWithData:data] autorelease];
image1.image=profilePic;
[self postWall];
// NSLog(@"response is %@", result);
// NSString *email =[result objectForKey:@"name"];
// NSString *userFbId =[result objectForKey:@"id"];
// NSLog(@"%@",email);
// NSLog(@"%@",userFbId);
c=1;
}
else
{
NSLog(@"%@",result);
NSLog(@"posted!!") ;
}
}
-(void)request:(FBRequest *)request didFailWithError:(NSError *)error
{
NSLog(@"Failed with error: %@", [error localizedDescription]);
}