I have created a web page with HTML Content as described in the AppLinks demonstration and that link is : http://reittv.w3studioz.com/terms/terms1
I have enabled the deeplinking in facebook App Settings. now I am sharing the post on facebook using the below code :
{
[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;
}
}];
}
}];
}
Now When I am clicking on the post then it's opening the url in facebook app(whereas it should open my native app) and not detecting the meta tags(that was in header file of the html page) ? How can we make our appName to open the application ? I am really frustrated now from some days. Please help this out.