From 3d6ee4c225e470ae1a57c0caa9ee25fd1d07852b Mon Sep 17 00:00:00 2001 From: Fadi George Date: Tue, 17 Nov 2026 14:14:40 -0800 Subject: [PATCH 1/4] chore: [SDK-5590] sign demos with enterprise team and sdkdemo IDs - iOS bundle IDs move to com.onesignal.sdkdemo (.NSE, .LA) and the group.com.onesignal.sdkdemo.onesignal app group. - Team DL8TF3X4K3; Release signs with the in-house iPhone Distribution cert and ExportOptions uses enterprise, so BrowserStack can install the IPA without re-signing. Co-Authored-By: Claude Opus 5.5 --- examples/build-ios.md | 16 ++++++++---- examples/build.md | 2 +- .../demo-no-location/ios/ExportOptions.plist | 10 +++---- ...lNotificationServiceExtension.entitlements | 2 +- .../ios/demo.xcodeproj/project.pbxproj | 10 +++---- .../ios/demo/demo.entitlements | 2 +- examples/demo/README.md | 4 +-- examples/demo/ios/ExportOptions.plist | 10 +++---- ...lNotificationServiceExtension.entitlements | 2 +- .../demo/ios/demo.xcodeproj/project.pbxproj | 26 +++++++++---------- examples/demo/ios/demo/demo.entitlements | 2 +- 11 files changed, 46 insertions(+), 40 deletions(-) diff --git a/examples/build-ios.md b/examples/build-ios.md index d7504958..6903c9c8 100644 --- a/examples/build-ios.md +++ b/examples/build-ios.md @@ -1,6 +1,6 @@ # iOS Setup (React Native): Push Notifications + Live Activities -Configure the React Native demo iOS project for OneSignal push notifications and live activities. Set the iOS app bundle id to `com.onesignal.example` before completing the steps below. All paths below are relative to `examples/demo/ios/` unless stated otherwise. +Configure the React Native demo iOS project for OneSignal push notifications and live activities. Set the iOS app bundle id to `com.onesignal.sdkdemo` before completing the steps below. All paths below are relative to `examples/demo/ios/` unless stated otherwise. --- @@ -37,7 +37,7 @@ Create `demo/demo.entitlements`: development com.apple.security.application-groups - group.com.onesignal.example.onesignal + group.com.onesignal.sdkdemo.onesignal @@ -216,7 +216,7 @@ The App Group must match the one in `demo/demo.entitlements`. com.apple.security.application-groups - group.com.onesignal.example.onesignal + group.com.onesignal.sdkdemo.onesignal @@ -346,7 +346,7 @@ The `project.pbxproj` needs native target entries for both extensions. These are **OneSignalNotificationServiceExtension target** (`com.apple.product-type.app-extension`): - Sources, Frameworks, Resources build phases -- `PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.NSE` (must be prefixed with the parent app bundle ID) +- `PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.NSE` (must be prefixed with the parent app bundle ID) - `CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements` - `INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist` - `SKIP_INSTALL = YES`, `SWIFT_VERSION = 5.0`, `IPHONEOS_DEPLOYMENT_TARGET = 15.1` @@ -354,10 +354,16 @@ The `project.pbxproj` needs native target entries for both extensions. These are **OneSignalWidgetExtension target** (`com.apple.product-type.app-extension`): - Sources, Frameworks (linking WidgetKit.framework and SwiftUI.framework), Resources build phases -- `PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.LA` +- `PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.LA` - `INFOPLIST_FILE = OneSignalWidget/Info.plist` (note: folder is `OneSignalWidget`, not `OneSignalWidgetExtension`) - `SKIP_INSTALL = YES`, `SWIFT_VERSION = 5.0`, `IPHONEOS_DEPLOYMENT_TARGET = 16.2` (Live Activities require iOS 16.2+) +**Signing (all three targets):** + +- `"DEVELOPMENT_TEAM[sdk=iphoneos*]" = DL8TF3X4K3` (OneSignal Enterprise team) +- Release: `CODE_SIGN_STYLE = Manual`, `"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"` (in-house cert), and `"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]"` set to the In House profiles `Appium Demo - Main`, `Appium Demo - NSE` and `Appium Demo - Live Activity` +- `ios/ExportOptions.plist` uses `method` `enterprise`, so BrowserStack can install the IPA without re-signing it + --- ## 6. Install dependencies diff --git a/examples/build.md b/examples/build.md index f3c84f52..5ccbe4b2 100644 --- a/examples/build.md +++ b/examples/build.md @@ -22,7 +22,7 @@ mv demo examples/demo - Architecture: provider + hook (`OneSignalProvider` / `useOneSignal`), no repository class, no reducer - Separate component files per section - Support both Android and iOS -- Android `namespace` and `applicationId` in `android/app/build.gradle` are `com.onesignal.sdkdemo`, to match the shared `google-services.json`. The iOS bundle id stays `com.onesignal.example`. +- Android `namespace` and `applicationId` in `android/app/build.gradle` are `com.onesignal.sdkdemo`, to match the shared `google-services.json`. The iOS bundle id stays `com.onesignal.sdkdemo`. - Android applies the Google Services plugin only when `android/app/google-services.json` exists (gitignored), and depends on `firebase-messaging` 25.1.2+ for Firebase Installation ID registration. The `firebase_messaging_installation_id_enabled` manifest flag is off unless Gradle gets `-PFIREBASE_INSTALLATION_ID_ENABLED=true`, which also requires `google-services.json`. App bar logo: import SVG directly via `react-native-svg-transformer`: diff --git a/examples/demo-no-location/ios/ExportOptions.plist b/examples/demo-no-location/ios/ExportOptions.plist index b8104582..29c5b97c 100644 --- a/examples/demo-no-location/ios/ExportOptions.plist +++ b/examples/demo-no-location/ios/ExportOptions.plist @@ -3,20 +3,20 @@ method - debugging + enterprise teamID - 99SW8E36CT + DL8TF3X4K3 signingStyle manual stripSwiftSymbols provisioningProfiles - com.onesignal.example + com.onesignal.sdkdemo Appium Demo - Main - com.onesignal.example.NSE + com.onesignal.sdkdemo.NSE Appium Demo - NSE - com.onesignal.example.LA + com.onesignal.sdkdemo.LA Appium Demo - Live Activity diff --git a/examples/demo-no-location/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements b/examples/demo-no-location/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements index c70461e8..68ed0e50 100644 --- a/examples/demo-no-location/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements +++ b/examples/demo-no-location/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements @@ -4,7 +4,7 @@ com.apple.security.application-groups - group.com.onesignal.example.onesignal + group.com.onesignal.sdkdemo.onesignal diff --git a/examples/demo-no-location/ios/demo.xcodeproj/project.pbxproj b/examples/demo-no-location/ios/demo.xcodeproj/project.pbxproj index 88608287..81c5d7f2 100644 --- a/examples/demo-no-location/ios/demo.xcodeproj/project.pbxproj +++ b/examples/demo-no-location/ios/demo.xcodeproj/project.pbxproj @@ -336,7 +336,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = demo/demo.entitlements; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 99SW8E36CT; + DEVELOPMENT_TEAM = DL8TF3X4K3; ENABLE_BITCODE = NO; INFOPLIST_FILE = demo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; @@ -350,7 +350,7 @@ "-ObjC", "-lc++", ); - PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo; PRODUCT_NAME = demo; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -370,7 +370,7 @@ CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; - "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = DL8TF3X4K3; INFOPLIST_FILE = demo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( @@ -383,7 +383,7 @@ "-ObjC", "-lc++", ); - PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo; PRODUCT_NAME = demo; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - Main"; @@ -512,7 +512,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; CXX = ""; ENABLE_NS_ASSERTIONS = NO; diff --git a/examples/demo-no-location/ios/demo/demo.entitlements b/examples/demo-no-location/ios/demo/demo.entitlements index 34463649..6a1199ae 100644 --- a/examples/demo-no-location/ios/demo/demo.entitlements +++ b/examples/demo-no-location/ios/demo/demo.entitlements @@ -6,7 +6,7 @@ development com.apple.security.application-groups - group.com.onesignal.example.onesignal + group.com.onesignal.sdkdemo.onesignal diff --git a/examples/demo/README.md b/examples/demo/README.md index 40089f72..a04e34c5 100644 --- a/examples/demo/README.md +++ b/examples/demo/README.md @@ -2,7 +2,7 @@ Reference app for `react-native-onesignal`. It showcases SDK features including push notifications, in-app messaging, user management, tags, triggers, outcomes, live activities, and more, using the SDK packed from this repository. -The demo uses Android package `com.onesignal.sdkdemo` and iOS bundle id `com.onesignal.example`. +The demo uses the app ID `com.onesignal.sdkdemo` on Android and iOS. ## Prerequisites @@ -37,7 +37,7 @@ ONESIGNAL_ANDROID_CHANNEL_ID= - `ONESIGNAL_API_KEY`: REST API key, used to update and end live activities. Sending notifications from the demo doesn't need it. - `ONESIGNAL_ANDROID_CHANNEL_ID`: optional Android notification channel for the sound test notification. Falls back to a built-in default channel. -The OneSignal app needs FCM credentials for the `com.onesignal.sdkdemo` Android package and APNs credentials for the `com.onesignal.example` bundle ID on iOS. +The OneSignal app needs FCM (Android) and APNs (iOS) credentials for `com.onesignal.sdkdemo`. To use Firebase on Android, put a `google-services.json` with a `com.onesignal.sdkdemo` client in `android/app/`. It's gitignored, and the Google Services plugin is applied only when it exists. Pass `-PFIREBASE_INSTALLATION_ID_ENABLED=true` to Gradle to turn on Firebase Installation ID registration; the build fails if the flag is on without the file. diff --git a/examples/demo/ios/ExportOptions.plist b/examples/demo/ios/ExportOptions.plist index b8104582..29c5b97c 100644 --- a/examples/demo/ios/ExportOptions.plist +++ b/examples/demo/ios/ExportOptions.plist @@ -3,20 +3,20 @@ method - debugging + enterprise teamID - 99SW8E36CT + DL8TF3X4K3 signingStyle manual stripSwiftSymbols provisioningProfiles - com.onesignal.example + com.onesignal.sdkdemo Appium Demo - Main - com.onesignal.example.NSE + com.onesignal.sdkdemo.NSE Appium Demo - NSE - com.onesignal.example.LA + com.onesignal.sdkdemo.LA Appium Demo - Live Activity diff --git a/examples/demo/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements b/examples/demo/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements index c70461e8..68ed0e50 100644 --- a/examples/demo/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements +++ b/examples/demo/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements @@ -4,7 +4,7 @@ com.apple.security.application-groups - group.com.onesignal.example.onesignal + group.com.onesignal.sdkdemo.onesignal diff --git a/examples/demo/ios/demo.xcodeproj/project.pbxproj b/examples/demo/ios/demo.xcodeproj/project.pbxproj index 43d26c1c..23872d8c 100644 --- a/examples/demo/ios/demo.xcodeproj/project.pbxproj +++ b/examples/demo/ios/demo.xcodeproj/project.pbxproj @@ -522,7 +522,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = demo/demo.entitlements; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 99SW8E36CT; + DEVELOPMENT_TEAM = DL8TF3X4K3; ENABLE_BITCODE = NO; INFOPLIST_FILE = demo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; @@ -536,7 +536,7 @@ "-ObjC", "-lc++", ); - PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo; PRODUCT_NAME = demo; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -556,7 +556,7 @@ CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; - "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = DL8TF3X4K3; INFOPLIST_FILE = demo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( @@ -569,7 +569,7 @@ "-ObjC", "-lc++", ); - PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo; PRODUCT_NAME = demo; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - Main"; @@ -698,7 +698,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; CXX = ""; ENABLE_NS_ASSERTIONS = NO; @@ -752,7 +752,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 99SW8E36CT; + DEVELOPMENT_TEAM = DL8TF3X4K3; INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( @@ -761,7 +761,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.NSE; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.NSE; PRODUCT_NAME = OneSignalNotificationServiceExtension; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; @@ -778,7 +778,7 @@ CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; - "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = DL8TF3X4K3; INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( @@ -787,7 +787,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.NSE; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.NSE; PRODUCT_NAME = OneSignalNotificationServiceExtension; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - NSE"; @@ -803,7 +803,7 @@ baseConfigurationReference = A2000000000000000000000D /* Pods-OneSignalWidgetExtension.debug.xcconfig */; buildSettings = { CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 99SW8E36CT; + DEVELOPMENT_TEAM = DL8TF3X4K3; INFOPLIST_FILE = OneSignalWidget/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.2; LD_RUNPATH_SEARCH_PATHS = ( @@ -812,7 +812,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.LA; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.LA; PRODUCT_NAME = OneSignalWidgetExtension; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; @@ -828,7 +828,7 @@ CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; - "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = DL8TF3X4K3; INFOPLIST_FILE = OneSignalWidget/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.2; LD_RUNPATH_SEARCH_PATHS = ( @@ -837,7 +837,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.LA; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.LA; PRODUCT_NAME = OneSignalWidgetExtension; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - Live Activity"; diff --git a/examples/demo/ios/demo/demo.entitlements b/examples/demo/ios/demo/demo.entitlements index 34463649..6a1199ae 100644 --- a/examples/demo/ios/demo/demo.entitlements +++ b/examples/demo/ios/demo/demo.entitlements @@ -6,7 +6,7 @@ development com.apple.security.application-groups - group.com.onesignal.example.onesignal + group.com.onesignal.sdkdemo.onesignal From fabc6b7dd73f389b58898199671bcedbaf95cf33 Mon Sep 17 00:00:00 2001 From: Fadi George Date: Tue, 17 Nov 2026 14:26:37 -0800 Subject: [PATCH 2/4] feat: [SDK-5590] demo button grid, top-anchored dialogs, shorter labels - ButtonGrid lays out section buttons two per row; an odd last button spans, conditionally rendered buttons reflow. - DialogBackdrop anchors dialogs at the top below the safe area; keyboard padding only shrinks the space below, so dialogs stay put. - Shorter labels (ADD TAGS/ALIASES/TRIGGERS, CLEAR ALL, START/END ACTIVITY, CHECK LOCATION) and every underscore in the Live Activity status label is replaced. Co-Authored-By: Claude Opus 5.5 --- examples/demo/src/components/ButtonGrid.tsx | 52 ++++++++++++++++++ .../modals/CustomNotificationModal.tsx | 19 ++----- .../src/components/modals/DialogBackdrop.tsx | 22 ++++++++ .../components/modals/MultiPairInputModal.tsx | 10 +--- .../modals/MultiSelectRemoveModal.tsx | 19 ++----- .../src/components/modals/OutcomeModal.tsx | 19 ++----- .../src/components/modals/PairInputModal.tsx | 19 ++----- .../components/modals/SingleInputModal.tsx | 19 ++----- .../src/components/modals/TooltipModal.tsx | 4 +- .../src/components/modals/TrackEventModal.tsx | 19 ++----- .../components/sections/AliasesSection.tsx | 19 +++++-- .../sections/LiveActivitySection.tsx | 43 ++++++++------- .../components/sections/LocationSection.tsx | 25 +++++---- .../components/sections/SendIamSection.tsx | 51 +++++++---------- .../components/sections/SendPushSection.tsx | 55 ++++++++++--------- .../src/components/sections/TagsSection.tsx | 27 +++++---- .../components/sections/TriggersSection.tsx | 55 ++++++++++--------- .../src/components/sections/UserSection.tsx | 25 +++++---- examples/demo/src/theme.ts | 3 +- 19 files changed, 263 insertions(+), 242 deletions(-) create mode 100644 examples/demo/src/components/ButtonGrid.tsx create mode 100644 examples/demo/src/components/modals/DialogBackdrop.tsx diff --git a/examples/demo/src/components/ButtonGrid.tsx b/examples/demo/src/components/ButtonGrid.tsx new file mode 100644 index 00000000..94aae191 --- /dev/null +++ b/examples/demo/src/components/ButtonGrid.tsx @@ -0,0 +1,52 @@ +import React from 'react'; +import { StyleSheet, View } from 'react-native'; + +import { AppSpacing } from '../theme'; + +type ButtonElement = React.ReactElement<{ compact?: boolean }>; + +function flatten(children: React.ReactNode): ButtonElement[] { + return React.Children.toArray(children).flatMap((child) => { + if (!React.isValidElement<{ children?: React.ReactNode }>(child)) return []; + if (child.type === React.Fragment) return flatten(child.props.children); + return [child as ButtonElement]; + }); +} + +/** + * Lays out ActionButtons two per row in equal columns; an odd last button + * spans both. Conditionally rendered buttons drop out so the rest reflow. + */ +export default function ButtonGrid({ children }: { children: React.ReactNode }) { + const buttons = flatten(children).map((button) => React.cloneElement(button, { compact: true })); + const rows: ButtonElement[][] = []; + for (let i = 0; i < buttons.length; i += 2) rows.push(buttons.slice(i, i + 2)); + + return ( + + {rows.map((row, index) => + row.length === 1 ? ( + {row[0]} + ) : ( + + {row.map((button, cell) => ( + + {button} + + ))} + + ), + )} + + ); +} + +const styles = StyleSheet.create({ + row: { + flexDirection: 'row', + columnGap: AppSpacing.gap, + }, + cell: { + flex: 1, + }, +}); diff --git a/examples/demo/src/components/modals/CustomNotificationModal.tsx b/examples/demo/src/components/modals/CustomNotificationModal.tsx index 03d88a7e..107c03f9 100644 --- a/examples/demo/src/components/modals/CustomNotificationModal.tsx +++ b/examples/demo/src/components/modals/CustomNotificationModal.tsx @@ -1,16 +1,8 @@ import React, { useState } from 'react'; -import { - Modal, - View, - Text, - TextInput, - TouchableOpacity, - StyleSheet, - KeyboardAvoidingView, - Platform, -} from 'react-native'; +import { Modal, View, Text, TextInput, TouchableOpacity, StyleSheet } from 'react-native'; import { AppColors, AppDialogStyles, AppInputProps } from '../../theme'; +import DialogBackdrop from './DialogBackdrop'; interface Props { visible: boolean; @@ -40,10 +32,7 @@ export default function CustomNotificationModal({ visible, onConfirm, onClose }: return ( - + Custom Notification - + ); } diff --git a/examples/demo/src/components/modals/DialogBackdrop.tsx b/examples/demo/src/components/modals/DialogBackdrop.tsx new file mode 100644 index 00000000..dc4fbcec --- /dev/null +++ b/examples/demo/src/components/modals/DialogBackdrop.tsx @@ -0,0 +1,22 @@ +import React from 'react'; +import { KeyboardAvoidingView, Platform } from 'react-native'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; + +import { AppDialogStyles } from '../../theme'; + +/** + * Top-anchored dialog backdrop. A dialog that moves while open desyncs + * XCUITest frame reporting from the rendered layout; keyboard padding only + * shrinks the space below, so the dialog stays put. + */ +export default function DialogBackdrop({ children }: { children: React.ReactNode }) { + const insets = useSafeAreaInsets(); + return ( + + {children} + + ); +} diff --git a/examples/demo/src/components/modals/MultiPairInputModal.tsx b/examples/demo/src/components/modals/MultiPairInputModal.tsx index cca1aa7f..ff3f907a 100644 --- a/examples/demo/src/components/modals/MultiPairInputModal.tsx +++ b/examples/demo/src/components/modals/MultiPairInputModal.tsx @@ -7,12 +7,11 @@ import { TouchableOpacity, ScrollView, StyleSheet, - KeyboardAvoidingView, - Platform, } from 'react-native'; import Icon from 'react-native-vector-icons/MaterialIcons'; import { AppColors, AppDialogStyles, AppInputProps } from '../../theme'; +import DialogBackdrop from './DialogBackdrop'; interface Row { id: number; @@ -78,10 +77,7 @@ export default function MultiPairInputModal({ return ( - + {title} @@ -150,7 +146,7 @@ export default function MultiPairInputModal({ - + ); } diff --git a/examples/demo/src/components/modals/MultiSelectRemoveModal.tsx b/examples/demo/src/components/modals/MultiSelectRemoveModal.tsx index a8994d2a..29643779 100644 --- a/examples/demo/src/components/modals/MultiSelectRemoveModal.tsx +++ b/examples/demo/src/components/modals/MultiSelectRemoveModal.tsx @@ -1,17 +1,9 @@ import React, { useState } from 'react'; -import { - Modal, - View, - Text, - TouchableOpacity, - ScrollView, - StyleSheet, - KeyboardAvoidingView, - Platform, -} from 'react-native'; +import { Modal, View, Text, TouchableOpacity, ScrollView, StyleSheet } from 'react-native'; import Icon from 'react-native-vector-icons/MaterialIcons'; import { AppColors, AppTextStyles, AppDialogStyles } from '../../theme'; +import DialogBackdrop from './DialogBackdrop'; interface Props { visible: boolean; @@ -55,10 +47,7 @@ export default function MultiSelectRemoveModal({ return ( - + {title} @@ -102,7 +91,7 @@ export default function MultiSelectRemoveModal({ - + ); } diff --git a/examples/demo/src/components/modals/OutcomeModal.tsx b/examples/demo/src/components/modals/OutcomeModal.tsx index f5038adb..fd4aeaf5 100644 --- a/examples/demo/src/components/modals/OutcomeModal.tsx +++ b/examples/demo/src/components/modals/OutcomeModal.tsx @@ -1,16 +1,8 @@ import React, { useState } from 'react'; -import { - Modal, - View, - Text, - TextInput, - TouchableOpacity, - StyleSheet, - KeyboardAvoidingView, - Platform, -} from 'react-native'; +import { Modal, View, Text, TextInput, TouchableOpacity, StyleSheet } from 'react-native'; import { AppColors, AppTextStyles, AppDialogStyles, AppInputProps } from '../../theme'; +import DialogBackdrop from './DialogBackdrop'; type OutcomeType = 'normal' | 'unique' | 'withValue'; @@ -81,10 +73,7 @@ export default function OutcomeModal({ return ( - + Send Outcome @@ -137,7 +126,7 @@ export default function OutcomeModal({ - + ); } diff --git a/examples/demo/src/components/modals/PairInputModal.tsx b/examples/demo/src/components/modals/PairInputModal.tsx index 92c93b2e..751ed7bb 100644 --- a/examples/demo/src/components/modals/PairInputModal.tsx +++ b/examples/demo/src/components/modals/PairInputModal.tsx @@ -1,16 +1,8 @@ import React, { useState } from 'react'; -import { - Modal, - View, - Text, - TextInput, - TouchableOpacity, - StyleSheet, - KeyboardAvoidingView, - Platform, -} from 'react-native'; +import { Modal, View, Text, TextInput, TouchableOpacity, StyleSheet } from 'react-native'; import { AppColors, AppDialogStyles, AppInputProps } from '../../theme'; +import DialogBackdrop from './DialogBackdrop'; interface Props { visible: boolean; @@ -56,10 +48,7 @@ export default function PairInputModal({ return ( - + {title} @@ -104,7 +93,7 @@ export default function PairInputModal({ - + ); } diff --git a/examples/demo/src/components/modals/SingleInputModal.tsx b/examples/demo/src/components/modals/SingleInputModal.tsx index 69d43d66..a7633cb1 100644 --- a/examples/demo/src/components/modals/SingleInputModal.tsx +++ b/examples/demo/src/components/modals/SingleInputModal.tsx @@ -1,16 +1,8 @@ import React, { useState } from 'react'; -import { - Modal, - View, - Text, - TextInput, - TouchableOpacity, - StyleSheet, - KeyboardAvoidingView, - Platform, -} from 'react-native'; +import { Modal, View, Text, TextInput, TouchableOpacity, StyleSheet } from 'react-native'; import { AppColors, AppDialogStyles, AppInputProps } from '../../theme'; +import DialogBackdrop from './DialogBackdrop'; interface Props { visible: boolean; @@ -51,10 +43,7 @@ export default function SingleInputModal({ return ( - + {title} - + ); } diff --git a/examples/demo/src/components/modals/TooltipModal.tsx b/examples/demo/src/components/modals/TooltipModal.tsx index 416f3ed5..fc4838df 100644 --- a/examples/demo/src/components/modals/TooltipModal.tsx +++ b/examples/demo/src/components/modals/TooltipModal.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { Modal, View, Text, TouchableOpacity, ScrollView, StyleSheet } from 'react-native'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { TooltipData } from '../../services/TooltipHelper'; import { AppColors, AppTextStyles, AppDialogStyles } from '../../theme'; @@ -11,13 +12,14 @@ interface Props { } export default function TooltipModal({ visible, tooltip, onClose }: Props) { + const insets = useSafeAreaInsets(); if (!tooltip) { return null; } return ( - + Track Event Event Name @@ -123,7 +112,7 @@ export default function TrackEventModal({ visible, onConfirm, onClose }: Props) - + ); } diff --git a/examples/demo/src/components/sections/AliasesSection.tsx b/examples/demo/src/components/sections/AliasesSection.tsx index 7846d79c..9fca3d66 100644 --- a/examples/demo/src/components/sections/AliasesSection.tsx +++ b/examples/demo/src/components/sections/AliasesSection.tsx @@ -3,6 +3,7 @@ import { View, StyleSheet } from 'react-native'; import { AppTheme, AppSpacing } from '../../theme'; import ActionButton from '../ActionButton'; +import ButtonGrid from '../ButtonGrid'; import { PairList, EmptyState, LoadingState } from '../ListWidgets'; import MultiPairInputModal from '../modals/MultiPairInputModal'; import PairInputModal from '../modals/PairInputModal'; @@ -45,12 +46,18 @@ export default function AliasesSection({ )} - setAddOpen(true)} testID="add_alias_button" /> - setAddMultipleOpen(true)} - testID="add_multiple_aliases_button" - /> + + setAddOpen(true)} + testID="add_alias_button" + /> + setAddMultipleOpen(true)} + testID="add_multiple_aliases_button" + /> + - - - onEnd(activityId)} - disabled={!activityId.trim() || !hasApiKey} - variant="outlined" - testID="end_live_activity_button" - /> + + + + onEnd(activityId)} + disabled={!activityId.trim() || !hasApiKey} + variant="outlined" + testID="end_live_activity_button" + /> + ); diff --git a/examples/demo/src/components/sections/LocationSection.tsx b/examples/demo/src/components/sections/LocationSection.tsx index e27c247d..2069aef1 100644 --- a/examples/demo/src/components/sections/LocationSection.tsx +++ b/examples/demo/src/components/sections/LocationSection.tsx @@ -3,6 +3,7 @@ import { View, StyleSheet } from 'react-native'; import { AppTheme, AppSpacing } from '../../theme'; import ActionButton from '../ActionButton'; +import ButtonGrid from '../ButtonGrid'; import SectionCard from '../SectionCard'; import { useSnackbar } from '../ToastProvider'; import ToggleRow from '../ToggleRow'; @@ -40,17 +41,19 @@ export default function LocationSection({ testID="location_shared_toggle" /> - - + + + + ); } diff --git a/examples/demo/src/components/sections/SendIamSection.tsx b/examples/demo/src/components/sections/SendIamSection.tsx index b049b7bb..f85e4529 100644 --- a/examples/demo/src/components/sections/SendIamSection.tsx +++ b/examples/demo/src/components/sections/SendIamSection.tsx @@ -1,9 +1,8 @@ import React from 'react'; -import { StyleSheet, View } from 'react-native'; import { InAppMessageType, iamTypeLabel } from '../../models/InAppMessageType'; -import { AppSpacing } from '../../theme'; import ActionButton from '../ActionButton'; +import ButtonGrid from '../ButtonGrid'; import SectionCard from '../SectionCard'; interface Props { @@ -11,40 +10,30 @@ interface Props { onInfoTap?: () => void; } -const IAM_TYPE_ROWS: InAppMessageType[][] = [ - [InAppMessageType.TopBanner, InAppMessageType.BottomBanner], - [InAppMessageType.CenterModal, InAppMessageType.Html], - [InAppMessageType.FullScreen, InAppMessageType.FullBleed], - [InAppMessageType.Carousel, InAppMessageType.CarouselBleed], +const IAM_TYPES: InAppMessageType[] = [ + InAppMessageType.TopBanner, + InAppMessageType.BottomBanner, + InAppMessageType.CenterModal, + InAppMessageType.Html, + InAppMessageType.FullScreen, + InAppMessageType.FullBleed, + InAppMessageType.Carousel, + InAppMessageType.CarouselBleed, ]; export default function SendIamSection({ onSendIam, onInfoTap }: Props) { return ( - {IAM_TYPE_ROWS.map((row) => ( - - {row.map((type) => ( - - onSendIam(type)} - testID={`send_iam_${type}_button`} - compact - /> - - ))} - - ))} + + {IAM_TYPES.map((type) => ( + onSendIam(type)} + testID={`send_iam_${type}_button`} + /> + ))} + ); } - -const styles = StyleSheet.create({ - row: { - flexDirection: 'row', - columnGap: AppSpacing.gap, - }, - cell: { - flex: 1, - }, -}); diff --git a/examples/demo/src/components/sections/SendPushSection.tsx b/examples/demo/src/components/sections/SendPushSection.tsx index 4bb94b4b..71015830 100644 --- a/examples/demo/src/components/sections/SendPushSection.tsx +++ b/examples/demo/src/components/sections/SendPushSection.tsx @@ -2,6 +2,7 @@ import React, { useState } from 'react'; import { NotificationType } from '../../models/NotificationType'; import ActionButton from '../ActionButton'; +import ButtonGrid from '../ButtonGrid'; import CustomNotificationModal from '../modals/CustomNotificationModal'; import SectionCard from '../SectionCard'; @@ -22,32 +23,34 @@ export default function SendPushSection({ return ( - onSendNotification(NotificationType.Simple)} - testID="send_simple_button" - /> - onSendNotification(NotificationType.WithImage)} - testID="send_image_button" - /> - onSendNotification(NotificationType.WithSound)} - testID="send_sound_button" - /> - setCustomOpen(true)} - testID="send_custom_button" - /> - + + onSendNotification(NotificationType.Simple)} + testID="send_simple_button" + /> + onSendNotification(NotificationType.WithImage)} + testID="send_image_button" + /> + onSendNotification(NotificationType.WithSound)} + testID="send_sound_button" + /> + setCustomOpen(true)} + testID="send_custom_button" + /> + + { diff --git a/examples/demo/src/components/sections/TagsSection.tsx b/examples/demo/src/components/sections/TagsSection.tsx index ed667875..67db339d 100644 --- a/examples/demo/src/components/sections/TagsSection.tsx +++ b/examples/demo/src/components/sections/TagsSection.tsx @@ -3,6 +3,7 @@ import { View, StyleSheet } from 'react-native'; import { AppTheme, AppSpacing } from '../../theme'; import ActionButton from '../ActionButton'; +import ButtonGrid from '../ButtonGrid'; import { PairList, EmptyState, LoadingState } from '../ListWidgets'; import MultiPairInputModal from '../modals/MultiPairInputModal'; import MultiSelectRemoveModal from '../modals/MultiSelectRemoveModal'; @@ -50,20 +51,22 @@ export default function TagsSection({ /> )} - setAddOpen(true)} testID="add_tag_button" /> - setAddMultipleOpen(true)} - testID="add_multiple_tags_button" - /> - {tags.length > 0 && ( + + setAddOpen(true)} testID="add_tag_button" /> setRemoveOpen(true)} - variant="outlined" - testID="remove_tags_button" + label="ADD TAGS" + onPress={() => setAddMultipleOpen(true)} + testID="add_multiple_tags_button" /> - )} + {tags.length > 0 && ( + setRemoveOpen(true)} + variant="outlined" + testID="remove_tags_button" + /> + )} + )} - setAddOpen(true)} - testID="add_trigger_button" - /> - setAddMultipleOpen(true)} - testID="add_multiple_triggers_button" - /> - {triggers.length > 0 && ( - <> - setRemoveOpen(true)} - variant="outlined" - testID="remove_triggers_button" - /> - - - )} + + setAddOpen(true)} + testID="add_trigger_button" + /> + setAddMultipleOpen(true)} + testID="add_multiple_triggers_button" + /> + {triggers.length > 0 && ( + <> + setRemoveOpen(true)} + variant="outlined" + testID="remove_triggers_button" + /> + + + )} + - setLoginOpen(true)} - testID="login_user_button" - /> - {isLoggedIn && ( + setLoginOpen(true)} + testID="login_user_button" /> - )} + {isLoggedIn && ( + + )} + Date: Tue, 17 Nov 2026 14:37:44 -0800 Subject: [PATCH 3/4] refactor: [SDK-5590] simplify ButtonGrid and match web demo dialogs - ButtonGrid is a flex-wrap row; grid buttons grow from a 40% basis so an odd last button spans, matching the web demos' CSS grid. - CHECK LOCATION uses the primary style, the event properties input is bounded (90-200), and dialogs cap at 640 wide with a 24pt + safe area bottom inset. Co-Authored-By: Claude Opus 5.5 --- examples/demo/src/components/ActionButton.tsx | 19 +++++--- examples/demo/src/components/ButtonGrid.tsx | 44 ++++--------------- .../src/components/modals/DialogBackdrop.tsx | 5 ++- .../src/components/modals/TooltipModal.tsx | 5 ++- .../src/components/modals/TrackEventModal.tsx | 3 +- .../components/sections/LocationSection.tsx | 1 - examples/demo/src/theme.ts | 3 ++ 7 files changed, 36 insertions(+), 44 deletions(-) diff --git a/examples/demo/src/components/ActionButton.tsx b/examples/demo/src/components/ActionButton.tsx index 2011d3ea..0b6fe00b 100644 --- a/examples/demo/src/components/ActionButton.tsx +++ b/examples/demo/src/components/ActionButton.tsx @@ -1,7 +1,8 @@ -import React from 'react'; +import React, { useContext } from 'react'; import { TouchableOpacity, Text, StyleSheet, View, ActivityIndicator } from 'react-native'; import { AppColors, AppSpacing } from '../theme'; +import { ButtonGridContext } from './ButtonGrid'; interface Props { label: string; @@ -28,6 +29,8 @@ export default function ActionButton({ leftAligned, compact, }: Props) { + const inGrid = useContext(ButtonGridContext); + const singleLine = compact || inGrid; const bgColor = variant === 'primary' ? AppColors.osPrimary : 'transparent'; const borderStyle = @@ -44,7 +47,8 @@ export default function ActionButton({ styles.button, { backgroundColor: bgColor }, borderStyle, - compact && styles.compact, + singleLine && styles.compact, + inGrid && styles.gridCell, (disabled || loading) && styles.disabled, ]} activeOpacity={0.8} @@ -55,9 +59,9 @@ export default function ActionButton({ {icon && iconPosition === 'left' && {icon}} {label} @@ -95,6 +99,11 @@ const styles = StyleSheet.create({ compactText: { flexShrink: 1, }, + gridCell: { + width: 'auto', + flexGrow: 1, + flexBasis: '40%', + }, iconLeft: { marginRight: 8, }, diff --git a/examples/demo/src/components/ButtonGrid.tsx b/examples/demo/src/components/ButtonGrid.tsx index 94aae191..3a9094a7 100644 --- a/examples/demo/src/components/ButtonGrid.tsx +++ b/examples/demo/src/components/ButtonGrid.tsx @@ -1,52 +1,26 @@ -import React from 'react'; +import React, { createContext } from 'react'; import { StyleSheet, View } from 'react-native'; import { AppSpacing } from '../theme'; -type ButtonElement = React.ReactElement<{ compact?: boolean }>; - -function flatten(children: React.ReactNode): ButtonElement[] { - return React.Children.toArray(children).flatMap((child) => { - if (!React.isValidElement<{ children?: React.ReactNode }>(child)) return []; - if (child.type === React.Fragment) return flatten(child.props.children); - return [child as ButtonElement]; - }); -} +export const ButtonGridContext = createContext(false); /** - * Lays out ActionButtons two per row in equal columns; an odd last button - * spans both. Conditionally rendered buttons drop out so the rest reflow. + * Wraps ActionButtons two per row; an odd last button grows to span the row. + * Conditionally rendered buttons drop out, so the rest reflow. */ export default function ButtonGrid({ children }: { children: React.ReactNode }) { - const buttons = flatten(children).map((button) => React.cloneElement(button, { compact: true })); - const rows: ButtonElement[][] = []; - for (let i = 0; i < buttons.length; i += 2) rows.push(buttons.slice(i, i + 2)); - return ( - - {rows.map((row, index) => - row.length === 1 ? ( - {row[0]} - ) : ( - - {row.map((button, cell) => ( - - {button} - - ))} - - ), - )} - + + {children} + ); } const styles = StyleSheet.create({ - row: { + grid: { flexDirection: 'row', + flexWrap: 'wrap', columnGap: AppSpacing.gap, }, - cell: { - flex: 1, - }, }); diff --git a/examples/demo/src/components/modals/DialogBackdrop.tsx b/examples/demo/src/components/modals/DialogBackdrop.tsx index dc4fbcec..787a68a4 100644 --- a/examples/demo/src/components/modals/DialogBackdrop.tsx +++ b/examples/demo/src/components/modals/DialogBackdrop.tsx @@ -13,7 +13,10 @@ export default function DialogBackdrop({ children }: { children: React.ReactNode const insets = useSafeAreaInsets(); return ( {children} diff --git a/examples/demo/src/components/modals/TooltipModal.tsx b/examples/demo/src/components/modals/TooltipModal.tsx index fc4838df..797635e0 100644 --- a/examples/demo/src/components/modals/TooltipModal.tsx +++ b/examples/demo/src/components/modals/TooltipModal.tsx @@ -19,7 +19,10 @@ export default function TooltipModal({ visible, tooltip, onClose }: Props) { return ( diff --git a/examples/demo/src/theme.ts b/examples/demo/src/theme.ts index 409de4b7..d8d1bef5 100644 --- a/examples/demo/src/theme.ts +++ b/examples/demo/src/theme.ts @@ -64,6 +64,9 @@ export const AppDialogStyles = StyleSheet.create({ }, container: { flexShrink: 1, + width: '100%', + maxWidth: 640, + alignSelf: 'center', backgroundColor: AppColors.osCardBackground, borderRadius: 28, paddingTop: 24, From b1d985bc5ce873e24dbf4f3361d97f10d41c343b Mon Sep 17 00:00:00 2001 From: Fadi George Date: Wed, 18 Nov 2026 10:08:54 -0800 Subject: [PATCH 4/4] fix: [SDK-5590] keep dialog safe-area bottom padding under KeyboardAvoidingView Co-Authored-By: Claude Opus 5.5 --- .../src/components/modals/DialogBackdrop.tsx | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/examples/demo/src/components/modals/DialogBackdrop.tsx b/examples/demo/src/components/modals/DialogBackdrop.tsx index 787a68a4..f497f9b9 100644 --- a/examples/demo/src/components/modals/DialogBackdrop.tsx +++ b/examples/demo/src/components/modals/DialogBackdrop.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { KeyboardAvoidingView, Platform } from 'react-native'; +import { KeyboardAvoidingView, Platform, StyleSheet, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { AppDialogStyles } from '../../theme'; @@ -13,13 +13,22 @@ export default function DialogBackdrop({ children }: { children: React.ReactNode const insets = useSafeAreaInsets(); return ( - {children} + {/* KeyboardAvoidingView overwrites its own paddingBottom, so the insets live here. */} + + {children} + ); } + +const styles = StyleSheet.create({ + fill: { flex: 1 }, +});