Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raxityo/browseractivity
Custom UIActivity implementations to show "Open in Safari", "Open in Chrome" and "Open in Firefox" options in the list of activities
https://github.com/raxityo/browseractivity
google-chrome ios safari swift
Last synced: 3 months ago
JSON representation
Custom UIActivity implementations to show "Open in Safari", "Open in Chrome" and "Open in Firefox" options in the list of activities
- Host: GitHub
- URL: https://github.com/raxityo/browseractivity
- Owner: raxityo
- License: mit
- Created: 2017-01-12T01:54:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-02T19:47:35.000Z (about 4 years ago)
- Last Synced: 2024-09-20T08:27:33.947Z (3 months ago)
- Topics: google-chrome, ios, safari, swift
- Language: Swift
- Homepage:
- Size: 479 KB
- Stars: 15
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BrowserActivity
Custom `UIActivity` implementations to show "Open in Safari", "Open in Chrome" and "Open in Firefox" options in the list of activities, implemented in Swift 5.3
## Usage:
```swift
let sharingURL = URL(string: "https://www.google.com/search?q=swift")
let activityViewController = UIActivityViewController(
activityItems: [sharingURL],
applicationActivities: BrowserActivity.compatibleActivities
)
present(activityViewController, animated: true, completion: nil)
```
#### Helper:
```
BrowserActivity.compatibleActivities
```
Returns an Array of `UIActivity` instances to open the given URL in Safari and/or Google Chrome (if Google Chrome is installed in the device).## Example:
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Installation:
- Swift Package Manager:
```
.package(url: "https://github.com/raxityo/BrowserActivity", from: "2.0.0"),
```## Update Info.plist:
Add/append `googlechrome`, `googlechromes` and `firefox` schemes in your `Info.plist` under `LSApplicationQueriesSchemes`.
```xml
LSApplicationQueriesSchemes
firefox
googlechrome
googlechromes
```## Author:
Raxit Majithiya ([@raxityo](https://twitter.com/raxityo))
## License:
BrowserActivity is available under the MIT license. See the LICENSE file for more info.