4
有誰知道我可以如何使用Sharekit將視頻發佈到Facebook?我應該定製它還是有東西已經在那裏可以從sharekit做到這一點?任何擴展我可以下載?iphone的ShareKit與視頻上傳的Facebook?
謝謝!
有誰知道我可以如何使用Sharekit將視頻發佈到Facebook?我應該定製它還是有東西已經在那裏可以從sharekit做到這一點?任何擴展我可以下載?iphone的ShareKit與視頻上傳的Facebook?
謝謝!
而不是使用sharekit我建議使用FBGraphAPI這個的......
這裏是下面的步驟,您可以在.h文件中發佈在Facebook上的視頻..
#import "FbGraph.h"
#import "FbGraphFile.h"
#import "JSON.h"
#import <MobileCoreServices/MobileCoreServices.h>
@interface ViewController : UIViewController
{
FbGraph *FB_Graph;
FbGraphResponse *FB_Graph_Response;
FbGraphFile *FB_Graph_File;
}
-(IBAction)btnShareVideoPress:(id)sender;
@end
在.m文件調用此方法
.....
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSString *ClientID = @"197556430726736";
FB_Graph = [[FbGraph alloc]initWithFbClientID:ClientID];
[FB_Graph authenticateUserWithCallbackObject:self andSelector:@selector(fbGraphCallback:) andExtendedPermissions:@"user_photos,user_videos,publish_stream,offline_access,user_checkins,friends_checkins"];
}
-(IBAction)btnShareVideoPress:(id)sender
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"YouTubeTest" ofType:@"m4v"];
NSURL *videoURL1=[NSURL fileURLWithPath:path];
NSMutableDictionary *variables = [[NSMutableDictionary alloc]init];
FB_Graph_File = [[[FbGraphFile alloc] initwithURL:videoURL1]retain];
[variables setObject:FB_Graph_File forKey:@"file"];
[variables setObject:@"Test video upload 1" forKey:@"message"];
[variables setObject:@"video" forKey:@"MediaType"];
[FB_Graph doGraphPost:@"me/videos" withPostVars:variables];
FbGraphResponse *fb_graphresponse = [FB_Graph doGraphGet:@"me/videos/uploaded" withGetVars:variables];
NSLog(@"postPictureButtonPressed: %@", fb_graphresponse.htmlResponse);
}
FbGraphFile有initWithURL沒有接口。請附上您使用的文件 –