This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Branch *branch = [Branch getInstance]; | |
[branch createDiscoverableContentWithTitle:self.monsterName | |
description:self.monsterDescription | |
thumbnailUrl:[NSURL URLWithString:@"https://s3-us-west-1.amazonaws.com/branchmonsterfactory/321png"] | |
linkParams:@{@"monster_face_index":@3, | |
@"monster_body_index":@2, | |
@"monster_color_index":@1, | |
@"monster_id":@"1234"} | |
publiclyIndexable:YES]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[Branch getInstance] initSessionWithLaunchOptions:launchOptions andRegisterDeepLinkHandler:^(NSDictionary *deepLinkParams, NSError *error) { | |
if (!error) { | |
NSLog(@"finished init with params = %@", [deepLinkParams description]); | |
if ([deepLinkParams objectForKey:@"object_id"]) { | |
UINavigationController *navController = (UINavigationController *)self.window.rootViewController; | |
NSString * storyboardName = @"Main"; | |
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil]; | |
UIViewController *nextVC = [storyboard instantiateViewControllerWithIdentifier:@"ObjectViewController"]; | |
[navController setViewControllers:@[nextVC] animated:YES]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application | |
continueUserActivity:(NSUserActivity *)userActivity | |
restorationHandler:(void (^)(NSArray *))restorationHandler { | |
BOOL handledByBranch = [[Branch getInstance] continueUserActivity:userActivity]; | |
return handledByBranch; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[Branch getInstance] createDiscoverableContentWithTitle:@"MyApp" | |
description:@"My app is disrupting apps" | |
thumbnailUrl:[NSURL URLWithString:@"https://s3-us-west-1.amazonaws.com/branchhost/mosaic_og.png"] | |
linkParams:@{@"object_id": @"1234", | |
@"object_data": @"Here's some important deep link data"} | |
publiclyIndexable:YES]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[Branch getInstance] createDiscoverableContentWithTitle:@"MyApp" | |
description:@"My app is disrupting apps" | |
thumbnailUrl:[NSURL URLWithString:@"https://s3-us-west-1.amazonaws.com/branchhost/mosaic_og.png"] | |
linkParams:@{@"object_id": @"1234", | |
@"object_data": @"Here's some important deep link data"} | |
type:@"content/image" | |
publiclyIndexable:YES | |
keywords:[NSSet setWithObjects:@"apps", @"disruption", @"next_facebook", nil]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
Intent intent = getIntent(); | |
String action = intent.getAction(); | |
Uri data = intent.getData(); | |
if (data != null && data.isHierarchical()) { | |
Log.i(“MyApp”, “Received link click on URL: “ + intent.getDataString()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity ...> | |
<intent-filter android:autoVerify="true"> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<data android:scheme="http" android:host="yoursite.com" /> | |
<data android:scheme="https" android:host="yoursite.com" /> | |
</intent-filter> | |
</activity> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"relation": ["delegate_permission/common.handle_all_urls"], | |
"target": { | |
"namespace": "android_app", | |
"package_name": "io.branch.branchster", | |
"sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"] | |
} | |
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assetlinks = fs.readFileSync(__dirname + '/static/assetlinks.json'); | |
app.get('/.well-known/assetlinks.json', function(req, res, next) { | |
res.set('Content-Type', 'application/json'); | |
res.status(200).send(assetlinks); | |
}); |