通过Facebook Connect发布UIWebview [英] Publish UIWebview via Facebook connect

查看:83
本文介绍了通过Facebook Connect发布UIWebview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using fbConnect in my Cocoa Touch application. I have UIWebview on my view, and I want to publish the UIWebview's context (its only text) to FaceBook.

如何更改 FBStream 来发布UIWebview?

How should I change the FBStream to publish my 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代码:

Here is my UIWebView Code:

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];


推荐答案

不确定我通过共享UIWebview上下文理解您的意思

Not sure I understand what you mean by sharing UIWebview context.

如果要发布文本,则在FBConnect上有很多示例。

If you want to publish text, then there are numerous examples for that on FBConnect.

想尝试ShareKit,因为它使一切变得非常简单。...

You might want to try ShareKit, as it makes everything very easy....

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

If you could please re-explain the question, I could offer better help.

Godspeed,
奥德。

Godspeed, Oded.

这篇关于通过Facebook Connect发布UIWebview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