1

我想从我的 iPhone 应用程序中自动共享一个社交媒体用户帐户(没有对话框、取消选项、发送选项)。我该怎么做。

4

1 回答 1

7

而不是使用对话框,使用doGraphPost

使用此方法在fb上分享,无需打开对话框

 <FbGraphResponse_Obj> = [fbGraph doGraphPost:@"me/feed" withPostVars:<NSMutableDictionary>];

在这里详细查找:

// Invoke fbGraphCallback & prepare fbArray..

// preapare conent to be posted, add following snippet in same function

    NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:4];
    [variables setObject:@"Yours content to be shared" forKey:@"message"];


    // share prepared content to fb
    fb_graph_response = [fbGraph doGraphPost:@"me/feed" withPostVars:variables];
    NSLog(@"postMeFeedButtonPressed:  %@", fb_graph_response.htmlResponse);


where fb_graph_response is an instance of FbGraphResponse

享受编程!!

于 2013-03-23T06:17:00.037 回答