Skip to content

Commit 2a0a91b

Browse files
authored
🤝 Merge pull request #47 from Instabug/feature/1.8_release
Feature/1.8 release
2 parents 20ec63e + 95663ad commit 2a0a91b

33 files changed

+209
-75
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ android {
2121
}
2222

2323
dependencies {
24-
compile 'com.instabug.library:instabug:4.8.1'
24+
compile 'com.instabug.library:instabug:4.9.0'
2525
compile 'com.android.support:multidex:1.0.0'
2626
}

src/android/IBGPlugin.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.net.Uri;
66
import android.util.Log;
77

8+
import com.instabug.library.Feature;
89
import com.instabug.library.Instabug;
910
import com.instabug.library.invocation.InstabugInvocationEvent;
1011
import com.instabug.library.invocation.InstabugInvocationMode;
@@ -159,7 +160,10 @@ public boolean execute(final String action, JSONArray args, final CallbackContex
159160
} else if ("setVideoRecordingFloatingButtonPosition".equals(action)) {
160161
setVideoRecordingFloatingButtonPosition(callbackContext, args.optString(0));
161162

162-
} else {
163+
} else if ("setViewHierarchyEnabled".equals(action)) {
164+
setViewHierarchyEnabled(callbackContext, args.optBoolean(0));
165+
166+
} else {
163167
// Method not found.
164168
return false;
165169
}
@@ -532,6 +536,27 @@ private void setDebugEnabled(final CallbackContext callbackContext, boolean isDe
532536
}
533537
}
534538

539+
/**
540+
* Enable/Disable view hierarchy from Instabug SDK
541+
*
542+
* @param isEnabled whether view hierarchy should be enabled or not
543+
*
544+
* @param callbackContext
545+
* Used when calling back into JavaScript
546+
*/
547+
private void setViewHierarchyEnabled(final CallbackContext callbackContext, boolean isEnabled) {
548+
try {
549+
if(isEnabled) {
550+
Instabug.setViewHierarchyState(Feature.State.ENABLED);
551+
} else {
552+
Instabug.setViewHierarchyState(Feature.State.DISABLED);
553+
}
554+
callbackContext.success();
555+
} catch (IllegalStateException e) {
556+
callbackContext.error(errorMsg);
557+
}
558+
}
559+
535560
/**
536561
* Sets user attribute to overwrite it's value or create a new one if it doesn't exist.
537562
*

src/ios/IBGPlugin.m

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,29 @@ - (void) setLocale:(CDVInvokedUrlCommand*)command
394394
[self.commandDelegate sendPluginResult:result callbackId:[command callbackId]];
395395
}
396396

397+
/**
398+
* Sets whether user steps tracking is visual, non visula or disabled.
399+
*
400+
* @param {CDVInvokedUrlCommand*} command
401+
* The command sent from JavaScript
402+
*/
403+
- (void) setReproStepsMode:(CDVInvokedUrlCommand*)command
404+
{
405+
CDVPluginResult* result;
406+
407+
IBGUserStepsMode reproStepsMode = [self parseReproStepsMode:[command argumentAtIndex:0]];
408+
409+
if (reproStepsMode) {
410+
[Instabug setReproStepsMode:reproStepsMode];
411+
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
412+
} else {
413+
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
414+
messageAsString:@"A valid user steps mode must be provided."];
415+
}
416+
417+
[self.commandDelegate sendPluginResult:result callbackId:[command callbackId]];
418+
}
419+
397420
/**
398421
* Convenience method for setting whether the email
399422
* field is validated or not.
@@ -437,6 +460,29 @@ - (void) setDefaultInvocationMode:(NSString*)mode {
437460
}
438461
}
439462

463+
/**
464+
* Enable/Disable view hierarchy from Instabug SDK
465+
*
466+
* @param {CDVInvokedUrlCommand*} command
467+
* The command sent from JavaScript
468+
*/
469+
- (void) setViewHierarchyEnabled:(CDVInvokedUrlCommand*)command
470+
{
471+
CDVPluginResult* result;
472+
473+
BOOL isEnabled = [command argumentAtIndex:0];
474+
475+
if (isEnabled) {
476+
[Instabug setViewHierarchyEnabled:isEnabled];
477+
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
478+
} else {
479+
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
480+
messageAsString:@"A boolean value must be provided."];
481+
}
482+
483+
[self.commandDelegate sendPluginResult:result callbackId:[command callbackId]];
484+
}
485+
440486
/**
441487
* Convenience method for setting the threshold value
442488
* of the shake gesture for iPhone/iPod touch and iPad.
@@ -626,6 +672,25 @@ - (IBGInvocationMode) parseIBGPosition:(NSString*)position
626672
} else return 0;
627673
}
628674

675+
676+
/**
677+
* Convenience method for converting NSString to
678+
* IBGUserStepsMode.
679+
*
680+
* @param {NSString*} mode
681+
* NSString shortcode for IBGUserStepsMode
682+
*/
683+
- (IBGUserStepsMode) parseReproStepsMode:(NSString*)mode
684+
{
685+
if ([mode isEqualToString:@"enabled"]) {
686+
return IBGUserStepsModeEnable;
687+
} else if ([mode isEqualToString:@"disabled"]) {
688+
return IBGUserStepsModeDisable;
689+
} else if ([mode isEqualToString:@"enabledWithNoScreenshot"]) {
690+
return IBGUserStepsModeEnabledWithNoScreenshots;
691+
} else return 0;
692+
}
693+
629694
/**
630695
* Convenience method for converting NSString to
631696
* IBGLocale.

src/ios/Instabug.framework/Headers/Instabug.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Copyright: (c) 2013-2017 by Instabug, Inc., all rights reserved.
77
8-
Version: 7.7.1
8+
Version: 7.8
99
*/
1010

