Facebook iOS/Android SDK share link on friend's feed - android

I'm working on a game that runs on iOS, Android and Web. On the Web client I can set up a feed dialog that let's a user post on a friend's timeline:
That's achieved by using this code:
var params =
{
name: name,
link: link,
picture: picture,
caption: caption,
description: description,
actions: actions,
properties: properties
};
params.method = 'feed';
params.to = friend_id;
FB.ui(params, function(response){
...
});
The to field in the params is what makes the dialog select the friend's feed by default.
I want to do the same on the iOS and Android clients, but I can't find a way to achieve this with SDK 4.x.
The docs say:
"With the Share Button you will allow people to share content to their
Facebook timeline, to a friend's timeline or in a group."
Although it's true that the dialog allows the player to share on their friend's timeline, there doesn't seem to be a way to select this option before presenting the dialog to the user.
Looking at FBSDKShareDialog's and FBSDKShareLinkContent's interfaces I don't see a way to specify the "to" as we do in JS. Is this functionality just missing from the mobile SDKs?

So after some digging in the Facebook SDK's code I found a way to do what I wanted, but it's using undocumented and deprecated code... (according to the code comments this is there to support Unity). So it's not exactly recommended, but just in case it helps someone, here it goes:
On iOS, there's a hidden property in FBSDKShareLinkContent that lets you pass a free-form parameters dictionary for the share dialog in "feed" mode. Normally this is not accessible, but declaring an extension is all that's needed to make it public. Using the "to" key to specify the friend ID makes the dialog work as on the Web.
#interface FBSDKShareLinkContent ()
#property (nonatomic, copy) NSDictionary* feedParameters;
#end
...
FBSDKShareLinkContent* content = [[FBSDKShareLinkContent alloc] init];
content.contentTitle = title;
content.contentDescription = description;
content.contentURL = linkURL;
content.imageURL = imageURL;
content.feedParameters = #{#"to" : friendId}; // Setting hidden property
FBSDKShareDialog* shareDialog = [[FBSDKShareDialog alloc] init];
shareDialog.mode = FBSDKShareDialogModeFeedWeb; // Use feed mode
On Android, there's an undocumented class called ShareFeedContent that can be used instead of the normal ShareLinkContent and contains a toId field which is what I needed.
import com.facebook.share.internal.ShareFeedContent; // Import undocumented class
ShareFeedContent content = new ShareFeedContent.Builder()
.setLinkName(title)
.setLinkDescription(description)
.setLink(linkURL)
.setPicture(imageURL)
.setToId(friendId)
.build();
ShareDialog shareDialog = new ShareDialog(activity);
shareDialog.show(content, ShareDialog.Mode.FEED); // Use feed mode
It's probably not a good idea to use these, but they do definitely work. Hopefully someone else has a cleaner alternative.

Related

Branch IO generate link show in Quick Links Dashboard

Android Platform
i use below code to generate and share the link in Facebook etc, and click it, it has record in " Summary ", but not show in Quick Link Dashboard.
val lp = LinkProperties()
.addControlParameter("\$deeplink_path","https://www.google.com")
val buo = BranchUniversalObject()
.setCanonicalIdentifier("item/abcd")
.setTitle("Hellow Title")
.setContentDescription("Hello Description")
.setContentIndexingMode(BranchUniversalObject.CONTENT_INDEX_MODE.PUBLIC)
.setLocalIndexMode(BranchUniversalObject.CONTENT_INDEX_MODE.PUBLIC)
buo.generateShortUrl(
activity, lp
) { url, error ->
if (error == null) {
// share intent
} else {
Logger.e("error: ${error.message}")
}
}
Using the code, this cannot show in the Quick Link Dashboard.
About the doc, it need add two params "type:2" and "$marketing_title", i set it to LinkProperties:
lp.addControlParameter("type", "2")
.addControlParameter("\$marketing_title", "android _test")
Or: BranchUniversalObject:
buo.setContentMetadata(ContentMetadata().addCustomMetadata("type", "2"))
.setContentMetadata(ContentMetadata().addCustomMetadata("\$marketing_title","android"))
But it not work, so, how to solve?
Thanks!
By default, your SDK-created links will not be visible on the Quick Links Dashboard. The specification of passing type:2 and setting a marketing title in the request payload is limited to API-created links only.
Understanding that you'd want to check the conversions, it is highly recommended to tag these branch links (e.g. channel = API/campaign=Promo) so that you can segment your data to see all installs/clicks from links created via the SDK on the Branch Dashboard Sources/Summary section.

