2
votes

With the new changes in facebook, deeplinks to app (shared via basic sharing) not work anymore.

So, I decided to implement applinks. But my mobile app does not have corresponding web site for the content i want to share to Facebook. So i choose facebook's mobile hosting API for app links

https://developers.facebook.com/docs/applinks/hosting-api

I generated an app link and share it in my ios app along with the other contents as bellow.

// Create an object
    NSDictionary *properties = @{
                                 @"og:type": @"article",
                                 @"og:url": @"https://fb.me/[some id]",
                                 @"og:title": name,
                                 @"og:description": desc,
                                 @"og:image":imageurl
                                 };

    FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject  objectWithProperties:properties];

    // Create an action
    FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
    action.actionType = @"news.publishes";

    [action setObject:object forKey:@"article"];

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


    FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc] init];
    shareDialog.fromViewController = self;
    shareDialog.shareContent = content;
    [shareDialog show]; 

By doing this, i can share the content in facebook. Upon tap on the content, my iOS app can launch. So it's fine.

But my problem is, The content i want to share is dynamic. I have two questions.

  1. Can i create facebook applinks for dynamic contents?
  2. Once open the app from deeplink, I want to navigate user to the content screen inside my app. But i cannot do it because i cannot see any thing releated to share content in the url received in - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options method

I want to know is this requirement achievable via facebook's mobile hosting API for app links.

1

1 Answers

0
votes

Clay from Branch here.

The answer to both questions is yes. The issue is Facebook is difficult to deal with and their links break in a lot of cases. You can convince yourself here. Deep Linking from Facebook in 2017

With full disclosure, I work for Branch, so take that as you will. We actually support link hosting, so you should be able to use us without hosting your own web domain. We also support Facebook links all within our own links with simple use of OpenGraph parameters within our links.

OpenGraph Parameters in Branch Links

Conceptually, on the inside a Branch link looks like this:

{
    tags: [ 'tag1', 'tag2' ],
    channel: 'facebook',
    feature: 'dashboard',
    stage: 'new user',
    alias: 'myalias',
    data: {
        mydata: 'something',
        foo: 'bar',
        '$desktop_url': 'http://myappwebsite.com',
        '$ios_url': 'http://myappwebsite.com/ios',
        '$android_url': 'http://myappwebsite.com/android',
        '$og_app_id': '12345',
        '$og_title': 'My App',
        '$og_description': 'My app\'s description.',
        '$og_image_url': 'http://myappwebsite.com/image.png'
    }
}

With this you can attach any metadata you would like and can therefore support your dynamic content with deep linking while covering Facebook links, as well as, nearly every other platform and device. We also cover deferred deep linking which is not supported with Facebook App links.

For the basic deep linking that you are looking for, the service is free.