【发布时间】:2015-02-06 14:13:03
【问题描述】:
您好,我正在尝试实现从 facebook 到我的应用的重定向。在我的场景中,我将应用程序中的照片发布到 Facebook。就像Instagram一样。现在我想要的是来自 facebook 应用程序,我需要像 instagram 一样看到“在 MyApp 中打开”之类的链接。这是我的代码
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)?
【问题讨论】:
-
目前没有支持的方法。
-
其他应用的表现如何?
-
除了 Instagram(FB 拥有)之外,还有哪些其他应用在做这件事?
标签: ios facebook facebook-graph-api deep-linking