我正在尝试在FBAPPInvite中进行深层链接,但我给出了以下错误
我应用此代码
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
[params setObject:@"1452" forKey:@"station_id"];
[params setObject:@"https://s3-us-west-1.amazonaws.com/myapp/radiostation.jpg" forKey:@"$og_image_url"];
[params setObject:@"Check out my favorite station on iHeartRadio" forKey:@"$og_description"];
[params setObject:@"Wild 94.9" forKey:@"$og_title"];
[[Branch getInstance] getShortURLWithParams:params
andChannel:@"facebook"
andFeature:@"app_invite"
andCallback:^(NSString *url, NSError* error) {
FBSDKAppInviteDialog *inviteDialog = [FBSDKAppInviteDialog new];
if ([inviteDialog canShow]) {
inviteDialog.content =[[FBSDKAppInviteContent alloc] init];
inviteDialog.content.appLinkURL = [NSURL URLWithString:url];
inviteDialog.content.appInvitePreviewImageURL = [NSURL URLWithString:@"https://s3-us-west-1.amazonaws.com/host/zackspic.png"];
[inviteDialog show];
}
}];
答案 0 :(得分:3)
我得到了我的错误解决方案
我在branch.io
中设置了所有参数[[Branch getInstance] getShortURLWithParams:nil
andChannel:@"facebook"
andFeature:@"app_invite"
andCallback:^(NSString *url, NSError* error) {
FBSDKAppInviteDialog *inviteDialog = [FBSDKAppInviteDialog new];
if ([inviteDialog canShow]) {
inviteDialog.content =[[FBSDKAppInviteContent alloc] init];
inviteDialog.content.appLinkURL = [NSURL URLWithString:url];
inviteDialog.content.appInvitePreviewImageURL = [NSURL URLWithString:@"https://s3-us-west-1.amazonaws.com/host/zackspic.png"];
[inviteDialog show];
}
}];
答案 1 :(得分:0)
您必须在自己的网站中添加应用链接网址的元标记。
<html>
<head>
<meta property="al:ios:url" content="example://applinks" />
<meta property="al:ios:app_store_id" content="12345" />
<meta property="al:ios:app_name" content="Example App" />
<meta property="og:title" content="example page title" />
<meta property="og:type" content="website" />
<!-- Other headers -->
</head>
<!-- Other HTML content -->
</html>
</head>
OR