Error launching browser in Google.Apis.Auth.OAuth2.LocalServerCodeReceiver on Android

I'm trying to authenticate an end-user in an android app written in C# (Xamarin.Android).
I decided to try and use NuGet package Google.Apis.Oauth.v2 which seems to expose an easy to use Oauth client.
LocalServerCodeReceiver.ReceiveCodeAsync throws the following:
I get System.NotSupportedException:"Failed to launch browser with https://XXX.auth.XXX.amazoncognito.com/login?response_type=token&client_id=XXX&redirect_uri=https%3A%2F%2Fwww.google.com&scope=profile%20openid%20email for authorization. See inner exception for details."
and it has an inner exception of System.ComponentModel.Win32Exception:"Cannot find the specified file"
Code:
var clientSecret = new Google.Apis.Auth.OAuth2.ClientSecrets();
clientSecret.ClientId = ...
clientSecret.ClientSecret = ...
var initializer = new Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.Initializer(
"https://XXX.auth.XXX.amazoncognito.com/login",
"https://XXX.auth.XXX.amazoncognito.com/login");
initializer.Scopes = new List<string> {"profile", "openid", "email"};
initializer.ClientSecrets = clientSecret;
var flow = new Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow(initializer);
var authCodeRequestURL = flow.CreateAuthorizationCodeRequest("https://www.google.com");
authCodeRequestURL.ResponseType = "token";
var uri = authCodeRequestURL.Build();
var cancellationTokenSource = new System.Threading.CancellationTokenSource();
var codeReceiver = new Google.Apis.Auth.OAuth2.LocalServerCodeReceiver();
var task = codeReceiver.ReceiveCodeAsync(authCodeRequestURL, cancellationTokenSource.Token);
Do I need to ask for a specific permission in the application manifest?
Instead of redirecting to www.google.com, I've heard you can redirect to an app, I'm not really sure how to do that, is it http://my_app_package_name or http://my_app_title, something else?
Is it possible not to rely on that library for launching the browser and instead get the RequestUri and start an Activity, if so how will the app become aware the end-user completed the SignIn process and how will the app retrieve the token?
Sorry, but Google.Apis.Oauth.v2 does not support Xamarin, and there's no simple way to get it working.
Unfortunately no Google.Apis.* packages currently support Xamarin.
You might find the Xamarin.Auth package does what you want?
I've figured out how to redirect to an app after authentication in the browser completes.
It's called a "Deep Link" and it's documented at enter link description here, essentially you need to declare an IntentFilter on your Activity, which registers with the Android OS that if someone clicks or an page redirects to a specific URI, your app gets called. The token that's appended to the URI can then be read inside your app.

DynamicLinks.API is not available on this device [duplicate]

