Facebook deep linking/App link not working on iOS

440 views Asked by At

I am trying to open my app from facebook when I tap on the post I made from my app.

I registered my app in developers.facebook.

I enabled the deep linking in my facebook app settings.

I have created the URL scheme for the app.

Note:My app is not published into app store. (Appple Appstore & Facebook app center)

I tried the following ways: However the post is made successful but facebook is not opening my app when I tap on that post.

One Way:

    // Create an object
    NSDictionary *properties = @{
                                 @"og:type": @"books.book",
                                 @"og:title": @"A Game of Thrones",
                                 @"og:description": @"In the frozen wastes to the north of Winterfell, sinister and supernatural forces are mustering.",
                                 @"books:isbn": @"0-553-57340-3",
                                 };
    FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];

    // Create an action
    FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
    action.actionType = @"books.reads";
    [action setObject:object forKey:@"books:book"];

    // Create the content
    FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
    content.action = action;
    content.previewPropertyName = @"books:book";

    FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];

    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fbauth2://"]]){
        dialog.mode = FBSDKShareDialogModeNative;
    }
    else {
        dialog.mode = FBSDKShareDialogModeBrowser; //or FBSDKShareDialogModeAutomatic
    }
    dialog.shareContent = content;
    dialog.delegate = self;
    dialog.fromViewController = self;
    [dialog show];

Another Way:

   FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];

    content.contentURL = [NSURL URLWithString:@"https://developers.facebook.com"];
    content.contentTitle=@"TestSHare";

    FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];

    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fbauth2://"]]){
        dialog.mode = FBSDKShareDialogModeNative;
    }
    else {
        dialog.mode = FBSDKShareDialogModeBrowser; //or FBSDKShareDialogModeAutomatic
    }
    dialog.shareContent = content;
    dialog.delegate = self;
    dialog.fromViewController = self;
    [dialog show];

Facebook is opening the app center page. But not my app.

Does the deeplink works only when app is pubished ?

Any reasons ?

0

There are 0 answers