Skip to content

Commit 17f28ac

Browse files
committed
update the docs about the new constants
1 parent df520f2 commit 17f28ac

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,26 @@ RNCallKeep.setup(options);
8585
Any additional permissions you'd like your app to have at first launch. Can be used to simplify permission flows and avoid
8686
multiple popups to the user at different times.
8787

88+
## Constants
89+
90+
To make passing the right integer into methods easier, there are constants that are exported from the module.
91+
92+
```
93+
const CONSTANTS = {
94+
END_CALL_REASONS: {
95+
FAILED: 1,
96+
REMOTE_ENDED: 2,
97+
UNANSWERED: 3,
98+
ANSWERED_ELSEWHERE: 4,
99+
DECLINED_ELSEWHERE: 5
100+
}
101+
};
102+
103+
const { CONSTANTS as CK_CONSTANTS, RNCallKeep } from 'react-native-callkeep';
104+
105+
console.log(CK_CONSTANTS.END_CALL_REASONS.FAILED) // outputs 1
106+
```
107+
88108
## Methods
89109

90110
### setAvailable
@@ -239,7 +259,7 @@ RNCallKeep.reportEndCallWithUUID(uuid, reason);
239259
- Remote user ended call: 2
240260
- Remote user did not answer: 3
241261
- Call Answered elsewhere: 4
242-
- Call declined elsewhere: 5 (iOS only)
262+
- Call declined elsewhere: 5 (on iOS this will map to Remote user ended call if you use the constants)
243263
- Access reasons as constants
244264
```js
245265
const { CONSTANTS as CK_CONSTANTS, RNCallKeep } from 'react-native-callkeep';

0 commit comments

Comments
 (0)