1
votes

I am sharing my post on Facebook. I am sharing Image, Content URL, Description. I am using this code for sharing:

FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
dialog.fromViewController = self;
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentTitle = APP_NAME;
content.contentDescription = text;
content.imageURL = [NSURL URLWithString:[[arrAllEvents valueForKey:@"flyer_image"]objectAtIndex:0]];
content.contentURL = url;
dialog.shareContent = content;
dialog.mode = FBSDKShareDialogModeFeedWeb;
[dialog show];

I have enable Deep Linking (News Feed links launch this app) option for https://developers.facebook.com. I have added my Fbid and URLShema Like this

<key>CFBundleURLSchemes</key>
            <array>
                <string>abcevent://</string>
                <string>fb1......</string>
            </array>

and add code in appdelegate.m for the same like this

- (void)applicationDidBecomeActive:(UIApplication *)application {
    [FBSDKAppLinkUtility fetchDeferredAppLink:^(NSURL *url,NSError *error){
        if([[url scheme] isEqualToString:@"abcevent"])
        {
            [self callNewsletter:url];
        }
    }];

    [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
    [FBSDKAppEvents activateApp];

}

Now if I am sharing my post on fb via application. That post click is not opening my app in iPhone Deep linking is not working. Can anyone tell what other things I am missing with this?

1
it is not <string>abcevent://</string> it is <string>abcevent</string>Anbu.Karthik
canyou show your plistAnbu.Karthik
@Anbu.Karthik This is my Plist := imagebin.ca/v/3Pv0QBFGn4rLNiharika
@Niharika - are you changed the string or notAnbu.Karthik

1 Answers

0
votes

The fetchDeferredAppLink method only works with ads. It never worked with links shared organically on the News Feed. You can read about more limitations of deep linking from Facebook in this blog post, but there are two core things to know:

  1. Facebook has never supported deferred deep linking for non-paid content.
  2. Facebook's App Links standard at one point supported normal deep linking (meaning if the app is already installed), but this has been broken on iOS for a long time.

If you want this sort of functionality, you'll need a separate solution like Branch.io (full disclosure: I'm on the Branch team).