From c0ca8b91c346f6ba0e62f425651f93bad29a0c05 Mon Sep 17 00:00:00 2001 From: Wes Smith Date: Wed, 13 May 2015 17:39:48 -0400 Subject: [PATCH 1/2] add AppLinks example to readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 68a2d79..aab9c24 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,10 @@ router[@"scheme-one://timeline"] = ^{ … } router[@"scheme-two://timeline"] = ^{ … } ``` +## AppLinks Support + +Does you app support AppLinks? You can easily handle incoming AppLinks by importing the AppLinks category `DPLDeepLink+AppLinks`. The AppLinks category provides convenience accessors to all AppLinks 1.0 properties. + ## Running the Demo To run the example project, run `pod try DeepLinkSDK` in your terminal. You can also clone the repo, and run `pod install` from the project root. If you don't have CocoaPods, begin by [follow this guide](http://guides.cocoapods.org/using/getting-started.html). From 98da165f1cbc6ee794e0ed6a499daf58db144f2b Mon Sep 17 00:00:00 2001 From: Wes Smith Date: Wed, 13 May 2015 18:39:13 -0400 Subject: [PATCH 2/2] add mutable del link example to readme --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/README.md b/README.md index aab9c24..212a1ec 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,13 @@ router[@"scheme-two://timeline"] = ^{ … } Does you app support AppLinks? You can easily handle incoming AppLinks by importing the AppLinks category `DPLDeepLink+AppLinks`. The AppLinks category provides convenience accessors to all AppLinks 1.0 properties. +```objc +router[@"/timeline"] = ^(DPLDeepLink *link) { + NSURL *referrerURL = link.referralURL; + NSString *someValue = link.extras[@"some-key"]; +} +``` + ## Running the Demo To run the example project, run `pod try DeepLinkSDK` in your terminal. You can also clone the repo, and run `pod install` from the project root. If you don't have CocoaPods, begin by [follow this guide](http://guides.cocoapods.org/using/getting-started.html). @@ -134,6 +141,48 @@ There are two demo apps, `SenderDemo`, and `ReceiverDemo`. `ReceiverDemo` has so Run the`SenderDemo` build scheme first, then stop the simulator and switch the build scheme to `ReceiverDemo` and run again. Now you can switch back to the `SenderDemo` app in the simulator and tap on one of the actions. + +## Creating Deep Links + +You can also create deep links with `DPLMutableDeepLink`. Between two `DeepLinkKit` integrated apps, you can pass complex objects via deep link from one app to another app and easily get that object back on the other end. + +In the first app: + +```objc + +NSMutableDeepLink *link = [[NSMutableDeepLink alloc] initWithString:@"app-two://categories"]; +link[@"brew-types"] = @[@"Ale", @"Lager", @"Stout", @"Wheat"] +link[@"beers"] = @{ + @"ales": @[ + @{ + @"name": @"Southern Tier Pumking Ale", + @"price": @799 + }, + @{ + @"name": @"Sierra Nevada Celebration Ale", + @"price": @799 + } + ], + @"lagers": @[ + ... + ], + ... +} + +[[UIApplication sharedApplication] openURL:link.URL]; + +``` + +In the second app: + +```objc +router[@"categories"] = ^(DPLDeepLink *link) { + NSArray *brewTypes = link[@"brew-types"]; + NSDictionary *beers = link[@"beers"]; +} +``` + + ## Authors [Wes Smith](http://twitter.com/w5mith)