Skip to content

Instantly share code, notes, and snippets.

View aaustin's full-sized avatar

Alex Austin aaustin

View GitHub Profile
<a id='downloadapp' onclick='branch.deepviewCta()'>View this in app</a>
[branchUniversalObject registerView];
[branchUniversalObject listOnSpotlight];
[branchUniversalObject showShareSheetWithLinkProperties:linkProperties
andShareText:@"Super amazing thing I want to share!"
fromViewController:self
andCallback:^{
NSLog(@"finished presenting");
}];

Safari Redirect Issue in iOS 9.2 Beta 3

If a user is in Safari and clicks on a link that you want to open up the app, and the app is installed, Safari opens a modal that says 'Open ?' with the choice of Yes/No. In the latest update of iOS 9.2, this modal was changed from Javascript blocking to Javascript non-blocking. This means that Javascript continues to run while the modal is up.

To open up the app, you need to safely fall back to the App Store in case the user uninstalled the app since. This is usually done with a setTimeout call like so: window.location = "twitter://"; setTimeout(function() { window.location = "itms-apps://itunes.apple.com/app/id333903271"; }, 500);

<link rel="alternate" href="android-app://your.package.name/your_app_scheme/blog/post12345">
{
"applinks": {
"apps": [ ],
"details": [
{
"appID": "T5TQ36Q2SQ.com.branch.sdk.TestBed",
"paths": [ "*" ]
}
]
}