feat(mobile): add Android Live Update mock preview#3802
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
49e4278 to
8ce6e93
Compare
| .putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName) | ||
| .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
|
|
||
| try { |
There was a problem hiding this comment.
🟡 Medium t3agentliveupdate/AgentLiveUpdateManager.kt:105
openPromotionSettings() can still crash with an uncaught ActivityNotFoundException on devices where both ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS and ACTION_APP_NOTIFICATION_SETTINGS have no matching activity. The catch block only guards the first startActivity call, but the fallback startActivity(appNotificationSettingsIntent()) at line 108 runs unguarded. Consider wrapping the fallback call in its own try/catch so a missing activity doesn't crash the app.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/mobile/modules/t3-agent-live-update/android/src/main/java/expo/modules/t3agentliveupdate/AgentLiveUpdateManager.kt around line 105:
`openPromotionSettings()` can still crash with an uncaught `ActivityNotFoundException` on devices where both `ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS` and `ACTION_APP_NOTIFICATION_SETTINGS` have no matching activity. The `catch` block only guards the first `startActivity` call, but the fallback `startActivity(appNotificationSettingsIntent())` at line 108 runs unguarded. Consider wrapping the fallback call in its own try/catch so a missing activity doesn't crash the app.
Important
This is a stacked draft based on #3579 (
android-dev-pr-3514). Review and merge #3579 first. After that lands, this PR should be rebased or retargeted ontomain.Why
Android 16 adds promoted ongoing notifications, the closest Android system surface to the iOS Live Activities currently provided by
expo-widgets. This PR establishes the native Android and TypeScript seam and makes it testable with local mock states before we add relay-driven delivery.Promotion remains controlled by Android. Unsupported devices, or devices where promotion access is disabled, fall back to a normal ongoing notification.
Built in this PR
POST_NOTIFICATIONSandPOST_PROMOTED_NOTIFICATIONS.setRequestPromotedOngoing(true)Deliberately not built
__DEV__only.The future relay integration can call the typed
show(snapshot)/cancel()seam added here without changing the native notification contract.Validation
NODE_ENV=development APP_VARIANT=development ./gradlew :app:assembleDebug -PreactNativeArchitectures=arm64-v8a --no-parallel --max-workers=2ONGOING_EVENT|ONLY_ALERT_ONCE|PROMOTED_ONGOING.vp check— passes with 0 errors (30 existing warnings).vp run typecheck— passes.vp run lint:mobile— passes with zero native violations.Note
Add Android Live Update mock preview to Settings screen in dev builds
T3AgentLiveUpdate) that creates a notification channel and manages an ongoing 'Agent live updates' notification, including support for Android 13+ permission checks and promotable notifications on supported API levels.__DEV__builds, allowing developers to trigger and inspect mock Live Update notifications.withAndroidUnifiedNdkconfig plugin that pins all Android subprojects to a single NDK version during prebuild to avoid mixed NDK downloads.📊 Macroscope summarized 8ce6e93. 12 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.