Freedom
The Freedom to Open URLs in Third-Party Browsers on iOS with Custom UIActivity Subclasses.
Install / Use
/learn @ArtSabintsev/FreedomREADME
Freedom 🦅
The Freedom to Open URLs in Third-Party Browsers on iOS with Custom UIActivity Subclasses.
About
Freedom enables your app to open URLs in third-party browsers that your users have installed on their device.
Currently Supported
- Brave Browser
- Dolphin Web Browser
- Firefox Web Browser
- Firefox Focus Web Browser
- Google Chrome
- Safari
Screenshot
<img src="https://github.com/ArtSabintsev/Freedom/blob/master/screenshot.png?raw=true" height="480">Installation Instructions
| Swift Version | Branch Name | Will Continue to Receive Updates? | ------------- | ------------- | ------------- | 5.1+ | master | Yes | 5.0 | swift5.0 | No | 4.2 | swift4.2 | No | 3.2 | swift4.1 | No | 3.2 | swift3.2 | No | 3.1 | swift3.1 | No
CocoaPods
pod 'Freedom' # Swift 5.1+
pod 'Freedom', :git => 'https://github.com/ArtSabintsev/Freedom.git', :branch => 'swift5.0' # Swift 5.0
pod 'Freedom', :git => 'https://github.com/ArtSabintsev/Freedom.git', :branch => 'swift4.2' # Swift 4.2
pod 'Freedom', :git => 'https://github.com/ArtSabintsev/Freedom.git', :branch => 'swift4.1' # Swift 4.1
pod 'Freedom', :git => 'https://github.com/ArtSabintsev/Freedom.git', :branch => 'swift3.2' # Swift 3.2
pod 'Freedom', :git => 'https://github.com/ArtSabintsev/Freedom.git', :branch => 'swift3.1' # Swift 3.1
Carthage
github "ArtSabintsev/Freedom" // Swift 5.1+
github "ArtSabintsev/Freedom", "swift5.0" // Swift 5.0
github "ArtSabintsev/Freedom", "swift4.2" // Swift 4.2
github "ArtSabintsev/Freedom", "swift4.1" // Swift 4.1
github "ArtSabintsev/Freedom", "swift3.2" // Swift 3.2
github "ArtSabintsev/Freedom", "swift3.1" // Swift 3.1
Swift Package Manager
.Package(url: "https://github.com/ArtSabintsev/Freedom.git", majorVersion: 2)
Usage
Open your Info.plist file, and add the following URL schemes to the LSApplicationQueriesSchemes key:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>brave</string>
<string>dolphin</string>
<string>firefox</string>
<string>firefox-focus</string>
<string>googlechrome</string>
</array>
Add the following code to some actionable/tappable element in your project. In this example, I am using an IBAction from a UIButton.
@IBAction func openURL(_ sender: UIButton) {
// A Sample URL that just happens to be my personal website.
let url = URL(string: "http://www.sabintsev.com")!
// Enable Debug Logs (disabled by default)
Freedom.debugEnabled = true
// Fetch activities for Safari and all third-party browsers supported by Freedom (see screenshot).
let activities = Freedom.browsers()
// Alternatively, one could select a specific browser (or browsers).
// let activities = Freedom.browsers([.chrome])
let vc = UIActivityViewController(activityItems: [url], applicationActivities: activities)
present(vc, animated: true, completion: nil)
}
Notes
Even if you enable Freedom to support all browsers via Freedom.browsers(), only the browsers installed on your users device will be visible to the them in the share sheet (i.e., UIActivityViewController). Therefore, it is beneficial to all of your users to initialize Freedom with all supported browsers.
Created and maintained by
Related Skills
node-connect
351.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
