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);
UXCam.startWithKey: (appKey: string) => void
void startWithKey(String appKey)
The API parameters are:
appKey: App-key (found on UXCam dashboard).
completionBlock: Optional (iOS only).
Stop Recording
UXCam automatically starts/stops sessions depending on application state. If you want to take control, use this API to stop UXCam session and upload it.
UXCam.stopSessionAndUploadData()
//With completion handler
UXCam.stopSessionAndUploadData(_ block: (() -> Void)? = nil)
UXCam.stopSessionAndUploadData();
void UXCam.StopSessionAndUploadData()
UXCam.stopSessionAndUploadData: () => void
void stopSessionAndUploadData()
Cancel Recording
Cancel the recording of the current session and discard the data.
UXCam.cancelCurrentSession()
UXCam.cancelCurrentSession();
void UXCam.CancelCurrentSession()
UXCam.cancelCurrentSession: () => void
void cancelCurrentSession()
Allow a Short Break for Another App
Prevent a short trip to another app from causing a break in a session. This is useful when your user needs to leave the app for a short amount of time like log-in using google or when you open URL link using an external browser among other use cases.
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)
UXCam.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.
Note: Set to TRUE to continue the current session before a short trip out to another app, and set to FALSE after coming back to the app.
Add Verification Listener
Get verification status when UXCam starts capturing sessions. Its is particularly useful in cases such as,
- When you want to log certain events as soon as the session starts.
- When you want to log current UXCam session or user URL to other 3rd party services.
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
Configure Multisession Recordings
Configure whether UXCam is set to automatically record a new session when the app resumes from the background.
Set whether to automatically record multiple sessions or not. Default is TRUE.
UXCam.setMultiSessionRecord(_ recordMultipleSessions: Bool)
UXCam.setMultiSessionRecord(boolean recordMultipleSessions);
void UXCam.SetMultiSessionRecord(bool recordMultipleSessions)
UXCam.setMultiSessionRecord: (recordMultipleSessions: boolean) => void
void setMultiSessionRecord(bool recordMultipleSessions)
Get current multi session recording status (whether app is set to record multiple sessions or not).
UXCam.getMultiSessionRecord()->Bool
boolean UXCam.getMultiSessionRecord()
bool UXCam.GetMultiSessionRecord()
UXCam.getMultiSessionRecord: () => boolean
Future<bool> getMultiSessionRecord()
Delete Pending Records
Delete sessions that are awaiting to upload.
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()
UXCam.deletePendingUploads: () => void
//get pending uploads count
UXCam.pendingSessionCount: () => number
void deletePendingUploads()
//get pending uploads count
Future<int> pendingUploads()
Upload Pending Session
IOS only. Begin uploading pending sessions.
UXCam.uploadingPendingSessions(_ block: (() -> Void)? = nil)
Not supported
void UploadPendingSession(System.Action?.block)
UXCam.uploadPendingSession: () => void
void uploadPendingSession()