Skip to content

Commit 40702e7

Browse files
committed
Add android app link to google play
1 parent 9909bd4 commit 40702e7

File tree

9 files changed

+36
-18
lines changed

9 files changed

+36
-18
lines changed

android/capawesome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": 16
2+
"version": 17
33
}

backend/api/src/create-notification.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ import {Notification} from 'common/notifications'
33
import {insertNotificationToSupabase} from 'shared/supabase/notifications'
44
import {tryCatch} from "common/util/try-catch";
55
import {Row} from "common/supabase/utils";
6+
import {ANDROID_APP_URL} from "common/constants";
7+
8+
export const createAndroidReleaseNotifications = async () => {
9+
const createdTime = Date.now();
10+
const id = `android-release-${createdTime}`
11+
const notification: Notification = {
12+
id,
13+
userId: 'todo',
14+
createdTime: createdTime,
15+
isSeen: false,
16+
sourceType: 'info',
17+
sourceUpdateType: 'created',
18+
sourceSlug: ANDROID_APP_URL,
19+
sourceUserAvatarUrl: 'https://firebasestorage.googleapis.com/v0/b/compass-130ba.firebasestorage.app/o/misc%2Fcompass-192.png?alt=media&token=9fd251c5-fc43-4375-b629-1a8f4bbe8185',
20+
title: 'Android App Released on Google Play',
21+
sourceText: 'The Compass Android app is now publicly available on Google Play! Download it today to stay connected on the go.',
22+
}
23+
return await createNotifications(notification)
24+
}
625

