从Facebook重定向到IOS应用程序的特定帖子

问题描述:

嗨我正试图实现从Facebook重定向到我的应用程序。在我的场景中,我从我的应用程序发布照片到Facebook。就像instagram一样。现在,我要的是从Facebook的应用程序,我需要看到像“在MyApp的打开这个”就像Instagram的做链接。这里是我的代码从Facebook重定向到IOS应用程序的特定帖子

UIImage *image=[UIImage imageNamed:imageName];  
SBJSON *jsonWriter=[SBJSON new]; 

NSArray *actionlinks=[NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:@"MyApp",@"name",@"https://apps.facebook.com/abskdjk/",@"link", nil], nil]; 

actionlinks=[NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:@"MyApp",@"name",@"https://m.facebook.com/apps/abskdjk/",@"link", nil], nil]; 
NSString *actionLinkStr=[jsonWriter stringWithObject:actionlinks]; 

NSString *urlString=[NSString stringWithFormat:@"https://apps.facebook.com/abskdjk"]; 

NSMutableDictionary *params2 = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           @"507124573",@"app_id", 
           @"This is myApp", @"caption", 
           urlString, @"link", 

           UIImagePNGRepresentation(image), @"picture", 

           actionLinkStr, @"actions", 
           nil]; 

[FBRequestConnection startWithGraphPath:@"me/photos" parameters:params2 HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) 
{ 
    if (!error) { 
     NSLog(@"result: %@", result); 
    } 
    else {   
     NSLog(@"%@", error.description); 
    } 


}]; 

此代码发布在Facebook上的照片,但不显示在我的应用程序中打开该特定照片的选项,换句话说,它不允许我像instagram一样重定向到我的应用程序。如何将照片重定向到我的应用,如Instagram?

+0

目前还没有任何支持的方式做到这一点的extensive documentation on the FB website。 – 2015-02-06 18:53:27

+0

其他应用程序在做什么? – 2015-02-09 05:36:05

+0

除Instagram之外,还有哪些其他应用正在做它(FB拥有)? – 2015-02-09 18:17:56

为了这个工作,你必须使用Facebook深层链接。

有关于如何做到这一点