{t('loadFailed')}
diff --git a/apps/web/src/components/import/SplitwiseImport.tsx b/apps/web/src/components/import/SplitwiseImport.tsx index 8aa2e69d..e1dec442 100644 --- a/apps/web/src/components/import/SplitwiseImport.tsx +++ b/apps/web/src/components/import/SplitwiseImport.tsx @@ -597,7 +597,7 @@ export function SplitwiseImport({ targetRoom }: { targetRoom?: ExistingRoomImpor > + ) : state === 'store' && storeUrl ? ( + <> ++ {t('title')} +
+ { + track('store_link_clicked', { platform: 'ios', source }) + noteStoreTapped() + }} + className={buttonClassName({ shadowSize: '4', className: 'mt-5 justify-center no-underline' })} + data-testid="install-app-store" + > + {t('store.cta')} + +{t('store.note')}
+ > ) : state === 'ios' ? ( <>
diff --git a/apps/web/src/components/pwa/InstallPrompt.tsx b/apps/web/src/components/pwa/InstallPrompt.tsx
index cdfb5f98..7c576bdb 100644
--- a/apps/web/src/components/pwa/InstallPrompt.tsx
+++ b/apps/web/src/components/pwa/InstallPrompt.tsx
@@ -29,6 +29,10 @@ const QUIET_MS = 1_500
type AutoInstallDelivery = 'browser_prompt' | 'browser_steps' | 'ios_steps'
+/**
+ * `store` has no delivery on purpose: on room pages the Smart App Banner is the store offer, so the
+ * plain earned card renders nothing and a room never shows two store offers at once.
+ */
const deliveryFor = (state: ReturnType): AutoInstallDelivery | null => {
if (state === 'promptable') return 'browser_prompt'
if (state === 'waiting' || state === 'dismissed') return 'browser_steps'
diff --git a/apps/web/src/components/pwa/InstallRow.tsx b/apps/web/src/components/pwa/InstallRow.tsx
index 4c9fb1b7..8339395f 100644
--- a/apps/web/src/components/pwa/InstallRow.tsx
+++ b/apps/web/src/components/pwa/InstallRow.tsx
@@ -5,10 +5,11 @@ import { useTranslations } from 'next-intl'
import { toast } from 'sonner'
import { SettingRow } from '@/components/ui/SettingRow'
import { StateRow } from '@/components/ui/StateRow'
-import { installMeasureProps, track } from '@/lib/analytics'
+import { installMeasureProps, roomProps, track } from '@/lib/analytics'
import { cancelPreparedInstallHandoff, prepareInstallHandoff } from '@/lib/install-handoff'
import { openInstallRepairSurface, openInstallSurface } from '@/lib/install-surface'
-import { isIOSHere, noteInstallDismissed, promptInstall, useInstallState } from '@/lib/install'
+import { isIOSHere, noteInstallDismissed, noteStoreTapped, promptInstall, useInstallState } from '@/lib/install'
+import { storeAppUrl } from '@/lib/store-app'
import { useFeedback } from '@/lib/use-settings'
/**
@@ -115,6 +116,25 @@ export function InstallRow({ slug, token, active = true }: { slug: string; token
)
}
+ if (state === 'store') {
+ const url = storeAppUrl()
+ if (!url) return null
+ return (
+
+ {
+ track('store_link_clicked', roomProps(slug, { platform: 'ios', source: 'settings' }))
+ noteStoreTapped()
+ window.location.assign(url)
+ }}
+ testId="install-row-store"
+ />
+ {t('store.note')}
+
+ )
+ }
+
if (state === 'ios') {
return (
{
if (!provenIdentity?.token) return
diff --git a/apps/web/src/components/pwa/RoomUpdatesPrompt.tsx b/apps/web/src/components/pwa/RoomUpdatesPrompt.tsx
index 30089f41..bedf0c32 100644
--- a/apps/web/src/components/pwa/RoomUpdatesPrompt.tsx
+++ b/apps/web/src/components/pwa/RoomUpdatesPrompt.tsx
@@ -5,10 +5,17 @@ import { AnimatePresence, motion } from 'motion/react'
import { useTranslations } from 'next-intl'
import { toast } from 'sonner'
import { Button } from '@/components/ui/Button'
+import { buttonClassName } from '@/components/ui/button-style'
import { BTN_MEDIUM } from '@/components/ui/control'
import { roomProps, track } from '@/lib/analytics'
import { useErrorMessage } from '@/lib/error-messages'
-import { INSTALL_SNOOZE_CHANGE_EVENT, isInstallSnoozed, noteInstallDismissed, useInstallState } from '@/lib/install'
+import {
+ INSTALL_SNOOZE_CHANGE_EVENT,
+ isInstallSnoozed,
+ noteInstallDismissed,
+ noteStoreTapped,
+ useInstallState,
+} from '@/lib/install'
import { MATURE_RETURN_MS } from '@/lib/install-funnel'
import { cancelPreparedInstallHandoff, prepareInstallHandoff } from '@/lib/install-handoff'
import { openInstallSurface } from '@/lib/install-surface'
@@ -20,6 +27,7 @@ import {
} from '@/lib/room-updates'
import { TOAST_MS } from '@/lib/toasts'
import { useMotionAllowed } from '@/lib/use-motion'
+import { storeAppUrl } from '@/lib/store-app'
import { usePush } from '@/lib/use-push'
import { useFeedback } from '@/lib/use-settings'
import { InstallPrompt, type InstallPromptProps } from './InstallPrompt'
@@ -297,6 +305,9 @@ export function RoomUpdatesPrompt({
)
const ios = offered.current === 'ios'
+ // Notifications on iOS Safari need an installed app. Once the store app exists, that is the App
+ // Store app rather than the Add-to-Home-Screen handoff.
+ const storeUrl = ios && installState === 'store' ? storeAppUrl() : null
const label = t('notifyMe', { room: roomName })
return (
@@ -319,7 +330,29 @@ export function RoomUpdatesPrompt({
data-motion-surface
>
- {ios ? (
+ {storeUrl ? (
+ <>
+ {
+ track(
+ 'store_link_clicked',
+ roomProps(slug, { platform: 'ios', source: 'room_updates' })
+ )
+ noteStoreTapped()
+ }}
+ className={buttonClassName({
+ size: 'medium',
+ shadowSize: '3',
+ className: `${BTN_MEDIUM} justify-center no-underline`,
+ })}
+ data-testid="room-updates-store"
+ >
+ {tInstall('store.cta')}
+
+ {tInstall('store.note')}
+ >
+ ) : ios ? (
{t('store.note')}
+{tInstall('store.note')}
+ > + ) : ios ? (