📝 Adjust setAttachmentTypesEnabled api to account for the change in the native api and removing the voice note attribute

This commit is contained in:
Salma ElTarzi 2018-01-06 13:11:23 +02:00
parent 0d6e4ae960
commit d2cf3479e9
2 changed files with 20 additions and 12 deletions

View File

@ -402,9 +402,7 @@ module.exports = {
* @param {boolean} screenRecording A boolean to enable or disable screen recording attachments.
*/
setAttachmentTypesEnabled: function (screenshot, extraScreenshot, galleryImage, screenRecording) {
if(Platform.OS == 'android')
Instabug.setAttachmentTypesEnabled(screenshot, extraScreenshot, galleryImage, screenRecording);
},
/**

View File

@ -9,6 +9,7 @@
#import <asl.h>
#import <React/RCTLog.h>
#import <os/log.h>
#import <InstabugCore/IBGTypes.h>
@implementation InstabugReactBridge
@ -184,16 +185,25 @@ RCT_EXPORT_METHOD(setString:(NSString*)value toKey:(IBGString)key) {
}
RCT_EXPORT_METHOD(setAttachmentTypesEnabled:(BOOL)screenShot
extraScreenShot:(BOOL)extraScreenShot
galleryImage:(BOOL)galleryImage
voiceNote:(BOOL)voiceNote
screenRecording:(BOOL)screenRecording) {
[Instabug setAttachmentTypesEnabledScreenShot:screenShot
extraScreenShot:extraScreenShot
galleryImage:galleryImage
voiceNote:voiceNote
screenRecording:screenRecording];
}
extraScreenShot:(BOOL)extraScreenShot
galleryImage:(BOOL)galleryImage
screenRecording:(BOOL)screenRecording) {
IBGAttachmentType attachmentTypes = 0;
if(screenShot) {
attachmentTypes = IBGAttachmentTypeScreenShot;
}
if(extraScreenShot) {
attachmentTypes |= IBGAttachmentTypeExtraScreenShot;
}
if(galleryImage) {
attachmentTypes |= IBGAttachmentTypeGalleryImage;
}
if(screenRecording) {
attachmentTypes |= IBGAttachmentTypeScreenRecording;
}
[Instabug setEnabledAttachmentTypes:attachmentTypes];
}
RCT_EXPORT_METHOD(setChatNotificationEnabled:(BOOL)isChatNotificationEnabled) {
[Instabug setChatNotificationEnabled:isChatNotificationEnabled];