Home

Awesome

SSPreferredBrowser

Circle CI

Quickly present available web browsers, save prefs, and perform common browser actions.

SSPreferredBrowser makes it easy to build a table like this:

SSPreferredBrowser can also open URLs in the user's preferred browser and provides localized names for browsers installed on the user's device.

SSPreferredBrowser is powered by SSAppURLs, a nifty way to check for and open iOS URL schemes.

SSPreferredBrowser powers browser selection 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 'SSPreferredBrowser', :head # YOLO

Example

Check out Example for the source code of the table in the screenshot above.

// If the user prefers to use an external browser over an in-app webview,
// then open a URL in the user's preferred browser
if( [SSPreferredBrowser shouldOpenURLsExternally] ) {
    // The user's preferred browser name, localized. 
    // Something like "Chrome" or "Opera Mini"
    NSLog(@"Opening a URL in %@!", [SSPreferredBrowser preferredBrowserName]);

    [SSPreferredBrowser openURLInPreferredBrowser:@"http://www.splinesoft.net"];
} else {
	// Open an in-app webview
}

Browsers

SSPreferredBrowser supports Safari, Chrome, Opera Mini, and 1Password.

New browsers and localizations are welcome!

Thanks!

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