react-native-phone-call - npm

文章推薦指數: 80 %
投票人數:10人

Initiate a phone call in React Native. ... Start using react-native-phone-call in your project by running `npm i react-native-phone-call`. react-native-phone-call1.2.0 • Public • Published2monthsagoReadmeExploreBETA0Dependencies2Dependents12Versions react-native-phone-call InitiateaphonecallinReactNative. react-native-phone-call Background RunningonAndroid RunningoniOSsimulator RunningonAndroidSDK30+ Limitations Install Usage Examplewithphoneandextension. API Contributing License Background ThisisasmallwrapperthatallowsyoutoinitiateaphonecallinReactNative. RunningonAndroid RunningoniOSsimulator WhenrunningontheiOSsimulator,youwillgetatheURLisinvaliderror.Thiswillworkonanactualdevice.TheiOSsimulatordoesnothaveaccesstothedialerapp.. RunningonAndroidSDK30+ AndroidSDK30introducedchangesaroundhowappscanqueryandinteractwithotherapps.ThismeansLinking.canOpenURLreturnsfalseforalllinksunlessaelementisaddedtoAndroidManifest.xml.Addingthefollowingintenttoandroid/app/src/main/AndroidManifest.xmlshouldresolvetheissue: Limitations ThismoduleonlyprovidesasimplewrapperaroundtheLinkingAPIandisthuslimitedinthefunctionalityitcanprovide.Ifyouarelookingforadditionalfunctionality,suchasbeingabletoinitiateaphonecallwithoutuserconfirmation,pleaseuseotherpackageslikereact-native-immediate-phone-call. Install Installthepackagelocallywithinyouprojectfolderwithyourpackagemanager: Withnpm: npminstallreact-native-phone-call Withyarn: yarnaddreact-native-phone-call Usage Tousethemodule,callthefunctionwithanobjectcontainingthenumbertocallasaargument. importcallfrom'react-native-phone-call' constargs={ number:'9093900003',//Stringvaluewiththenumbertocall prompt:false,//Optionalbooleanproperty.Determinesiftheusershouldbepromptedpriortothecall skipCanOpen:true//SkipthecanOpenURLcheck } call(args).catch(console.error) Examplewithphoneandextension. Usecommastoaddtimebetweenpressingdifferentdigits.(ex.dialanumberandwaittobeconnectedandmenutostartbeingread.Pressanumberforanextension.Evenwaitlongerforanothermenusandpressanothernumberforanotherextension.) constargs={ number:'9093900003,,,3,,,274',//Usecommastoaddtimebetweendigits. prompt:false } call(args).catch(console.error) API Forallconfigurationoptions,pleaseseetheAPIdocs. Contributing Gotanideaforanewfeature?Foundabug?Contributionsarewelcome!Pleaseopenupanissueormakeapullrequest. License MIT©TiaanduPlessis Keywordsreactreact-nativecallphone-callphonetelInstallnpmireact-native-phone-callRepositoryGitgithub.com/tiaanduplessis/react-native-phone-callHomepagegithub.com/tiaanduplessis/react-native-phone-call#readmeDownloadsWeeklyDownloads11,274Version1.2.0LicenseMITUnpackedSize6.93kBTotalFiles4Lastpublish2monthsagoCollaboratorsTryonRunKitReportmalware



請為這篇文章評分?