我正在为我的应用程序使用可编程语音(呼出API)。当我使用此API调用客户端时,如果客户端未响应该调用,我将得到相同的响应状态“ NO ANSWER”。如果客户端没有Internet连接,换句话说,数据已关闭,那么我的响应状态也将是“ NO ANSWER”。
因此,在这种情况下(互联网关闭或客户端未接听电话。),我该如何区分是否收到“ NO ANSWER”。
尝试使用此库
https://www.npmjs.com/package/react-native-phone-call
$ npm install --save react-native-phone-call
import call from 'react-native-phone-call'
const args = {
number: '9093900003', // String value with the number to call
prompt: false // Optional boolean property. Determines if the user should be prompt prior to the call
}
call(args).catch(console.error)
也许在捕获块中您可以捕获未解决的行为