From db1b6a163e0dc38b3f0b4ab757841a62af415c2f Mon Sep 17 00:00:00 2001 From: David Prevost Date: Thu, 31 Oct 2024 08:04:32 -0400 Subject: [PATCH] Add `Android Call Style` example --- CONTRIBUTING.md | 12 +++++++++++ tests_react_native/example/notifications.ts | 24 +++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 860ebab6..473ef58d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,6 +44,18 @@ Ensure you have TypeScript compiler running to listen to `react-native` submodul yarn build:rn:watch ``` +## Step 5 + +Run on iOS. Change `--simulator 'iPhone 16'` for you simulator if needed. +```bash +yarn run:ios +``` + +or Android +```bash +yarn run:android +``` + ## Testing Code ### Unit Testing diff --git a/tests_react_native/example/notifications.ts b/tests_react_native/example/notifications.ts index 17fcc350..d73d82d0 100644 --- a/tests_react_native/example/notifications.ts +++ b/tests_react_native/example/notifications.ts @@ -6,6 +6,7 @@ import { AndroidImportance, AndroidFlags, AndroidColor, + AndroidCallType, } from '@notifee/react-native'; export const notifications: { key: string; notification: Notification | Notification[] }[] = [ @@ -345,6 +346,29 @@ export const notifications: { key: string; notification: Notification | Notifica }, }, }, + { + key: 'Android Call Style', + notification: { + title: 'Android Call Style', + body: 'You have a call', + android: { + asForegroundService: true, + channelId: 'high', + autoCancel: false, + category: AndroidCategory.CALL, + importance: AndroidImportance.HIGH, + style: { + type: AndroidStyle.CALL, + person: { name: 'John Doe' }, + callTypeActions: { + callType: 1, + answerAction: { title: 'Answer', pressAction: { id: 'answer' } }, + declineAction: { title: 'Decline', pressAction: { id: 'decline' } }, + }, + }, + }, + }, + }, { key: 'iOS Video', notification: {