Skip to content

Commit

Permalink
Add Android Call Style example
Browse files Browse the repository at this point in the history
  • Loading branch information
dprevost-LMI committed Oct 31, 2024
1 parent 1bc815f commit db1b6a1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions tests_react_native/example/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
AndroidImportance,
AndroidFlags,
AndroidColor,
AndroidCallType,
} from '@notifee/react-native';

export const notifications: { key: string; notification: Notification | Notification[] }[] = [
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit db1b6a1

Please sign in to comment.