Facebook sdk post on wall on iPhone app

后端 未结 3 477
-上瘾入骨i
-上瘾入骨i 2020-12-25 10:26

I have a problem with implementing Facebook posting on wall in my iPhone application. I installed SDK and linked framework login is working fine. here\'s the code:



        
3条回答
  •  没有蜡笔的小新
    2020-12-25 10:58

    try this code

            NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage];
    NSArray* facebookCookies = [cookies cookiesForURL:
                                [NSURL URLWithString:@"http://login.facebook.com"]];
    
    for (NSHTTPCookie* cookie in facebookCookies) {
        [cookies deleteCookie:cookie];
    }
    NSString *FBBody = [NSString stringWithFormat:@"your message you want to post"];
    UIImage *img=[UIImage imageNamed:[NSString stringWithFormat:image naemif you want to post]];
    FBFeedPost *post = [[FBFeedPost alloc] initWithPhoto:img name:FBBody];
    [post publishPostWithDelegate:self];
    [[UIAppDelegate indicator] startAnimating];
    IFNNotificationDisplay *display = [[IFNNotificationDisplay alloc] init];
    display.type = NotificationDisplayTypeLoading;
    display.tag = NOTIFICATION_DISPLAY_TAG;
    

提交回复
热议问题