setAutoScreenRecordingMaxDuration and setAutoScreenRecordingEnabled APIs

This commit is contained in:
Salma ElTarzi 2018-02-13 20:45:02 +02:00
parent d2126d0667
commit 728b07647a
3 changed files with 59 additions and 0 deletions

View File

@ -233,6 +233,37 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
}
}
/**
* Enable/Disable screen recording
*
* @param autoScreenRecordingEnabled boolean for enable/disable
* screen recording on crash feature
*/
@ReactMethod
public void setAutoScreenRecordingEnabled(boolean autoScreenRecordingEnabled) {
try {
Instabug.setAutoScreenRecordingEnabled(autoScreenRecordingEnabled);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Sets auto screen recording maximum duration
*
* @param autoScreenRecordingMaxDuration maximum duration of the screen recording video
* in milliseconds
* The maximum duration is 30000 milliseconds
*/
@ReactMethod
public void setAutoScreenRecordingMaxDuration(int autoScreenRecordingMaxDuration) {
try {
Instabug.setAutoScreenRecordingMaxDuration(autoScreenRecordingMaxDuration);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Change Locale of Instabug UI elements(defaults to English)
*

View File

@ -60,6 +60,26 @@ module.exports = {
Instabug.setUserData(userData);
},
/**
* Enable/Disable screen recording
* @param {boolean} autoScreenRecordingEnabled boolean for enable/disable
* screen recording on crash feature
*/
setAutoScreenRecordingEnabled: function(autoScreenRecordingEnabled) {
Instabug.setAutoScreenRecordingEnabled(autoScreenRecordingEnabled);
},
/**
* Sets auto screen recording maximum duration
*
* @param autoScreenRecordingMaxDuration maximum duration of the screen recording video
* in milliseconds
* The maximum duration is 30000 milliseconds
*/
setAutoScreenRecordingMaxDuration: function(autoScreenRecordingMaxDuration) {
Instabug.setAutoScreenRecordingMaxDuration(autoScreenRecordingMaxDuration)
},
/**
* Adds custom logs that will be sent with each report.
* @param {string} log Message to be logged.

View File

@ -78,6 +78,14 @@ RCT_EXPORT_METHOD(setUserStepsEnabled:(BOOL)isUserStepsEnabled) {
[Instabug setUserStepsEnabled:isUserStepsEnabled];
}
RCT_EXPORT_METHOD(setAutoScreenRecordingEnabled:(BOOL)enabled) {
[Instabug setAutoScreenRecordingEnabled:enabled];
}
RCT_EXPORT_METHOD(setAutoScreenRecordingMaxDuration:(CGFloat)duration) {
[Instabug setAutoScreenRecordingDuration:duration];
}
RCT_EXPORT_METHOD(setPreSendingHandler:(RCTResponseSenderBlock)callBack) {
if (callBack != nil) {
[Instabug setPreSendingHandler:^{