Skip to content

Instantly share code, notes, and snippets.

@bufordtaylor
Created February 6, 2015 21:26
Show Gist options
  • Save bufordtaylor/4439943438f73d4eff99 to your computer and use it in GitHub Desktop.
Save bufordtaylor/4439943438f73d4eff99 to your computer and use it in GitHub Desktop.

#Sample SDK integration

iOS SDK example

    // iOS example: Install the Shortcut SDK with pod
    
    override func viewDidLoad() {
      super.viewDidLoad()
      let shortcut = ShortcutApp.initWithEvent("12345", completion: completionBlock)
      shortcut.setMainColor("#fff")
      shortcut.setSecondaryColor("#000")
      navigationController?.pushViewController(shortcut, animated: true)
    }

Android SDK example

    // Android example: in build.gradle
    
    dependencies {
      ...
      compile 'com.shortcutapp.android:example-package'
    }
    
    // in activity
    
    ShortcutApp shortcutApp = new ShortcutApp("12345", {
      @Override void
      onCompletion()
      {
          // your code
      }
    });
    shortcutApp.setMainColor("#fff");
    shortcutApp.setSecondaryColor("#000");
    shortcutApp.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment