Skip to content

Commit 6ae1d16

Browse files
committed
📝 Deprecated the old setAttachmentTypesEnabled api, and made it point to the new native api
1 parent d2cf347 commit 6ae1d16

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

‎android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public void setPrimaryColor(int primaryColor) {
360360
* @param {boolean} screenRecording A boolean to enable or disable screen recording attachments.
361361
*/
362362
@ReactMethod
363-
public void setAttachmentTypesEnabled(boolean screenshot, boolean extraScreenshot, boolean
363+
public void setEnabledAttachmentTypes(boolean screenshot, boolean extraScreenshot, boolean
364364
galleryImage, boolean screenRecording) {
365365
try {
366366
Instabug.setAttachmentTypesEnabled(screenshot, extraScreenshot, galleryImage,

‎index.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,35 @@ module.exports = {
392392
},
393393

394394
/**
395+
* @deprecated since version 2.3.0. Use {@link setEnabledAttachmentTypes} instead.
395396
* Sets whether attachments in bug reporting and in-app messaging are enabled or not.
396397
* @param {boolean} screenshot A boolean to enable or disable screenshot attachments.
397398
* @param {boolean} extraScreenshot A boolean to enable or disable extra
398399
* screenshot attachments.
399400
* @param {boolean} galleryImage A boolean to enable or disable gallery image
400401
* attachments. In iOS 10+,NSPhotoLibraryUsageDescription should be set in
401402
* info.plist to enable gallery image attachments.
403+
* @param {boolean} voiceNote A boolean to enable or disable voice note attachments.
404+
* In iOS 10+, NSMicrophoneUsageDescription should be set in info.plist to enable
405+
* voiceNote attachments.
402406
* @param {boolean} screenRecording A boolean to enable or disable screen recording attachments.
403407
*/
404-
setAttachmentTypesEnabled: function (screenshot, extraScreenshot, galleryImage, screenRecording) {
405-
Instabug.setAttachmentTypesEnabled(screenshot, extraScreenshot, galleryImage, screenRecording);
408+
setAttachmentTypesEnabled: function (screenshot, extraScreenshot, galleryImage, voiceNote, screenRecording) {
409+
Instabug.setEnabledAttachmentTypes(screenshot, extraScreenshot, galleryImage, screenRecording);
410+
},
411+
412+
/**
413+
* Sets whether attachments in bug reporting and in-app messaging are enabled or not.
414+
* @param {boolean} screenshot A boolean to enable or disable screenshot attachments.
415+
* @param {boolean} extraScreenshot A boolean to enable or disable extra
416+
* screenshot attachments.
417+
* @param {boolean} galleryImage A boolean to enable or disable gallery image
418+
* attachments. In iOS 10+,NSPhotoLibraryUsageDescription should be set in
419+
* info.plist to enable gallery image attachments.
420+
* @param {boolean} screenRecording A boolean to enable or disable screen recording attachments.
421+
*/
422+
setEnabledAttachmentTypes: function (screenshot, extraScreenshot, galleryImage, screenRecording) {
423+
Instabug.setEnabledAttachmentTypes(screenshot, extraScreenshot, galleryImage, screenRecording);
406424
},
407425

408426
/**

‎ios/RNInstabug/InstabugReactBridge.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ - (dispatch_queue_t)methodQueue {
184184
[Instabug setString:value toKey:key];
185185
}
186186

187-
RCT_EXPORT_METHOD(setAttachmentTypesEnabled:(BOOL)screenShot
187+
RCT_EXPORT_METHOD(setEnabledAttachmentTypes:(BOOL)screenShot
188188
extraScreenShot:(BOOL)extraScreenShot
189189
galleryImage:(BOOL)galleryImage
190190
screenRecording:(BOOL)screenRecording) {

0 commit comments

Comments
 (0)