With normal installed apps it's possible to use the technique of Deep Linking in order to not only open a specific application from an URL but also to redirect it to a specific section/function such as a specific Facebook post or specific coordinates on a map.
Since I've read that with Instant Apps this won't be possible because links already point to the specific module to download and run, how would it be possible to access not only the said module but also pass it some parameters?
For example:
This is the link from which the view-only module of my map application will be downloaded: "www.myinstantappexample.com/onlyviewmap"
If I want it to point to a specific set of coordinates how would the link be composed?
Will it be like this: "www.myinstantappexample.com/onlyviewmap/?x=0.000&y=0.000" ?
From what I've been able to find google doesn't cover this aspect and I really can't wrap my head around it.
If I want it to point to a specific set of coordinates how would the link be composed?
It's up to you how to include any additional info in the URL. It could be via URL parameters or in the path itself. Eg.
https://www.myinstantappexample.com/location/2/user/5
https://www.myinstantappexample.com/onlyviewmap/?x=1.2&y=3.4
You then parse the URL in the receiving Activity. The Uri class includes a number of helper methods such as getQueryParameter() and getPathSegments() to make this easier.
For example, to parse this URL:
https://www.myinstantappexample.com/onlyviewmap/?x=1.2&y=3.4
You would do something like this in your Activity:
Uri uri = getIntent().getData();
String x;
String y;
if (uri != null) {
x = uri.getQueryParameter("x"); // x = "1.2"
y = uri.getQueryParameter("y"); // y = "3.4"
}
if (x != null && y != null) {
// do something interesting with x and y
}
Instant Apps and Deep Linking
Instant Apps rely on App Links to work, and App Links are just one type of deep link. So deep linking is still possible for Instant Apps, and is in fact absolutely critical to how they function. However, URI scheme deep linking (which is still very prevalent in Android apps) is not supported.
The difference between a regular app and an Instant App is that the device will only load a single Activity in response to the App Link the user clicks, instead of needing to download the full package through the Play Store. It's a more seamless experience for the user, but the underlying technology works the same way.
Passing Custom Parameters
If the user clicks an App Links-enabled URL like http://www.myinstantappexample.com/onlyviewmap/?x=0.000&y=0.000, you will get that entire string back inside the app after it opens. You'll have to parse out the x and y variables yourself, but they will be available to you. Something like this:
Uri data = this.getIntent().getData();
if (data != null && data.isHierarchical()) {
String uri = this.getIntent().getDataString();
Log.i("MyApp", "Deep link clicked " + uri);
}
You'll just need to manipulate the uri value to find what you need.
Alternative Approach to Custom Parameters
Alternatively, you can use Branch.io (full disclosure: I'm on the Branch team) to power your links. We have full support for Instant Apps, and this allows you to work with a much more friendly data format. We let you create links like this, to control every part of the behavior:
branch.link({
tags: [ 'tag1', 'tag2' ],
channel: 'facebook',
feature: 'dashboard',
stage: 'new user',
data: {
x: '0.000',
y: '0.000',
'$desktop_url': 'http://myappwebsite.com',
'$ios_url': 'http://myappwebsite.com/ios',
'$ipad_url': 'http://myappwebsite.com/ipad',
'$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'
}
}, function(err, link) {
console.log(err, link);
});
In return you get a URL like http://myappname.app.link/iDdkwZR5hx, and then inside the app after the link is clicked, you'll get something that looks like this:
{
tags: [ 'tag1', 'tag2' ],
channel: 'facebook',
feature: 'dashboard',
stage: 'new user',
data: {
x: '0.000',
y: '0.000'
}
}
In order to do that, you have to use the "app links assistant" in
Tools->App Links Assistant
Then check your links and, in the Path selector, check that the "pathPrefix" option is selected.
Then at the bottom of the OnCreate method of your activity (which is related to the link you recently edited) add this code:
Intent appLinkIntent = getIntent();
String appLinkAction = appLinkIntent.getAction();
Uri appLinkData = appLinkIntent.getData();
// then use appLinkData.getQueryParameter("YourParameter")
You can test and debug this, using the "editConfigurations" option, just open that window and edit your instantApp module (the one launched with the Link you recently edited) and in the URL field add the URL parameters that you need. (then just run that module :D )
Hope this to be helpful.

How can I access the values passed into my app via a custom url scheme from within my C# code?

I'm working on a Xamarin Forms application. It has an Entry field for the visit code on the initial page. I need to extend its functionality so that the application will open when a custom url scheme myscheme://visitcode is encountered, and the Entry will have its Text value prepopulated with the value of visitcode.
I've had success with getting the application to launch.
I added my scheme to the info.plist file in my iOS project, and it properly launches the app when I click on my custom url scheme in Safari on an iPhone.
I added the following line above my MainActivity in my Droid project:
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "myscheme")]
It properly launches the app when I click on my custom url scheme in Chrome on an Android phone.
The only remaining obstacle is to retrieve the value and populate the Entry field with it.
Can someone help me?
Note: I haven't tested this yet, so make sure your app lifecycle and the place where you handle the events are matching the Xamarin.Forms app lifecycle. That is, make sure Xamarin.Forms.Application.Current is not null. If it is, reshuffle your code to work around that.
For iOS, you have to override OpenUrl in your AppDelegate.cs:
public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation);
and in Android, you handle that in your MainActivity.cs, in your OnCreate or any other method used as entry point:
var intent = Intent;
var uri = intent.Data;
That should allow you to retrieve the parameters of the url.
You then can retrieve the current Xamarin.Forms Application object, by doing:
var myapp = Xamarin.Forms.Application.Current as MyApplication;
Now, it's up to you to retrieve the right entry, or it's view model, or a service or whatever to connect the dots.
There is a component within the Xamarin store that handles this for you:
http://components.xamarin.com/view/rivets
This will remove the lengthy code requirements in building native implementations.

