Skip to content

Commit 8839a89

Browse files
committed
Added linking to KSTO url scheme
Adjusted a few styles and added logic to open either KSTO or the App Store
1 parent 274d50b commit 8839a89

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

ios/AllAboutOlaf/Info.plist

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>LSApplicationQueriesSchemes</key>
6+
<array>
7+
<string>KSTORadio</string>
8+
</array>
59
<key>CFBundleDevelopmentRegion</key>
610
<string>en</string>
711
<key>CFBundleExecutable</key>
@@ -18,6 +22,19 @@
1822
<string>1.0</string>
1923
<key>CFBundleSignature</key>
2024
<string>????</string>
25+
<key>CFBundleURLTypes</key>
26+
<array>
27+
<dict>
28+
<key>CFBundleTypeRole</key>
29+
<string>Editor</string>
30+
<key>CFBundleURLName</key>
31+
<string>NFMTHAZVS9.com.drewvolz.stolaf</string>
32+
<key>CFBundleURLSchemes</key>
33+
<array>
34+
<string>AllAboutOlaf</string>
35+
</array>
36+
</dict>
37+
</array>
2138
<key>CFBundleVersion</key>
2239
<string>1</string>
2340
<key>LSRequiresIPhoneOS</key>

views/streaming/radio.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ import {
1111
Text,
1212
Linking,
1313
Platform,
14+
Dimensions,
1415
Image,
1516
} from 'react-native'
1617
import Button from 'react-native-button'
1718
import * as c from '../components/colors'
18-
// let kstoDownload = 'itms://itunes.apple.com/us/app/ksto/id953916647'
1919

20-
const url = 'http://elijahverdoorn.com' // For Drew Volz to update
21-
const image = require('../../data/images/streaming/ksto/ksto-logo.png')
20+
let kstoApp = 'KSTORadio://'
21+
let kstoDownload = 'itms://itunes.apple.com/us/app/ksto/id953916647'
22+
let kstoWeb = 'https://www.stolaf.edu/multimedia/play/embed/ksto.html'
23+
let image = require('../../data/images/streaming/ksto/ksto-logo.png')
2224

2325
export default function KSTOView() {
2426
return (
@@ -29,9 +31,15 @@ export default function KSTOView() {
2931
<Button
3032
onPress={() => {
3133
if (Platform.OS === 'android') {
32-
Linking.openURL(url).catch(err => console.error('An error occurred', err))
34+
Linking.openURL(kstoWeb).catch(err => console.error('An error occurred opening the Android KSTO url', err))
3335
} else {
34-
//Drew does stuff here
36+
Linking.canOpenURL(kstoApp).then(supported => {
37+
if (!supported) {
38+
Linking.openURL(kstoDownload).catch(err => console.error('An error occurred opening the KSTO download url', err))
39+
} else {
40+
return Linking.openURL(kstoApp)
41+
}
42+
}).catch(err => console.error('An error occurred opening the iOS KSTO url', err))
3543
}
3644
}}
3745
style={styles.button}
@@ -56,8 +64,8 @@ let styles = StyleSheet.create({
5664
marginTop: 5,
5765
},
5866
logo: {
59-
width: 300,
60-
height: 300,
67+
maxWidth: Dimensions.get('window').width / 1.2,
68+
maxHeight: Dimensions.get('window').height / 2,
6169
},
6270
button: {
6371
backgroundColor: c.denim,

0 commit comments

Comments
 (0)