The following API allows you to control when the session gets recorded.
Start Recording
Start the UXCam application to verify the API key with the server, get the settings configurations and start capturing the data according to the configuration.
UXCam.start(withKey appKey: String)
//With completion handler
UXCam.start(withKey appKey: String, completionBlock sessionStartedBlock: ((Bool) -> Void)? = nil)
UXCam.startWithKey(String appKey);
UXCam.StartWithKey(string appKey);
RNUxcam.startWithKey: (appKey: string) => void
UXCam.startWithKey: (appKey: string) => void
void startWithKey(String appKey)
The API parameters are:
appKey: App-key (found on UXCam dashboard).
completionBlock: Optional (iOS only).
Important: Please keep in mind that you just need one call of this method per session to avoid any type of inconsistencies.
Stop Recording
UXCam automatically stops a session when the app goes to the background. Using this API you are going to be able to stop a session and upload it.
This is useful for:
- Recording a specific flow without sending the application to the background.
- Sending data (events, gestures, etc.) in a session without the closure of an app.
UXCam.stopSessionAndUploadData()
//With completion handler
UXCam.stopSessionAndUploadData(_ block: (() -> Void)? = nil)
UXCam.stopSessionAndUploadData();
void UXCam.StopSessionAndUploadData()
RNUxcam.stopSessionAndUploadData: () => void
UXCam.stopSessionAndUploadData: () => void
void stopSessionAndUploadData()
Cancel Recording
This is used to cancel the recording of the current session. By doing this, all the data (video recording, gestures, events, etc.) is going to get discarded.
This can be used when you don't want to send the session to UXCam because:
- The specific flow in the app has an unwanted endpoint.
- The data of a current session is not needed for analysis.
UXCam.cancelCurrentSession()
UXCam.cancelCurrentSession();
void UXCam.CancelCurrentSession()
RNUxcam.cancelCurrentSession: () => void
UXCam.cancelCurrentSession: () => void
void cancelCurrentSession()
Allow a Short Break for Another App
This API allows the user to take a short trip to another app without causing a break in the current session.
This is useful when users need to use another app to complete a certain process like:
- A login using Google, Facebook, etc.
- Navigating to another URL using an external browser.
- Taking a picture in order to complete a setup process.
- Getting the OTP and/or verification email to complete a process.
- Obtaining the confirmation of a payment through an external resource.
UXCam.allowShortBreak(forAnotherApp continueSession: Bool)
UXCam.allowShortBreakForAnotherApp(boolean continueSession);
//With waiting time
UXCam.allowShortBreakForAnotherApp(int timeInMilliseconds);
void UXCam.AllowShortBreakForAnotherApp(bool continueSession)
//Android only
void UXCam.AllowShortBreakForAnotherApp(int timeInMilliseconds)
RNUxcam.allowShortBreakForAnotherApp: (continueSession: number | boolean) => void
UXCam.allowShortBreakForAnotherApp: (continueSession: boolean) => void
void allowShortBreakForAnotherApp(bool continueSession)
The API parameters are:
continueSession: Set to TRUE to continue the current session after a short trip out to another app. Default is FALSE - stops the session as soon as the app enters the background.
timeInMilliseconds: Android only. Time to wait before closing current session. By default the method will wait 180000ms (3 min) to end the session.
Important: To avoid any inconsistencies, set allowShortBreak(true) before navigating to another app and call allowShortBreak(false) after returning to the app.
Add Verification Listener
With this API you are going to be able to get the verification status when UXCam starts recording a session.
By getting this you are going to be able to:
- Send events to UXCam as soon as the session starts.
- Log the current UXCam session URL or the user URL to other 3rd party services such as Firebase.
Doesn't exist on iOS - use startWithKey with completion handler.
UXCam.addVerificationListener(OnVerificationListener listener)
//Example:
UXCam.addVerificationListener(new OnVerificationListener() {
@Override
public void onVerificationSuccess() {
//Do Something here
}
@Override
public void onVerificationFailed(String errorMessage) {
//Do Something here
}
});
//To remove
UXCam.removeVerificationListener(OnVerificationListener listener);
//Android only - use callback action for iOS.
UXCam.AddVerificationListener(OnVerificationListener listener)
//Example:
UXCam.AddVerificationListener(new IOnVerificationListener());
class IOnVerificationListener : Java.Lang.Object, Com.UXCam.IOnVerificationListener
{
public void OnVerificationFailed(string p0)
{
//Do Something here
}
public void OnVerificationSuccess()
{
//Do Something here
}
}
//To remove
UXCam.RemoveVerificationListener(OnVerificationListener listener);
import { NativeModules, NativeEventEmitter } from 'react-native';
const emitter = new NativeEventEmitter(NativeModules.RNUxcam)
this.uxcamListener = emitter.addListener('UXCam_Verification_Event', async (status) => {
if (status.success){
//Do Something here
}
})
//To remove
uxcamListener.remove()
Not supported
Not supported
Delete Pending Records
Sessions can get tagged as pending due to different factors. This are some of them:
- Poor internet connection or mobile data from the user.
- The app suffered a crash preventing the session to be uploaded.
With this API you are going to be able to delete all of the pending sessions that are not being sent due to these factors.
UXCam.deletePendingUploads()
//get pending uploads count
UXCam.pendingUploads() -> UInt
void deletePendingUploads()
//get pending uploads count
int pendingSessionCount()
void DeletePendingUploads()
//get pending uploads count
int PendingSessionCount()
RNUxcam.deletePendingUploads: () => void
//get pending uploads count
RNUxcam.pendingSessionCount: () => number
UXCam.deletePendingUploads: () => void
//get pending uploads count
UXCam.pendingSessionCount: () => number
void deletePendingUploads()
//get pending uploads count
Future<int> pendingUploads()
Upload Pending Session
IOS only. This API can be used to load all pending sessions that are not sent due to the factors mentioned above.
UXCam.uploadingPendingSessions(_ block: (() -> Void)? = nil)
Not supported
void UploadPendingSession(System.Action?.block)
RNUxcam.uploadPendingSession: () => void
UXCam.uploadPendingSession: () => void
void uploadPendingSession()