1111
#import <Foundation/Foundation.h>
@@ -160,6 +160,18 @@ typedef void (^NetworkObfuscationCompletionBlock)(NSData *data, NSURLResponse *r
160160
*/
161161
+ (void)setUserStepsEnabled:(BOOL)isUserStepsEnabled;
162162

163+
/**
164+
@brief Sets whether user steps tracking is visual, non visula or disabled.
165+
166+
@discussion Enabling user steps would give you an insight on the scenario a user has performed before encountering a
167+
bug or a crash. User steps are attached with each report being sent.
168+
169+
User Steps tracking is enabled by default if it's available in your current plan.
170+
171+
@param userStepsMode An enum to set user steps tracking to be enabled , non visual or disabled.
172+
*/
173+
+ (void)setReproStepsMode:(IBGUserStepsMode)userStepsMode;
174+
163175
/**
164176
@brief Sets whether to track and report crashes or not.
165177

src/ios/Instabug.framework/Info.plist

-2 Bytes
Binary file not shown.

src/ios/Instabug.framework/Instabug

240 Bytes
Binary file not shown.

src/ios/Instabug.framework/_CodeSignature/CodeResources

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<dict>
77
<key>Headers/Instabug.h</key>
88
<data>
9-
dv9gxbikDAknu/WGzN8gkc/4u1w=
9+
7FmPOnvoZEOelRoF+rakHgJyT1E=
1010
</data>
1111
<key>Info.plist</key>
1212
<data>
13-
PqPlFUga6XC2bwuhVcghAFTYUrk=
13+
Hdm1Q2muThmGWWJRk3FelfsOPV0=
1414
</data>
1515
<key>Modules/module.modulemap</key>
1616
<data>
@@ -23,11 +23,11 @@
2323
<dict>
2424
<key>hash</key>
2525
<data>
26-
dv9gxbikDAknu/WGzN8gkc/4u1w=
26+
7FmPOnvoZEOelRoF+rakHgJyT1E=
2727
</data>
2828
<key>hash2</key>
2929
<data>
30-
Q8wTarNHp6QYAK/yMLfV3pYSGDqe2DwJ1aNPIzdKKLk=
30+
5xZDYfSvxBVD8Xgv2mFfPXWRhCe78P/MG6sCti+sFec=
3131
</data>
3232
</dict>
3333
<key>Modules/module.modulemap</key>

src/ios/InstabugCore.framework/Headers/IBGTypes.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,16 @@ typedef NS_ENUM(NSInteger, IBGLogLevel) {
294294
};
295295

296296
/**
297-
The attachment types selected in Attachment action sheet.
297+
The user steps option.
298+
*/
299+
typedef NS_ENUM(NSInteger, IBGUserStepsMode) {
300+
IBGUserStepsModeEnable,
301+
IBGUserStepsModeEnabledWithNoScreenshots,
302+
IBGUserStepsModeDisable
303+
};
304+
305+
/**
306+
The attachment types selected in Attachment action sheet.
298307
*/
299308
typedef NS_OPTIONS(NSInteger, IBGAttachmentType) {
300309
IBGAttachmentTypeScreenShot = 1 << 1,
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-2 Bytes
Binary file not shown.
-98.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)