Add About screen with 7-tap joelangel easter egg; fix deps
- About screen surfaces getAbout() content; tapping the title 7x reveals assets/joelangel.png (placeholder committed; replace with the real image) - Correct UnifiedPush package to react-native-unifiedpush-connector (lazy-required) - Fix expo-notifications NotificationBehavior (shouldShowAlert) - Reachable via an ⓘ header button on the main tabs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
170f2fa63c
commit
6b19fc79dd
10 changed files with 9699 additions and 17 deletions
|
|
@ -18,6 +18,8 @@ export async function ensureNotificationPermission(): Promise<boolean> {
|
|||
|
||||
Notifications.setNotificationHandler({
|
||||
handleNotification: async () => ({
|
||||
// shouldShowAlert is the legacy field; Banner/List are the newer split.
|
||||
shouldShowAlert: true,
|
||||
shouldShowBanner: true,
|
||||
shouldShowList: true,
|
||||
shouldPlaySound: true,
|
||||
|
|
|
|||
|
|
@ -22,18 +22,27 @@ import { ps } from '@/api/client';
|
|||
* the app is ready to be a push target once the bridge (or a self-hosted relay
|
||||
* that we register with `PUT /api/Device`) is in place.
|
||||
*
|
||||
* The `react-native-unifiedpush` API surface varies by version; treat the calls
|
||||
* below as the integration point to confirm against the installed version.
|
||||
* The `react-native-unifiedpush-connector` API surface varies by version; treat the
|
||||
* calls below as the integration point to confirm against the installed version.
|
||||
* It's lazy-required so the app runs fine even before push is fully wired.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const UnifiedPush = require('react-native-unifiedpush');
|
||||
|
||||
const ENDPOINT_KEY = 'ps_unifiedpush_endpoint';
|
||||
const INSTANCE = 'default';
|
||||
|
||||
function loadUnifiedPush(): any | null {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
return require('react-native-unifiedpush-connector');
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Kick off distributor discovery + registration (call after login). */
|
||||
export async function registerUnifiedPush(): Promise<void> {
|
||||
const UnifiedPush = loadUnifiedPush();
|
||||
if (!UnifiedPush) return;
|
||||
const distributors: string[] = await UnifiedPush.getDistributors();
|
||||
if (!distributors.length) {
|
||||
// No UnifiedPush distributor installed (e.g. ntfy). Local reminders still work.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue