2016-02-01 75 views
0

我試圖在FBAPPInvite深度鏈接,但我給了我下面的錯誤FBAppinvite中的深​​度鏈接錯誤?

enter image description here

我使用這個代碼

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

告訴我我們的代碼.. –

+0

我添加在我的appinvite方法中使用的代碼 – imjaydeep

回答

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]; 
             } 
            }]; 
0

您必須添加您的應用程序的鏈接網址的meta標籤在您的網站。

<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

IOS Facebook SDK invite Missing App Link URL

+0

我試過但n沒有工作。 – imjaydeep