mirror of
https://github.com/CompassConnections/Compass.git
synced 2025-12-23 14:09:05 -05:00
Add android app link to google play
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": 16
|
||||
"version": 17
|
||||
}
|
||||
@@ -3,6 +3,25 @@ import {Notification} from 'common/notifications'
|
||||
import {insertNotificationToSupabase} from 'shared/supabase/notifications'
|
||||
import {tryCatch} from "common/util/try-catch";
|
||||
import {Row} from "common/supabase/utils";
|
||||
import {ANDROID_APP_URL} from "common/constants";
|
||||
|
||||
export const createAndroidReleaseNotifications = async () => {
|
||||
const createdTime = Date.now();
|
||||
const id = `android-release-${createdTime}`
|
||||
const notification: Notification = {
|
||||
id,
|
||||
userId: 'todo',
|
||||
createdTime: createdTime,
|
||||
isSeen: false,
|
||||
sourceType: 'info',
|
||||
sourceUpdateType: 'created',
|
||||
sourceSlug: ANDROID_APP_URL,
|
||||
sourceUserAvatarUrl: 'https://firebasestorage.googleapis.com/v0/b/compass-130ba.firebasestorage.app/o/misc%2Fcompass-192.png?alt=media&token=9fd251c5-fc43-4375-b629-1a8f4bbe8185',
|
||||
title: 'Android App Released on Google Play',
|
||||
sourceText: 'The Compass Android app is now publicly available on Google Play! Download it today to stay connected on the go.',
|
||||
}
|
||||
return await createNotifications(notification)
|
||||
}
|
||||
|
||||
export const createAndroidTestNotifications = async () => {
|
||||
const createdTime = Date.now();
|
||||
|
||||
@@ -17,6 +17,7 @@ export const stoatLink = "https://stt.gg/YKQp81yA"
|
||||
export const redditLink = "https://www.reddit.com/r/CompassConnect"
|
||||
export const xLink = "https://x.com/compassmeet"
|
||||
export const formLink = "https://forms.gle/tKnXUMAbEreMK6FC6"
|
||||
export const ANDROID_APP_URL = 'https://play.google.com/store/apps/details?id=com.compassconnections.app'
|
||||
|
||||
export const IS_MAINTENANCE = false // set to true to enable the maintenance mode banner
|
||||
|
||||
|
||||
@@ -29,12 +29,6 @@ export function ContactComponent() {
|
||||
You can also contact us through this <Link href={formLink}>feedback form</Link> or any of our <Link
|
||||
href={'/social'}>socials</Link>. Feel free to give your contact information if you'd like us to get back to you.
|
||||
</p>
|
||||
<h4 className="">Android App</h4>
|
||||
<p className={'custom-link mb-4'}>
|
||||
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.
|
||||
You'll be able to download the app from the Play Store and use it right away.
|
||||
Your email address will NOT be shared with anyone else and will be used solely for the purpose of the review process.
|
||||
</p>
|
||||
<Col>
|
||||
<div className={'mb-2'}>
|
||||
<TextEditor
|
||||
|
||||
@@ -12,6 +12,8 @@ import {Button, ColorType, SizeType} from 'web/components/buttons/button'
|
||||
import {signupRedirect} from 'web/lib/util/signup'
|
||||
import {useProfile} from 'web/hooks/use-profile'
|
||||
import Image from 'next/image'
|
||||
import {ANDROID_APP_URL} from "common/constants";
|
||||
import {isAndroidApp} from "web/lib/util/webview";
|
||||
|
||||
export default function Sidebar(props: {
|
||||
className?: string
|
||||
@@ -29,6 +31,8 @@ export default function Sidebar(props: {
|
||||
|
||||
const bottomNavOptions = bottomNav(!!user)
|
||||
|
||||
const isAndroid = isAndroidApp()
|
||||
|
||||
return (
|
||||
<nav
|
||||
aria-label="Sidebar"
|
||||
@@ -47,14 +51,14 @@ export default function Sidebar(props: {
|
||||
{navOptions.map((item) => (
|
||||
<SidebarItem key={item.name} item={item} currentPage={currentPage}/>
|
||||
))}
|
||||
<Image
|
||||
{!isAndroid && <Image
|
||||
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"
|
||||
alt="divider"
|
||||
width={160}
|
||||
height={80}
|
||||
className="mx-auto pt-4 hover:opacity-70 cursor-pointer invert dark:invert-0"
|
||||
onClick={() => router.push('/contact')}
|
||||
/>
|
||||
onClick={() => router.push(ANDROID_APP_URL)}
|
||||
/>}
|
||||
|
||||
{user === null && <SignUpButton className="mt-4" text="Sign up"/>}
|
||||
{/*{user === null && <SignUpAsMatchmaker className="mt-2" />}*/}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {getAuth, GoogleAuthProvider, signInWithCredential, signInWithPopup, conn
|
||||
import {safeLocalStorage} from '../util/local'
|
||||
import {app} from './init'
|
||||
import {GOOGLE_CLIENT_ID} from "common/constants"
|
||||
import {isAndroidWebView} from "web/lib/util/webview"
|
||||
import {isAndroidApp} from "web/lib/util/webview"
|
||||
import {SocialLogin} from "@capgo/capacitor-social-login"
|
||||
import {Capacitor} from "@capacitor/core"
|
||||
import {IS_FIREBASE_EMULATOR} from "common/envs/constants"
|
||||
@@ -113,7 +113,7 @@ export async function googleNativeLogin() {
|
||||
}
|
||||
|
||||
export async function firebaseLogin() {
|
||||
if (isAndroidWebView()) {
|
||||
if (isAndroidApp()) {
|
||||
console.log('Running in APK')
|
||||
return await googleNativeLogin()
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@ import {PushNotifications} from '@capacitor/push-notifications'
|
||||
import {useEffect} from "react"
|
||||
import {api} from "web/lib/api"
|
||||
import {useUser} from "web/hooks/use-user"
|
||||
import {isAndroidWebView} from "web/lib/util/webview";
|
||||
import {isAndroidApp} from "web/lib/util/webview";
|
||||
import {useRouter} from "next/router";
|
||||
|
||||
export default function AndroidPush() {
|
||||
const user = useUser() // authenticated user
|
||||
const isAndroid = isAndroidWebView()
|
||||
const isAndroid = isAndroidApp()
|
||||
const router = useRouter()
|
||||
useEffect(() => {
|
||||
if (!user?.id || !isAndroid) return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Capacitor} from "@capacitor/core";
|
||||
import {IS_WEBVIEW} from "common/hosting/constants";
|
||||
|
||||
export function isAndroidWebView() {
|
||||
export function isAndroidApp() {
|
||||
try {
|
||||
// Detect if Android bridge exists
|
||||
// return typeof (window as any).AndroidBridge?.isNativeApp === 'function';
|
||||
@@ -11,4 +11,4 @@ export function isAndroidWebView() {
|
||||
}
|
||||
}
|
||||
|
||||
export function isNativeMobile() { return isAndroidWebView() }
|
||||
export function isNativeMobile() { return isAndroidApp() }
|
||||
@@ -12,7 +12,7 @@ import clsx from 'clsx'
|
||||
import {initTracking} from 'web/lib/service/analytics'
|
||||
import WebPush from "web/lib/service/web-push"
|
||||
import AndroidPush from "web/lib/service/android-push"
|
||||
import {isAndroidWebView} from "web/lib/util/webview"
|
||||
import {isAndroidApp} from "web/lib/util/webview"
|
||||
import {Capacitor} from '@capacitor/core'
|
||||
import {StatusBar} from '@capacitor/status-bar'
|
||||
import {App} from '@capacitor/app'
|
||||
@@ -91,7 +91,7 @@ function MyApp({Component, pageProps}: AppProps<PageProps>) {
|
||||
const router = useRouter()
|
||||
|
||||
useEffect(() => {
|
||||
console.log('isAndroidWebView app:', isAndroidWebView())
|
||||
console.log('isAndroidWebView app:', isAndroidApp())
|
||||
if (!Capacitor.isNativePlatform()) return
|
||||
const onShow = () => document.body.classList.add('keyboard-open')
|
||||
const onHide = () => document.body.classList.remove('keyboard-open')
|
||||
|
||||
Reference in New Issue
Block a user