@@ -69,13 +69,13 @@ RNCallKeep.setup(options);
6969 Cancel button label
7070 - ` okButton ` : string (required)
7171 Ok button label
72-
72+
7373## Methods
7474
7575### setAvailable
7676_ This feature is available only on Android._
7777
78- Tell _ ConnectionService_ that the device is ready to accept outgoing calls.
78+ Tell _ ConnectionService_ that the device is ready to accept outgoing calls.
7979If not the user will be stuck in the build UI screen without any actions.
8080Eg: Call it with ` false ` when disconnected from the sip client, when your token expires ...
8181
@@ -207,6 +207,25 @@ _This feature is available only on Android._
207207await RNCallKeep .hasPhoneAccount ();
208208```
209209
210+ ### hasDefaultPhoneAccount
211+
212+ Checks if the user has set a default [ phone account] ( https://developer.android.com/reference/android/telecom/PhoneAccount ) .
213+ If the user has not set a default they will be prompted to do so with an alert.
214+
215+ This is a workaround for an [ issue] ( https://github.com/wazo-pbx/react-native-callkeep/issues/33 ) affecting some Samsung devices.
216+
217+ _ This feature is available only on Android._
218+
219+ ``` js
220+ const options = {
221+ alertTitle: ' Default not set' ,
222+ alertDescription: ' Please set the default phone account'
223+ };
224+
225+ RNCallKeep .hasDefaultPhoneAccount (options);
226+ ```
227+
228+
210229## Events
211230
212231### didReceiveStartCallAction
@@ -219,7 +238,7 @@ After all works are done, remember to call `RNCallKeep.startCall(uuid, calleeNum
219238
220239``` js
221240RNCallKeep .addEventListener (' didReceiveStartCallAction' , ({ handle }) => {
222-
241+
223242});
224243```
225244
@@ -283,7 +302,7 @@ A call was muted by the system or the user:
283302
284303``` js
285304RNCallKeep .addEventListener (' didPerformSetMutedCallAction' , (muted ) => {
286-
305+
287306});
288307
289308```
@@ -293,7 +312,7 @@ A call was held or unheld by the current user
293312
294313``` js
295314RNCallKeep .addEventListener (' didToggleHoldCallAction' , ({ hold, callUUID }) => {
296-
315+
297316});
298317```
299318
@@ -307,7 +326,7 @@ Used type a number on his dialer
307326
308327``` js
309328RNCallKeep .addEventListener (' didPerformDTMFAction' , ({ dtmf, callUUID }) => {
310-
329+
311330});
312331```
313332
@@ -327,9 +346,9 @@ import uuid from 'uuid';
327346class RNCallKeepExample extends React .Component {
328347 constructor (props ) {
329348 super (props);
330-
349+
331350 this .currentCallId = null ;
332-
351+
333352 // Initialise RNCallKeep
334353 const options = {
335354 ios: {
@@ -342,7 +361,7 @@ class RNCallKeepExample extends React.Component {
342361 okButton: ' ok' ,
343362 }
344363 };
345-
364+
346365
347366 try {
348367 RNCallKeep .setup (options);
@@ -369,13 +388,13 @@ class RNCallKeepExample extends React.Component {
369388 onAnswerCallAction = ({ callUUID }) => {
370389 // called when the user answer the incoming call
371390 };
372-
391+
373392 onEndCallAction = ({ callUUID }) => {
374393 RNCallKeep .endCall (this .getCurrentCallId ());
375-
394+
376395 this .currentCallId = null ;
377396 };
378-
397+
379398 onIncomingCallDisplayed = error => {
380399 // You will get this event after RNCallKeep finishes showing incoming call UI
381400 // You can check if there was an error while displaying
@@ -389,7 +408,7 @@ class RNCallKeepExample extends React.Component {
389408 // you might want to do following things when receiving this event:
390409 // - Start playing ringback if it is an outgoing call
391410 };
392-
411+
393412 getCurrentCallId = () => {
394413 if (! this .currentCallId ) {
395414 this .currentCallId = uuid .v4 ();
0 commit comments