726
export const createAndroidTestNotifications = async () => {
827
const createdTime = Date.now();

common/src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const stoatLink = "https://stt.gg/YKQp81yA"
1717
export const redditLink = "https://www.reddit.com/r/CompassConnect"
1818
export const xLink = "https://x.com/compassmeet"
1919
export const formLink = "https://forms.gle/tKnXUMAbEreMK6FC6"
20+
export const ANDROID_APP_URL = 'https://play.google.com/store/apps/details?id=com.compassconnections.app'
2021

2122
export const IS_MAINTENANCE = false // set to true to enable the maintenance mode banner
2223

web/components/contact.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ export function ContactComponent() {
2929
You can also contact us through this <Link href={formLink}>feedback form</Link> or any of our <Link
3030
href={'/social'}>socials</Link>. Feel free to give your contact information if you'd like us to get back to you.
3131
</p>
32-
<h4 className="">Android App</h4>
33-
<p className={'custom-link mb-4'}>
34-
To release our app, Google requires a closed test with at least 12 testers for 14 days. Please share your Google Play–registered email address so we can add you as a tester.
35-
You'll be able to download the app from the Play Store and use it right away.
36-
Your email address will NOT be shared with anyone else and will be used solely for the purpose of the review process.
37-
</p>
3832
<Col>
3933
<div className={'mb-2'}>
4034
<TextEditor

web/components/nav/sidebar.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {Button, ColorType, SizeType} from 'web/components/buttons/button'
1212
import {signupRedirect} from 'web/lib/util/signup'
1313
import {useProfile} from 'web/hooks/use-profile'
1414
import Image from 'next/image'
15+
import {ANDROID_APP_URL} from "common/constants";
16+
import {isAndroidApp} from "web/lib/util/webview";
1517

1618
export default function Sidebar(props: {
1719
className?: string
@@ -29,6 +31,8 @@ export default function Sidebar(props: {
2931

3032
const bottomNavOptions = bottomNav(!!user)
3133

34+
const isAndroid = isAndroidApp()
35+
3236
return (
3337
<nav
3438
aria-label="Sidebar"
@@ -47,14 +51,14 @@ export default function Sidebar(props: {
4751
{navOptions.map((item) => (
4852
<SidebarItem key={item.name} item={item} currentPage={currentPage}/>
4953
))}
50-
<Image
54+
{!isAndroid && <Image
5155
src="https://firebasestorage.googleapis.com/v0/b/compass-130ba.firebasestorage.app/o/misc%2FGoogle_Play_Store_badge_EN.svg.png?alt=media&token=3e0e8605-800a-422b-84d1-8ecec8af3e80"
5256
alt="divider"
5357
width={160}
5458
height={80}
5559
className="mx-auto pt-4 hover:opacity-70 cursor-pointer invert dark:invert-0"
56-
onClick={() => router.push('/contact')}
57-
/>
60+
onClick={() => router.push(ANDROID_APP_URL)}
61+
/>}
5862

5963
{user === null && <SignUpButton className="mt-4" text="Sign up"/>}
6064
{/*{user === null && <SignUpAsMatchmaker className="mt-2" />}*/}

web/lib/firebase/users.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {getAuth, GoogleAuthProvider, signInWithCredential, signInWithPopup, conn
66
import {safeLocalStorage} from '../util/local'
77
import {app} from './init'
88
import {GOOGLE_CLIENT_ID} from "common/constants"
9-
import {isAndroidWebView} from "web/lib/util/webview"
9+
import {isAndroidApp} from "web/lib/util/webview"
1010
import {SocialLogin} from "@capgo/capacitor-social-login"
1111
import {Capacitor} from "@capacitor/core"
1212
import {IS_FIREBASE_EMULATOR} from "common/envs/constants"
@@ -113,7 +113,7 @@ export async function googleNativeLogin() {
113113
}
114114

115115
export async function firebaseLogin() {
116-
if (isAndroidWebView()) {
116+
if (isAndroidApp()) {
117117
console.log('Running in APK')
118118
return await googleNativeLogin()
119119
}

web/lib/service/android-push.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import {PushNotifications} from '@capacitor/push-notifications'
22
import {useEffect} from "react"
33
import {api} from "web/lib/api"
44
import {useUser} from "web/hooks/use-user"
5-
import {isAndroidWebView} from "web/lib/util/webview";
5+
import {isAndroidApp} from "web/lib/util/webview";
66
import {useRouter} from "next/router";
77

88
export default function AndroidPush() {
99
const user = useUser() // authenticated user
10-
const isAndroid = isAndroidWebView()
10+
const isAndroid = isAndroidApp()
1111
const router = useRouter()
1212
useEffect(() => {
1313
if (!user?.id || !isAndroid) return

web/lib/util/webview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {Capacitor} from "@capacitor/core";
22
import {IS_WEBVIEW} from "common/hosting/constants";
33

4-
export function isAndroidWebView() {
4+
export function isAndroidApp() {
55
try {
66
// Detect if Android bridge exists
77
// return typeof (window as any).AndroidBridge?.isNativeApp === 'function';
@@ -11,4 +11,4 @@ export function isAndroidWebView() {
1111
}
1212
}
1313

14-
export function isNativeMobile() { return isAndroidWebView() }
14+
export function isNativeMobile() { return isAndroidApp() }

web/pages/_app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import clsx from 'clsx'
1212
import {initTracking} from 'web/lib/service/analytics'
1313
import WebPush from "web/lib/service/web-push"
1414
import AndroidPush from "web/lib/service/android-push"
15-
import {isAndroidWebView} from "web/lib/util/webview"
15+
import {isAndroidApp} from "web/lib/util/webview"
1616
import {Capacitor} from '@capacitor/core'
1717
import {StatusBar} from '@capacitor/status-bar'
1818
import {App} from '@capacitor/app'
@@ -91,7 +91,7 @@ function MyApp({Component, pageProps}: AppProps<PageProps>) {
9191
const router = useRouter()
9292

9393
useEffect(() => {
94-
console.log('isAndroidWebView app:', isAndroidWebView())
94+
console.log('isAndroidWebView app:', isAndroidApp())
9595
if (!Capacitor.isNativePlatform()) return
9696
const onShow = () => document.body.classList.add('keyboard-open')
9797
const onHide = () => document.body.classList.remove('keyboard-open')

0 commit comments

Comments
 (0)