Giter Site home page Giter Site logo

ssappurls's Introduction

SSAppURLs

Build Status

Quickly check for and open URLs using iOS app URL schemes.

SSAppURLs is a tiny UIApplication category that makes it easy to:

  • Check if the current device has an app installed (e.g. Skype)
  • Check if the current device has certain capabilities (e.g. Facetime)
  • Open an app with a URL scheme and pass some arguments

SSAppURLs, along with SSPreferredBrowser, powers various URL actions and open-in-browser behavior in my app MUDRammer - A Modern MUD Client for iPhone and iPad.

Install

Install with Cocoapods. Add to your Podfile:

pod 'SSAppURLs', :head # YOLO

Examples

Check out Example for an app example.

#import <UIApplication+SSAppURLs.h>

// Does the current device have skype installed?
BOOL deviceSupportsSkype = [[UIApplication sharedApplication] 
                             canOpenAppType:SSAppURLTypeSkype];

// If so, let's make a call!
if( deviceSupportsSkype )
  [[UIApplication sharedApplication] openAppType:SSAppURLTypeSkype 
                                       withValue:@"415-555-1212"];
  
// Does the current device have Chrome installed?
BOOL deviceHasChrome = [[UIApplication sharedApplication] 
                        canOpenAppType:SSAppURLTypeChromeHTTP];

// If so, open a website in chrome!
if( deviceHasChrome )
	[[UIApplication sharedApplication] openAppType:SSAppURLTypeChromeHTTP 
	                                     withValue:@"http://www.splinesoft.net"];
	                                     
// Check for an arbitrary scheme type
BOOL deviceHasTelnetApp = [[UIApplication sharedApplication] 
                           canOpenAppWithScheme:@"telnet"];

// Let's play NANVAENT!
if( deviceHasTelnetApp )
	[[UIApplication sharedApplication] openAppWithScheme:@"telnet"
	                                           withValue:@"nanvaent.org:23"];

Thanks!

SSAppURLs is a @jhersh production -- (electronic mail | @jhersh)

ssappurls's People

Contributors

jhersh avatar

Watchers

lionxing 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.