Facebook深层链接无效

时间:2015-04-24 12:23:31

标签: ios objective-c facebook deep-linking applinks

我已经创建了一个包含HTML内容的网页,如AppLinks演示中所述,该链接为:http://reittv.w3studioz.com/terms/terms1

我在facebook App Settings中启用了深层链接。 现在我使用以下代码在facebook上分享帖子:

{

[FBSession openActiveSessionWithPublishPermissions: [NSArray arrayWithObjects: @"publish_stream", nil] defaultAudience: FBSessionDefaultAudienceEveryone allowLoginUI:YES completionHandler: ^(FBSession *session,FBSessionState status,NSError *error)
 {
     NSLog(@"---------------");
     if (error)
     {
         return;

     }
     else
     {
         [FBSession setActiveSession:session];
         NSLog(@"LOGIN SUCCESS");

         // Put together the dialog parameters

         NSArray* actionLinks = [NSArray arrayWithObjects:
                                 [NSDictionary dictionaryWithObjectsAndKeys:
                                  @"Scisser",@"name",
                                  @"http://reittv.w3studioz.com/terms/terms1",@"link",
                                  nil],
                                 nil];
         NSData *jsonData2 = [NSJSONSerialization dataWithJSONObject:actionLinks options:NSJSONWritingPrettyPrinted error:&error];
         NSString *actionLinksStr = [[NSString alloc] initWithData:jsonData2 encoding:NSUTF8StringEncoding];





         NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                        @"test", @"name",
                                        @"testCaption", @"caption",
                                        @"testDescription", @"description",
                                        @"http://reittv.w3studioz.com/terms/terms1", @"link",
                                        @"", @"picture",
                                        @"foo", @"ref",
                                        actionLinksStr, @"actions",
                                        nil];

         // Make the request
         [FBRequestConnection startWithGraphPath:@"/me/feed"
                                      parameters:params
                                      HTTPMethod:@"POST"
                               completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                                   if (!error)
                                   {
                                       // Link posted successfully to Facebook
                                       NSLog(@"Post was successfully shared on your Facebook timeline.");


                                       NSLog(@"%@",[NSString stringWithFormat:@"result: %@", result]);

                                       return;
                                   }
                                   else
                                   {
                                       // An error occurred, we need to handle the error
                                       // See: https://developers.facebook.com/docs/ios/errors
                                       NSLog(@"%@",[NSString stringWithFormat:@"%@", error.description]);

                                       return;
                                   }
                               }];

     }
 }];

}

现在当我点击帖子然后它在Facebook应用程序中打开网址(而它应该打开我的原生应用程序)并且没有检测到元标记(那是在html页面的头文件中)? 我们如何让appName打开应用程序? 有些日子我现在真的很沮丧。请帮忙解决这个问题。

0 个答案:

没有答案