@@ -11,14 +11,16 @@ import {
1111 Text ,
1212 Linking ,
1313 Platform ,
14+ Dimensions ,
1415 Image ,
1516} from 'react-native'
1617import Button from 'react-native-button'
1718import * 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
2325export 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