Open Twitch via custom URL scheme

This commit is contained in:
Davide De Rosa 2020-10-26 18:02:33 +01:00
parent c38db995ff
commit dce17dfa88
4 changed files with 19 additions and 3 deletions

View File

@ -34,6 +34,17 @@
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.12.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLSchemes</key>
<array>
<string>twitch</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>ITSAppUsesNonExemptEncryption</key>

View File

@ -189,7 +189,12 @@ class OrganizerViewController: UITableViewController, StrongTableHost {
// MARK: Actions
private func followOnTwitch() {
UIApplication.shared.open(AppConstants.URLs.twitch, options: [:], completionHandler: nil)
let app = UIApplication.shared
if app.canOpenURL(AppConstants.URLs.twitch) {
app.open(AppConstants.URLs.twitch, options: [:], completionHandler: nil)
} else {
app.open(AppConstants.URLs.twitchFallback, options: [:], completionHandler: nil)
}
}
private func enterProfile(_ profile: ConnectionProfile) {

View File

@ -92,4 +92,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 318a10ca02bd2f890a96f90de37f4f04ac9f80f4
COCOAPODS: 1.9.3
COCOAPODS: 1.10.0

@ -1 +1 @@
Subproject commit 63b96cb3a33ba940bc5c109e4de3ed239f2f964b
Subproject commit 574990674f07e4dbab9ce9ca829122b9b82a5077