Coder Social home page Coder Social logo

augmify / ios-deeplink-sdk Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 569 KB

A splendid route-matching, block-based way to handle your deep links.

Home Page: http://www.usebutton.com/sdk/deep-links

License: MIT License

Ruby 3.88% Objective-C 96.12%

ios-deeplink-sdk's Introduction

DeepLink SDK

CI Status Version License Platform

Overview

The Button DeepLink SDK is a splendid route-matching, block-based way to handle your deep links. Rather than decide how to format your URLs, parse them, pass data, and navigate to specific content or perform actions, this SDK and a few lines of code will get you on your way.

Full Documentation

Usage

Add deep link support to your app in 5 minutes or less following these simple steps.

#####1. Make sure you have a URL scheme registered for your app in your Info.plist:


#####2. Create an instance of `DPLDeepLinkRouter` in `application:didFinishLaunchingWithOptions:`
self.router = [[DPLDeepLinkRouter alloc] init];

#####3. Register a route handler:
self.router[@"log/:message"] = ^(DPLDeepLink *link) {
    NSLog(@"%@", link.routeParameters[@"message"]);
};

#####4. Pass incoming URLs to the router:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    self.router = [[DPLDeepLinkRouter alloc] init];
    self.router[@"log/:message"] = ^(DPLDeepLink *link) {
        NSLog(@"%@", link.routeParameters[@"message"]);
    };

    NSURL *incomingURL = launchOptions[UIApplicationLaunchOptionsURLKey];
    [self.router handleURL:incomingURL withCompletion:NULL];

    return YES;
}


- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

  [self.router handleURL:url withCompletion:NULL];
}

Learn more about the DeepLinkSDK by reading our Integration Guide.

Examples

To run the example project, clone the repo, and run pod install from the Example directory first.

There are two demo apps, SenderDemo, and ReceiverDemo. ReceiverDemo has some registered routes that will handle specific deep links. SenderDemo has a couple actions that will deep link out to ReceiverDemo for fulfillment.

Run theSenderDemo 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.

Installation

DeepLinkSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DeepLinkSDK"

Authors

Wes Smith
Chris Maddern

License

DeepLinkSDK is available under the MIT license. See the LICENSE file for more info.

Contributing

We'd love to see your ideas for improving this library. The best way to contribute is by submitting a pull request. We'll do our best to respond to you as soon as possible. You can also submit a new Github issue if you find bugs or have questions. :octocat:

Please make sure to follow our general coding style and add test coverage for new features!

ios-deeplink-sdk's People

Contributors

chrismaddern avatar dkhamsing avatar wessmith avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.