Cannot get the new AppLinks to work on iOS or Android

Latest Update Below at Update #5
I'm trying to implement AppLinks for BOTH my iOS AND Android apps : http://applinks.org
I've done the following:
setup a custom url scheme for my app: inacho://
Setup in my App Delegate: - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
Add meta tags to my website at http://www.nachorater.com :
<meta property="al:ios:app_store_id" content="581815579"/>
<meta property="al:ios:app_name" content="iNacho" />
<meta property="al:ios:url" content="inacho://default" />
I've verified that the url scheme works great by typing in a link like inacho://default into Notes and clicking the link it creates. Wa-la! It opens my app.
But when I try clicking on a link to www.nachorater.com from Facebook or Quip, neither app automatically seems to take any notice that the site has these app links setup and it just loads the website in their browser(s) instead of trying to open my app.
Has anyone got this working?
Update:
I had an issue with some meta tags not being in the < head > portion of my templates and I fixed it.
Now the link: http://www.nachorater.com from the iOS Facebook app adds a nice little popup that lets you open the url in the iNacho app like so:
But my links to my dynamic reviews do not seem to be working, yet the Debug app that Ming pointed out shows that the meta tags look correct for them.
For example, http://www.nachorater.com/getReview?reviewID=6396169718595584
meta tags when debugging with https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.nachorater.com%2FgetReview%3FreviewID%3D6396169718595584 :
Update #2:
I posted a new nacho review link to my iNacho Facebook timeline and then tried to click on it from the Facebook Mobile app.
It started to load the page and popped up the handy indicator that lets you open the app in iNacho but then once the page loaded, the indicator went away (before I could click it).
Update #3:
From the Facebook app, I can now trigger an inacho URL for my reviews BUT it's ONLY if I click the little popup to open in iNacho before it disappears. If I let the page completely load in Facebook's built-in web view, the little popup disappears still.
Is this a problem with Applinks? Or a problem with the Facebook app? Or by design and why?
Update #4:
I may know what the problem is. The review page in turn loads up a dynamic image for the nacho review. So by loading the page, it has an img src tag that points to a dynamic url that loads the image. Is this being mistaken for a 'redirect' action of some sort?
Example of img tag (rendered): <img width="300" src="/getReviewImage?imageID=6125868501958656"></img>
Note: There are a bunch of other scripts/ajax that gets loaded dynamically too though (Facebook and twitter widgets and the like).
Is this a bug in AppLinks or the Facebook Mobile app? Shouldn't it not care about background loading objects like ajax and dynamic images?
Update #5
7/15/14 - This is still happening with latest Facebook app. When I click a link from my iNacho Facebook page to my iNacho website, it pops up the option to open it in the app for a split second before the page finishes loading. Then it hides it.
As for the twitter app, it does not even give me the popup for a split second. It doesn't seem to recognize the link is appslink enabled at all.
Quip on the other hand, I pasted a nacho link in and the first time I clicked on it, it went to its built-in safari with no option to open in my app. BUT the second time I clicked it, it directly opened my app instead.
Summary: So far, it seems like maybe some apps are implementing the AppLinks Navigation portion incorrectly or something. Quip seems to work but even Facebook's own app seems like it's not working.
I was having the same problem with AppLinks and decided to just forego them altogether and just use facebook's app link host: https://developers.facebook.com/docs/applinks/hosting-api
My app is really mobile only, and I misunderstood how AppLinks worked at first. I thought I could just put the al_ios_* meta tags on a single, universal web page but this is wrong. There would need to be a separate page for every piece of content on my site, and each one of those pages needs to have its own AppLinks meta tags to send a URL for that specific content back to my app.
When I was doing it wrong, when I tapped on my OpenGraph story in facebook, it would open my site in the web browser and there was an action icon in the bottom toolbar that I could tap and have the option to open my app. Or I would have to precision-tap the name of my app in the OpenGraph story. Either of those fast-switch to my app, but the URL would not be specific to the content I want my app to navigate to. Also, both of those options suck -- I just want to tap anywhere on the story and go straight to my app, which is why we're all here.
The solution
I am going to use an OpenGraph story with the share dialog as an example.
First, you need to create a hosted app link on your server, not in the app. Before creating your OpenGraph story or whatever is being shared, make a call to your server to accomplish 2 things:
1.) Make an API call to create a new facebook app link, which will give you back an ID
2.) Use that ID to make a 2nd API call to get the URL to your hosted app link
This has to be done on the server because these API calls require an app access token, not a user access token. This token has app level permissions, not user level permissions. You cannot and should not store your facebook app secret anywhere in your mobile application because someone could decompile your app and make changes to your facebook app. No good. Use your server because it can safely know your app secret.
My server side is in PHP so here is an example of how to accomplish this. Dealing with the API wasn't a particularly pleasant experience, so I'll share in hopes that it helps someone else with formatting the requests:
# create a new facebook app link using cURL
$metadata = <what to handle in AppDelegate application:openURL:sourceApplication:annotation>;
$url = "https://graph.facebook.com/v2.1/app/app_link_hosts";
$ch = curl_init($url);
# create form post data
$deepLinkURL = "<myApp>://" . $metadata;
$iosArray = json_encode(array(array("url" => $deepLinkURL,
"app_store_id" => <appStoreId (number)>,
"app_name" => "<myAppName>")
)
);
$webFallbackArray = json_encode(array("should_fallback" => false));
$formQuery = http_build_query(array("access_token" => "<appId>|<appSecret>",
"name" => $metadata,
"ios" => $iosArray,
"web" => $webFallbackArray)
);
# options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $formQuery);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
# get response
$responseJson = curl_exec($ch);
curl_close($ch);
# decode response from facebook
$jsonResponse = json_decode($responseJson, true);
$appLinkId = "";
# get appLinkId
foreach ($jsonResponse as $key => $val) {
# get status
if($key == "id") {
$appLinkId = $val;
}
}
# if response is good, need to request canonical URL from appLinkId
$errorMessage = "";
$canonicalUrl = "";
if(!empty($appLinkId)) {
# create another instance of cURL to get the appLink object from facebook using the ID generated by the previous post request
$getAppLinkUrl = "https://graph.facebook.com/" . $appLinkId;
$ch2 = curl_init();
# cURL options
$queryString = http_build_query(array("access_token" => "<appId>|<appSecret>",
"fields" => "canonical_url",
"pretty" => true)
);
curl_setopt($ch2, CURLOPT_URL, $getAppLinkUrl . "?" . $queryString);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
# get response
$urlResponseJson = curl_exec($ch2);
curl_close($ch2);
# decode response from facebook
$urlJsonResponse = json_decode($urlResponseJson, true);
# parse response to get canonical URL
foreach ($urlJsonResponse as $key => $val) {
# get canonical URL
if($key == "canonical_url") {
$canonicalUrl = $val;
}
}
# check for result
if(empty($canonicalUrl)) {
$errorMessage = "Unable to retreive URL.";
}
} else {
$errorMessage = "Unable to publish appLink.";
}
# encode response back to your app
if(empty($errorMessage)) {
$response = json_encode(array("result" => "success",
"canonical_url" => $canonicalUrl));
} else {
$response = json_encode(array("result" => "failed",
"errorMessage" => $errorMessage));
}
#send response back to your app
Back in your app, once you confirm a good response, put the canonical URL you get back as the url parameter in [FBGraphObject openGraphObjectForPostWithType: below. Now when you click on your story in the facebook app, it will go straight to your app. No web nonsense.
// Create an action
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
// Create an object
id<FBGraphObject> object;
// set shareDialog parameters
FBOpenGraphActionParams *params = [[FBOpenGraphActionParams alloc] init];
params.action = action;
params.actionType = #"<myApp>:<myAction>";
params.previewPropertyName = #"<key>";
object = [FBGraphObject openGraphObjectForPostWithType:#"<myApp>:<myObject>"
title:<title>
image:<urlToPic>
url:<fb.me/xyz canonical URL>
description:<someDescription>];
[action setObject:object forKey:#"<key>"];
etc...
When I was working on my app, Sweep, I put a pay/share wall after a certain amount of time spent in the app. I faced the same problem where AppLinks really sucked at actually linking off of Facebook, despite the promise. Based on this problem, I built a service called branch.io that hosts the links for me, plus automatically inserts the correct AppLinks metatags for Android/iOS. The links actually work as expected, as crazy as that is. It uses a combination of client side JS with the AppLinks to make them properly redirect in every webview and native browser
Here's a high level guide to creating the share links on iOS:
To get started, you just need to configure the location of your app in either store on the dashboard at dashboard.branch.io. Once it's all setup, you get your Branch app key.
pod "Branch" or you can clone the open source repo here:
https://github.com/BranchMetrics/Branch-iOS-SDK
Add the Branch key to your plist file as a String with the key 'branch_key'
Add the following code to your AppDelegate in the appropriate methods
In the didFinishLaunchingWithOptions:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// your other init code
Branch *branch = [Branch getInstance];
[branch initSessionWithLaunchOptions:launchOptions andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) { // previously initUserSessionWithCallback:withLaunchOptions:
if (!error) {
// params are the deep linked params associated with the link that the user clicked before showing up
// params will be empty if no data found
// here is the data from the example below if a new user clicked on Joe's link and installed the app
NSString *name = [params objectForKey:#"user"]; // returns Joe
NSString *profileUrl = [params objectForKey:#"profile_pic"]; // returns https://s3-us-west-1.amazonaws.com/myapp/joes_pic.jpg
NSString *description = [params objectForKey:#"description"]; // returns Joe likes long walks on the beach...
// route to a profile page in the app for Joe
// show a customer welcome
}
}];
}
In the openUrl for handling URI calls:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
// pass the url to the handle deep link call
// if handleDeepLink returns YES, and you registered a callback in initSessionAndRegisterDeepLinkHandler, the callback will be called with the data associated with the deep link
if (![[Branch getInstance] handleDeepLink:url]) {
// do other deep link routing for the Facebook SDK, Pinterest SDK, etc
}
return YES;
}
Lastly, to create the hosted links, it's very simple. You just need to call getShortUrl to dynamically create one. You can put as many keys and values in the links as possible (to be retrieved in the initSession callback)
You can put this snippet anywhere you want to create a link:
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
[params setObject:#"Joe" forKey:#"user"];
[params setObject:#"url.to.picture/mypic.png" forKey:#"profile_pic"];
[params setObject:#"Joe likes long walks on the beach..." forKey:#"description"];
// Customize the display of the link
[params setObject:#"Joe's MyApp Referral" forKey:#"$og_title"];
[params setObject:#"url.to.picture/mypic.png" forKey:#"$og_image_url"];
[params setObject:#"Join Joe in MyApp - it's awesome" forKey:#"$og_description"];
// Customize the redirect performance
[params setObject:#"http://myapp.com/desktop_splash" forKey:#"$desktop_url"];
Branch *branch = [Branch getInstance];
[branch getShortURLWithParams:params andCallback:^(NSString *url, NSError *error) {
// show the link to the user or share it immediately
}];
Android is very similar in method calls and functionality and can be found on the site.
sorry if my answer is not exactly what you expect but just to share what we did on our websites and apps.
For instance, I know we had to add more tags to make it works with twitter cards and here is the list of the meta properties we have in our pages:
meta property="twitter:card" content=""
meta property="twitter:title" content=""
meta property="twitter:description" content=""
meta property="twitter:image:src" content=""
meta property="twitter:app:id:iphone" content=""
meta property="twitter:app:name:iphone" content="Marmiton"
meta property="twitter:app:url:iphone" content=""
meta property="twitter:app:id:googleplay" content=""
meta property="twitter:app:name:googleplay" content=""
meta property="twitter:app:url:googleplay" content=""
and the metha you also have:
meta property="al:iphone:app_store_id" content=""
meta property="al:iphone:app_name" content=""
meta property="al:iphone:url" content=""
meta property="al:android:package" content=""
meta property="al:android:app_name" content=""
meta property="al:android:url" content=""
we also have the facebook opengraph meta defined such as fb:app_id. I mention that because when you receive the deeplink in your app, you also have the facebook app id in the applinks link.
And from what we tested:
facebook does not open the deeplink directly on iOS whereas Android gives you the app choice. It sometimes shows up the blue popup at the bottom of the screen and sometimes you just have a link added in the actionsheet you have when you tap on the share button in the facebook (safari) webview (only at first load)-> this presentation of the link depends on how the content was shared on facebook.
twitter add a link to the app inside the card on iOS.
Don't know what I can add more.
Hope it helps a bit.

Categories

Resources