React native component for Carenation patient app
npm install carenation-react-native-component- https://www.npmjs.com/package/react-native-webview
- https://www.npmjs.com/package/@react-native-firebase/messaging
- https://www.npmjs.com/package/@notifee/react-native
- https://www.npmjs.com/package/react-native-sound-player
- https://www.npmjs.com/package/react-native-volume-manager
- https://www.npmjs.com/package/react-native-incall-manager
- https://www.npmjs.com/package/react-native-fs
- https://www.npmjs.com/package/react-native-file-viewer
- https://www.npmjs.com/package/react-native-toast-message
- https://www.npmjs.com/package/@notifee/react-native
To use the Carenation React Native Custom Component in your project, follow these steps:
1. Install the component package using npm:
``bash`
npm install carenation-react-native-component
`javascript`
import { Carenation, CarenationAiRinger } from 'carenation-react-native-component';
`javascript`
//hierarchy of this component should be higher so it can appear on all screens
onDecline={handleDecline}
onMissed={handleMissed}
/>
apiKey="your_api_key"
identifier="your_identifier"
notificationData="your_notificationData"
setNotificationData={setNotificationData}
triggerAiCheckin={triggerAiCheckin}
domain={domain}
appointmentCallId={appointmentCallId}
OnResetAppointmentCallId={resetAppointmentCallId}
/>
A SampleApp.js is included in the repo to understand the component implementation
Carenation
- apiKey (string, required): Your API key for authentication.
- identifier (string, required): The identifier for the user or session.
- notificationData (optional): Data to be injected into the WebView.
- setNotificationData (function, required): Function to update notification data.
- domain (string, optional): The domain of the web application.
- triggerAiCheckin (Boolean, required): Determine careanation called from notification.
- appPath (string, optional): The path to the specific application.
- appointmentCallId (string, required): To get appointment call ID from Provider, Trainer or Nutritionist Calls
- OnResetAppointmentCallId (function, required): Handle resetting appointment call ID.
CarenationAiRinger
- onAccept (function, required): Handle call accepted event.
- onDecline (function, required): Handle call declined event.
- onMissed (function, required): Returns a event with message is check-in is missed.
Handling Errors
The Carenation component logs errors encountered by the WebView to the console for debugging purposes.
Carenation
- carenationCompRef (required): Used Handle call mechanism for Carenation component.
Copy the ringtone.wav file into the project to use it as the notification tone.
Andriod path
android/app/src/main/res/raw/ringtone.wav
IOS path
ios/Resources/ringtone.wav
Android
`xml
`
IOS
info.plist
`xml`
Podfile
`ruby`
setup_permissions([
'Camera',
'Microphone'
])
To force play audio in speakers add this code in AppDelegate.m
`code
#import
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
``
Teslon Technologies Pvt. Ltd. (the "Company") Proprietary License
1. License Grant: The Company grants you a non-exclusive, non-transferable, revocable license to use the software provided in this package solely for your internal business purposes.
2. Restrictions: You may not distribute, sublicense, or transfer the software to any third party without the prior written consent of the Company. You may not reverse engineer, decompile, disassemble, or attempt to derive the source code of the software.
3. No Warranty: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.