FacebookのiOSSDKを使用してFacebookに画像をアップロードしようとしています。
画像をアップロードするために、私は次のことを行っています:
-画像のURLを取得するために、画像をプライベートサーバーにアップロードします。-Facebookウォールにコメントをアップロードするには、「フィード」を使用してFacebookダイアログを開きます。
私の目標は、iPhoneから直接Facebookに画像をアップロードするために、プライベートサーバーを使用して画像をアップロードしてURLを取得することを避けることです。
私はグーグルしていて、画像をFacebookに直接アップロードするためのいくつかの解決策を見つけましたが、SDKを含むデフォルトのダイアログを使用していません。
FBダイアログオブジェクトを使用して、デバイスから直接画像をアップロードする方法はありますか?ダイアログを置き換えるビューを作成するオプションではありません。
前もって感謝します。
これまでのところ、これはFacebookで公開する私のコードです。
+(void)composeFacebookWithImageUrl:(NSString *)imageURL image:(UIImage *)image delegate:(id)delegate
{
Facebook *_facebook;
_facebook = [[[Facebook alloc] initWithAppId:kAppId andDelegate:delegate] autorelease];
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
@"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
@"Ragdoll", @"name",
@"The Ragdoll maker app", @"caption",
@"Share with your friends", @"description",
@"http://www.im2.es/", @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
@"touch",@"display",
imageURL, @"picture",
nil];
[_facebook dialog:@"feed"
andParams:params
andDelegate:delegate];
}
ありがとう。