diff --git a/ios/Dusken.xcodeproj/project.pbxproj b/ios/Dusken.xcodeproj/project.pbxproj index 709c59b..0860ef9 100644 --- a/ios/Dusken.xcodeproj/project.pbxproj +++ b/ios/Dusken.xcodeproj/project.pbxproj @@ -33,7 +33,7 @@ 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */; }; 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; }; 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; }; - 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; }; + 2D02E4C91E0B4AEC006451C7 /* libReact-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */; }; 2DCD954D1E0B4F2C00145EB5 /* DuskenTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* DuskenTests.m */; }; 3A4E389007344A43A8BDB119 /* Roboto.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D4F0955EA08E41F69EEE0DED /* Roboto.ttf */; }; 3E46ED82B1574BB598025413 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0A6DA7DAB38A43E2BF0FC37C /* EvilIcons.ttf */; }; @@ -44,13 +44,13 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 87E5B29D1F225BD50051F809 /* dnslogo.png in Resources */ = {isa = PBXBuildFile; fileRef = 87E5B29C1F225BD50051F809 /* dnslogo.png */; }; A8095F35E44E450894456405 /* Roboto_medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8CAEF677B8A643969E0294B7 /* Roboto_medium.ttf */; }; + ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; BC4320B37397434C9FD88090 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 12CD67F85B7649F48CC37FBF /* Entypo.ttf */; }; BDDF26DE3FAA43BCA790809A /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C559033577D34FACA86020C1 /* Octicons.ttf */; }; BFEDB977D7AA4DF1B645A99F /* rubicon-icon-font.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8509F756B1F0438A97C346F1 /* rubicon-icon-font.ttf */; }; C867C6D3ECB7499FA2F051D6 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E926661F17B94D69B50A0BA5 /* FontAwesome.ttf */; }; CC801D520E86402F9AF28660 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 390970DBF0FD44B0B4C8E2F0 /* Foundation.ttf */; }; D218B6D7605D4C17B6540D0B /* libReactNativeConfig.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 07B9F82FBB154C258C70E333 /* libReactNativeConfig.a */; }; - ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -243,6 +243,13 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; + 87371BF41F6F25C200915105 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = ADD01A681E09402E00F6D226; + remoteInfo = "RCTBlob-tvOS"; + }; 879C48E21F3A5BB9007436D3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0D8F73C46ADC4ABEBE691283 /* ReactNativeConfig.xcodeproj */; @@ -277,7 +284,7 @@ proxyType = 2; remoteGlobalIDString = 3D383D621EBD27B9005632C8; remoteInfo = "double-conversion-tvOS"; - }; + }; ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; @@ -322,12 +329,12 @@ 8509F756B1F0438A97C346F1 /* rubicon-icon-font.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "rubicon-icon-font.ttf"; path = "../node_modules/native-base/Fonts/rubicon-icon-font.ttf"; sourceTree = ""; }; 87E5B29C1F225BD50051F809 /* dnslogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = dnslogo.png; path = Dusken/dnslogo.png; sourceTree = ""; }; 8CAEF677B8A643969E0294B7 /* Roboto_medium.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Roboto_medium.ttf; path = "../node_modules/native-base/Fonts/Roboto_medium.ttf"; sourceTree = ""; }; + ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; C02D46B0229941F69264474C /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = SimpleLineIcons.ttf; path = "../node_modules/native-base/Fonts/SimpleLineIcons.ttf"; sourceTree = ""; }; C559033577D34FACA86020C1 /* Octicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Octicons.ttf; path = "../node_modules/native-base/Fonts/Octicons.ttf"; sourceTree = ""; }; D4F0955EA08E41F69EEE0DED /* Roboto.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Roboto.ttf; path = "../node_modules/native-base/Fonts/Roboto.ttf"; sourceTree = ""; }; D7A0431FBA3840039633FC3C /* MaterialIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialIcons.ttf; path = "../node_modules/native-base/Fonts/MaterialIcons.ttf"; sourceTree = ""; }; E926661F17B94D69B50A0BA5 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/native-base/Fonts/FontAwesome.ttf"; sourceTree = ""; }; - ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -364,7 +371,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */, + 2D02E4C91E0B4AEC006451C7 /* libReact-tvOS.a in Frameworks */, 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */, 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */, 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */, @@ -481,7 +488,6 @@ isa = PBXGroup; children = ( 146834041AC3E56700842450 /* libReact.a */, - 3DAD3EA31DF850E9000B6D8A /* libReact.a */, 3DAD3EA51DF850E9000B6D8A /* libyoga.a */, 3DAD3EA71DF850E9000B6D8A /* libyoga.a */, 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */, @@ -576,14 +582,6 @@ ); name = Products; sourceTree = ""; - }; - ADBDB9201DFEBF0600ED6528 /* Products */ = { - isa = PBXGroup; - children = ( - ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */, - ); - name = Products; - sourceTree = ""; }; 95AA103233A74A28A47B99B8 /* Resources */ = { isa = PBXGroup; @@ -604,6 +602,15 @@ name = Resources; sourceTree = ""; }; + ADBDB9201DFEBF0600ED6528 /* Products */ = { + isa = PBXGroup; + children = ( + ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */, + 87371BF51F6F25C200915105 /* libRCTBlob-tvOS.a */, + ); + name = Products; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -957,6 +964,13 @@ remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 87371BF51F6F25C200915105 /* libRCTBlob-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTBlob-tvOS.a"; + remoteRef = 87371BF41F6F25C200915105 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 879C48E31F3A5BB9007436D3 /* libReactNativeConfig.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; diff --git a/ios/Dusken/Info.plist b/ios/Dusken/Info.plist index 3eaac76..3cfb82b 100644 --- a/ios/Dusken/Info.plist +++ b/ios/Dusken/Info.plist @@ -17,13 +17,14 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.1.0 + 1.1.1 CFBundleSignature ???? CFBundleVersion - 5 + 6 LSApplicationQueriesSchemes + comgooglemaps fb instagram diff --git a/src/modules/about/About.js b/src/modules/about/About.js index de9c348..2688bef 100644 --- a/src/modules/about/About.js +++ b/src/modules/about/About.js @@ -11,7 +11,10 @@ export default class About extends Component { openFacebook() { /* Ref: https://stackoverflow.com/questions/4810803/open-facebook-page-from-android-app */ - const url = 'fb://page/23664032291/'; + const url = Platform.select({ + ios: 'fb://page/?id=23664032291', + android: 'fb://page/23664032291/' + }); Linking.canOpenURL(url).then(supported => { if (!supported) { return Linking.openURL('https://www.facebook.com/studentersamfundet/'); @@ -36,6 +39,20 @@ export default class About extends Component { }).catch(err => console.error('An error occurred', err)); } + openMap() { + const url = Platform.select({ + ios: `comgooglemaps://?q=${CHATEAU_NEUF_ADDRESS}`, + android: `https://www.google.com/maps/search/?api=1&query=${CHATEAU_NEUF_ADDRESS}` + }); + Linking.canOpenURL(url).then(supported => { + if (!supported) { + return Linking.openURL(`https://www.google.com/maps/search/?api=1&query=${CHATEAU_NEUF_ADDRESS}`); + } else { + return Linking.openURL(url); + } + }).catch(err => console.error('An error occurred', err)); + } + render() { return ( @@ -57,7 +74,7 @@ export default class About extends Component { Adresse Det Norske Studentersamfund{"\n"}Slemdalsveien 15, 0369 Oslo - diff --git a/src/modules/events/EventDetail.js b/src/modules/events/EventDetail.js index e6b204c..e205799 100644 --- a/src/modules/events/EventDetail.js +++ b/src/modules/events/EventDetail.js @@ -73,9 +73,30 @@ export default class EventDetail extends Component { return text; } - onUrlPress(link) { + onTicketUrlPress(link) { Linking.openURL(link); } + + onFacebookUrlPress(link) { + const fbEventPattern = /https?:\/\/www\.facebook\.com\/events\/(\d+)\/?/i; + const matches = fbEventPattern.exec(link); + let iosURL = link; + if( matches.length ) { + iosURL = 'fb://event/?id=' + matches[1]; + } + const url = Platform.select({ + ios: iosURL, + android: link + }); + Linking.canOpenURL(url).then(supported => { + if (!supported) { + return Linking.openURL(link); + } else { + return Linking.openURL(url); + } + }).catch(err => console.error('An error occurred', err)); + } + onLocationPress(venue) { if( venue !== 'Annetsteds' ) { Linking.openURL(`https://www.google.com/maps/dir/?api=1&destination=${CHATEAU_NEUF_ADDRESS}`); @@ -92,7 +113,7 @@ export default class EventDetail extends Component { if(item.ticket_url) { return ( - this.onUrlPress(item.ticket_url)}> + this.onTicketUrlPress(item.ticket_url)}> {text} @@ -116,7 +137,7 @@ export default class EventDetail extends Component { if (!item.facebook_url) { return;} return ( - this.onUrlPress(item.facebook_url)} style={styles.metaInner}> + this.onFacebookUrlPress(item.facebook_url)} style={styles.metaInner}> På Facebook