【问题标题】:Publish UIWebview via Facebook connect通过 Facebook 连接发布 UIWebview
【发布时间】:2011-01-11 22:38:03
【问题描述】:

我在我的 Cocoa Touch 应用程序中使用fbConnect。我的视图中有UIWebview,我想将UIWebview 的上下文(它唯一的文本)发布到FaceBook。

我应该如何更改FBStream 来发布我的 UIWebview?

FBStreamDialog* dialog2 = [[[FBStreamDialog alloc] init] autorelease];
            dialog2.delegate = self;
            dialog2.userMessagePrompt = @"Share Ghazals on your wall";
            dialog2.attachment = @"{\"name\":\"Hafez Application for iPhone\","
            "\"href\":\"http://itunes.apple.com/us/app/divan-of-hafez/id340865571?mt=8?tab=iphone\","
            "\"media\":[{\"type\":\"image\","
            "\"src\":\"http://photos-h.ak.fbcdn.net/photos-ak-sf2p/v43/67/279420942343/app_5_279420942343_8373.gif\","
            "\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],"
            "\"properties\":{\"another link\":{\"text\":\"Hafez App HomePage\",\"href\":\"http://www.momeks.com/hafez\"}}}";
            // replace this with a friend's UID
            // dialog.targetId = @"999999";
            [dialog2 show];

这是我的 UIWebView 代码:

NSString *path = [[NSBundle mainBundle] pathForResource:@"webViewContent" ofType:@"html"];
     NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];

     NSString *htmlString = [[NSString alloc] initWithData: 
                             [readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding];

     webView.opaque = NO;
     webView.backgroundColor = [UIColor clearColor];
     [self.webView loadHTMLString:htmlString baseURL:nil];
     [htmlString release];

【问题讨论】:

    标签: iphone cocoa-touch uiwebview fbconnect


    【解决方案1】:

    我不明白你所说的共享 UIWebview 上下文是什么意思。

    如果你想发布文本,那么 FBConnect 上有很多例子。

    您可能想尝试 ShareKit,因为它让一切变得非常简单......

    如果你能重新解释这个问题,我可以提供更好的帮助。

    神速, 奥德。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-24
      • 1970-01-01
      • 2011-11-03
      • 2018-08-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-08
      相关资源
      最近更新 更多