diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 488a750..70425d7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -83,15 +83,16 @@ jobs: - name: Bump version run: npx standard-version --no-verify --release-as minor + - name: Update dev branch + run: | + git fetch --all --unshallow + git stash + git checkout dev + git merge main + git push + - name: Push version bump run: git push --follow-tags - name: Build on EAS run: eas build --profile production --platform all --non-interactive --no-wait --auto-submit - - - name: Update dev branch - run: | - git fetch --all - git checkout dev - git merge --no-ff main - git push diff --git a/app.json b/app.json index ac2bf24..2ddda13 100644 --- a/app.json +++ b/app.json @@ -6,7 +6,7 @@ "owner": "viniciusmoreria", "privacy": "public", "primaryColor": "#16171B", - "version": "2.4.1", + "version": "2.6.0", "orientation": "portrait", "icon": "./src/assets/icon.png", "backgroundColor": "#16171B", @@ -24,7 +24,7 @@ "supportsTablet": true, "bundleIdentifier": "com.viniciusmoreria.liftoff", "googleServicesFile": "./src/libs/firebase/GoogleService-Info.plist", - "buildNumber": "2.4.1", + "buildNumber": "2.6.0", "config": { "usesNonExemptEncryption": false }, @@ -41,7 +41,7 @@ "package": "com.viniciusmoreria.liftoff", "playStoreUrl": "https://play.google.com/store/apps/details?id=com.viniciusmoreria.liftoff", "googleServicesFile": "./src/libs/firebase/google-services.json", - "versionCode": 460020401 + "versionCode": 460020600 }, "notification": { "icon": "./src/assets/push-icon.png", @@ -61,7 +61,9 @@ "expo-build-properties", { "android": { - "extraProguardRules": "-keep class com.google.android.gms.internal.consent_sdk.** { *; }" + "extraProguardRules": "-keep class com.google.android.gms.internal.consent_sdk.** { *; }", + "compileSdkVersion": 33, + "targetSdkVersion": 33 } } ], diff --git a/src/features/launch-detail/launch-detail-screen.tsx b/src/features/launch-detail/launch-detail-screen.tsx index 8b6ce7d..2a41bd4 100644 --- a/src/features/launch-detail/launch-detail-screen.tsx +++ b/src/features/launch-detail/launch-detail-screen.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Alert, Pressable, Text, View } from 'react-native'; +import { Alert, Pressable, Share, Text, View } from 'react-native'; import { Container } from '@components/container'; import { Ionicons } from '@expo/vector-icons'; @@ -16,15 +16,15 @@ import { RootStackParams } from '@navigation/types'; import { RouteProp, useRoute } from '@react-navigation/native'; // import { NativeStackScreenProps } from '@react-navigation/native-stack'; import { format } from 'date-fns'; +import * as Application from 'expo-application'; import * as WebBrowser from 'expo-web-browser'; import { Skeleton } from 'moti/skeleton'; import FastImage from 'react-native-fast-image'; import YoutubePlayer from 'react-native-youtube-iframe'; -// import { LaunchArticles } from './components/launch-articles'; import { LocationMap } from './components/location-map'; -// type Props = NativeStackScreenProps; +// import { LaunchArticles } from './components/launch-articles'; export const LaunchDetailScreen = () => { const { params } = useRoute>(); @@ -59,6 +59,30 @@ export const LaunchDetailScreen = () => { ]); }; + const onShareLaunchButtonTap = async () => { + logEvent('share_launch', { launch: launch.name }); + + const shareURL = launch?.vidURLs[0]?.url ? `\n\n${launch?.vidURLs[0]?.url}` : ''; + const location = launch?.pad?.location?.name + ? `\n\nLocation: ${launch?.pad?.location?.name}\n\n` + : ''; + + const message = `${launch.name} on ${format(new Date(launch.net), 'MMM d, yyyy')} at ${format( + new Date(launch.net), + 'HH:mm O' + )}${shareURL}${location}${ + launch?.mission?.description || '' + }\n\nDownload Liftoff for Android: https://play.google.com/store/apps/details?id=${ + Application.applicationId + } + `; + + await Share.share({ + title: 'Liftoff - Rocket Launch Tracker', + message: message, + }); + }; + return ( @@ -135,6 +159,13 @@ export const LaunchDetailScreen = () => { )} + + Share this launch + + {launch.mission && (