diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 71ebe58..41d827f 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -360,7 +360,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { * @param {boolean} screenRecording A boolean to enable or disable screen recording attachments. */ @ReactMethod - public void setAttachmentTypesEnabled(boolean screenshot, boolean extraScreenshot, boolean + public void setEnabledAttachmentTypes(boolean screenshot, boolean extraScreenshot, boolean galleryImage, boolean screenRecording) { try { Instabug.setAttachmentTypesEnabled(screenshot, extraScreenshot, galleryImage, diff --git a/index.js b/index.js index 4b62481..2adfb8d 100644 --- a/index.js +++ b/index.js @@ -391,6 +391,24 @@ module.exports = { Instabug.setString(string, key); }, + /** + * @deprecated since version 2.3.0. Use {@link setEnabledAttachmentTypes} instead. + * Sets whether attachments in bug reporting and in-app messaging are enabled or not. + * @param {boolean} screenshot A boolean to enable or disable screenshot attachments. + * @param {boolean} extraScreenshot A boolean to enable or disable extra + * screenshot attachments. + * @param {boolean} galleryImage A boolean to enable or disable gallery image + * attachments. In iOS 10+,NSPhotoLibraryUsageDescription should be set in + * info.plist to enable gallery image attachments. + * @param {boolean} voiceNote A boolean to enable or disable voice note attachments. + * In iOS 10+, NSMicrophoneUsageDescription should be set in info.plist to enable + * voiceNote attachments. + * @param {boolean} screenRecording A boolean to enable or disable screen recording attachments. + */ + setAttachmentTypesEnabled: function (screenshot, extraScreenshot, galleryImage, voiceNote, screenRecording) { + Instabug.setEnabledAttachmentTypes(screenshot, extraScreenshot, galleryImage, screenRecording); + }, + /** * Sets whether attachments in bug reporting and in-app messaging are enabled or not. * @param {boolean} screenshot A boolean to enable or disable screenshot attachments. @@ -401,8 +419,8 @@ module.exports = { * info.plist to enable gallery image attachments. * @param {boolean} screenRecording A boolean to enable or disable screen recording attachments. */ - setAttachmentTypesEnabled: function (screenshot, extraScreenshot, galleryImage, screenRecording) { - Instabug.setAttachmentTypesEnabled(screenshot, extraScreenshot, galleryImage, screenRecording); + setEnabledAttachmentTypes: function (screenshot, extraScreenshot, galleryImage, screenRecording) { + Instabug.setEnabledAttachmentTypes(screenshot, extraScreenshot, galleryImage, screenRecording); }, /** diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index bba46b1..bbb0397 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -184,7 +184,7 @@ RCT_EXPORT_METHOD(setString:(NSString*)value toKey:(IBGString)key) { [Instabug setString:value toKey:key]; } -RCT_EXPORT_METHOD(setAttachmentTypesEnabled:(BOOL)screenShot +RCT_EXPORT_METHOD(setEnabledAttachmentTypes:(BOOL)screenShot extraScreenShot:(BOOL)extraScreenShot galleryImage:(BOOL)galleryImage screenRecording:(BOOL)screenRecording) {