Skip to content

Commit 5a628d2

Browse files
authored
💎 Bump to version 8.6.1
1 parent 12faae3 commit 5a628d2

File tree

18 files changed

+41
-113
lines changed

18 files changed

+41
-113
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Version 8.6.1 (2019-08-26)
2+
3+
* Bumps version to 8.6 to be in sync with other platforms.
4+
* Updates native SDK dependencies to 8.6.1.
5+
16
## Version 1.0.0 (2019-07-29)
27

38
**⚠️ Package on pub has been renamed to `instabug_flutter` the old package `instabug` is deprecated**
@@ -72,4 +77,4 @@
7277
Adds the following APIs:
7378

7479
* start(String token, List<InvocationEvent> invocationEvents)
75-
* showWelcomeMessageWithMode(WelcomeMessageMode welcomeMessageMode)
80+
* showWelcomeMessageWithMode(WelcomeMessageMode welcomeMessageMode)

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
A Flutter plugin for [Instabug](https://instabug.com/).
66

7-
⚠️ While this plugin is currently in beta, it's safe to start using it and ship apps with it to production. If you'd like to give us [feedback](https://github.com/Instabug/Instabug-Flutter/issues) or create a [pull request](https://github.com/Instabug/Instabug-Flutter/pulls), we would highly appreciate it!
8-
97
## Available Features
108

119
| Feature | Status |

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ android {
3434
}
3535

3636
dependencies {
37-
implementation 'com.instabug.library:instabug:8.5.0.1'
37+
implementation 'com.instabug.library:instabug:8.6.1.0'
3838
testImplementation 'junit:junit:4.12'
3939
}

android/src/main/java/com/instabug/instabugflutter/ArgsRegistry.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ final class ArgsRegistry {
5252
registerWelcomeMessageArgs(ARGS);
5353
registerColorThemeArgs(ARGS);
5454
registerLocaleArgs(ARGS);
55-
registerInvocationModeArgs(ARGS);
5655
registerInvocationOptionsArgs(ARGS);
5756
registerCustomTextPlaceHolderKeysArgs(ARGS);
5857
registerInstabugReportTypesArgs(ARGS);
@@ -119,11 +118,6 @@ static void registerColorThemeArgs(Map<String, Object> args) {
119118
args.put("ColorTheme.dark", InstabugColorTheme.InstabugColorThemeDark);
120119
}
121120

122-
static void registerInvocationModeArgs(Map<String, Object> args) {
123-
args.put("InvocationMode.bug", BugReporting.ReportType.BUG);
124-
args.put("InvocationMode.feedback", BugReporting.ReportType.FEEDBACK);
125-
}
126-
127121
static void registerInvocationOptionsArgs(Map<String, Object> args) {
128122
args.put("InvocationOption.commentFieldRequired", Option.COMMENT_FIELD_REQUIRED);
129123
args.put("InvocationOption.disablePostSendingDialog", Option.DISABLE_POST_SENDING_DIALOG);
@@ -168,6 +162,7 @@ static void registerCustomTextPlaceHolderKeysArgs(Map<String, Object> args) {
168162
args.put("CustomTextPlaceHolderKey.emailFieldHint", InstabugCustomTextPlaceHolder.Key.EMAIL_FIELD_HINT);
169163
args.put("CustomTextPlaceHolderKey.commentFieldHintForBugReport", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_BUG_REPORT);
170164
args.put("CustomTextPlaceHolderKey.commentFieldHintForFeedback", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_FEEDBACK);
165+
args.put("CustomTextPlaceHolderKey.commentFieldHintForQuestion", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_QUESTION);
171166
args.put("CustomTextPlaceHolderKey.addVoiceMessage", InstabugCustomTextPlaceHolder.Key.ADD_VOICE_MESSAGE);
172167
args.put("CustomTextPlaceHolderKey.addImageFromGallery", InstabugCustomTextPlaceHolder.Key.ADD_IMAGE_FROM_GALLERY);
173168
args.put("CustomTextPlaceHolderKey.addExtraScreenshot", InstabugCustomTextPlaceHolder.Key.ADD_EXTRA_SCREENSHOT);
@@ -194,6 +189,7 @@ static void registerCustomTextPlaceHolderKeysArgs(Map<String, Object> args) {
194189
static void registerInstabugReportTypesArgs(Map<String, Object> args) {
195190
args.put("ReportType.bug", BugReporting.ReportType.BUG);
196191
args.put("ReportType.feedback", BugReporting.ReportType.FEEDBACK);
192+
args.put("ReportType.question", BugReporting.ReportType.QUESTION);
197193
}
198194

199195
static void registerInstabugExtendedBugReportModeArgs(Map<String, Object> args) {

android/src/main/java/com/instabug/instabugflutter/InstabugFlutterPlugin.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -315,27 +315,6 @@ public void run() {
315315
});
316316
}
317317

318-
/**
319-
* invoke sdk manually with desire invocation mode
320-
*
321-
* @param invocationMode the invocation mode
322-
* @param invocationOptions the array of invocation options
323-
*/
324-
public void invokeWithMode(String invocationMode, List<String> invocationOptions) {
325-
switch (invocationMode) {
326-
case "InvocationMode.chats" : Chats.show();
327-
return;
328-
case "InvocationMode.replies" : Replies.show();
329-
return;
330-
}
331-
int[] options = new int[invocationOptions.size()];
332-
for (int i = 0; i < invocationOptions.size(); i++) {
333-
options[i] = ArgsRegistry.getDeserializedValue(invocationOptions.get(i), Integer.class);
334-
}
335-
int invMode = ArgsRegistry.getDeserializedValue(invocationMode, Integer.class);
336-
BugReporting.show(invMode, options);
337-
}
338-
339318
/**
340319
* Logs a user event that happens through the lifecycle of the application.
341320
* Logged user events are going to be sent with each report, as well as at the end of a session.

example/android/app/src/androidTest/java/com/instabug/instabugflutterexample/InvokeInstabugUITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void ensureInstabugInvocati1on() throws InterruptedException {
2828
disableScreenShotByMediaProjection();
2929
onView(withResourceName("instabug_floating_button")).perform(click());
3030
Thread.sleep(5000);
31-
onView(withText("Report a problem")).perform(click());
31+
onView(withText("Report a bug")).perform(click());
3232
Thread.sleep(5000);
3333
onView(withResourceName("instabug_edit_text_email")).perform(replaceText("[email protected]"));
3434
onView(withResourceName("instabug_bugreporting_send")).perform(click());

example/android/app/src/main/java/com/instabug/instabugflutterexample/OnMethodCallTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ public void testAppendTags() {
7777
verify(instabugMock).appendTags(tags);
7878
}
7979

80-
public void testInvokeWithMode() {
81-
String methodName = "invokeWithMode";
80+
public void testShowBugReportingWithReportTypeAndOptions() {
81+
String methodName = "showBugReportingWithReportTypeAndOptions";
8282
ArrayList<Object> argsList = new ArrayList<>();
8383
ArrayList<String> options = new ArrayList<>();
8484
options.add("commentFieldRequired");
8585
options.add("disablePostSendingDialog");
8686
argsList.add("bug");
8787
argsList.add(options);
88-
Mockito.doNothing().when(instabugMock).invokeWithMode(any(String.class),any(ArrayList.class));
88+
Mockito.doNothing().when(instabugMock).showBugReportingWithReportTypeAndOptions(any(String.class),any(ArrayList.class));
8989
testMethodCall(methodName,argsList);
90-
verify(instabugMock).invokeWithMode("bug", options);
90+
verify(instabugMock).showBugReportingWithReportTypeAndOptions("bug", options);
9191
}
9292

9393
public void testSetSessionProfilerEnabled() {

example/android/app/src/test/java/com/instabug/instabugflutterexample/InstabugFlutterPluginTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public void testAppendTags() {
4646
* (String, ArrayList<String>)
4747
*/
4848
@Test
49-
public void testInvokeWithMode() {
50-
new OnMethodCallTests().testInvokeWithMode();
49+
public void testShowBugReportingWithReportTypeAndOptions() {
50+
new OnMethodCallTests().testShowBugReportingWithReportTypeAndOptions();
5151
}
5252

5353
/**

example/ios/instabug_flutter_exampleTests/instabug_flutter_exampleTests.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ - (void)testAppendTags {
6464
[[[mock verify] classMethod] appendTags:tags];
6565
}
6666

67-
- (void)testInvokeWithMode {
67+
- (void)testShowBugReportingWithReportTypeAndOptions {
6868
id mock = OCMClassMock([InstabugFlutterPlugin class]);
6969
InstabugFlutterPlugin *instabug = [[InstabugFlutterPlugin alloc] init];
7070
id result;
7171

7272
NSArray *options = [NSArray arrayWithObjects:@"commentFieldRequired", @"disablePostSendingDialog", nil];
7373
NSArray *arguments = [NSArray arrayWithObjects:@"bug", options, nil];
74-
FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"invokeWithMode:options:" arguments:arguments];
75-
[[[mock stub] classMethod] invokeWithMode:@"bug"options:options];
74+
FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"showBugReportingWithReportTypeAndOptions:options:" arguments:arguments];
75+
[[[mock stub] classMethod] showBugReportingWithReportTypeAndOptions:@"bug"options:options];
7676
[instabug handleMethodCall:call result:result];
77-
[[[mock verify] classMethod] invokeWithMode:@"bug"options:options];
77+
[[[mock verify] classMethod] showBugReportingWithReportTypeAndOptions:@"bug"options:options];
7878
}
7979

8080
- (void)testSetSessionProfilerEnabled {

example/ios/instabug_flutter_exampleUITests/instabug_flutter_exampleUITests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ - (void)testInstabugSendBugReport {
2424
XCUIApplication *app = [[XCUIApplication alloc] init];
2525
XCUIElement *ibgfloatingbuttonaccessibilityidentifierElement = app/*@START_MENU_TOKEN@*/.otherElements[@"IBGFloatingButtonAccessibilityIdentifier"]/*[[".otherElements[@\"Floating Button\"]",".otherElements[@\"IBGFloatingButtonAccessibilityIdentifier\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/;
2626
[ibgfloatingbuttonaccessibilityidentifierElement tap];
27-
[app.tables/*@START_MENU_TOKEN@*/.staticTexts[@"Report a problem"]/*[[".cells[@\"Report a problem\"].staticTexts[@\"Report a problem\"]",".cells[@\"IBGReportBugPromptOptionAccessibilityIdentifier\"].staticTexts[@\"Report a problem\"]",".staticTexts[@\"Report a problem\"]"],[[[-1,2],[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/ tap];
27+
[app.tables.staticTexts[@"Report a bug"] tap];
2828

2929
XCUIElement *textField = app.scrollViews.otherElements.textFields[@"IBGBugInputViewEmailFieldAccessibilityIdentifier"];
3030
[textField tap];
@@ -33,7 +33,7 @@ - (void)testInstabugSendBugReport {
3333
[app.menuItems[@"Select All"] tap];
3434
}
3535
[textField typeText:@"[email protected]"];
36-
[app.navigationBars[@"Report a problem"]/*@START_MENU_TOKEN@*/.buttons[@"IBGBugVCNextButtonAccessibilityIdentifier"]/*[[".buttons[@\"Send\"]",".buttons[@\"IBGBugVCNextButtonAccessibilityIdentifier\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/ tap];
36+
[app.navigationBars[@"Report a bug"]/*@START_MENU_TOKEN@*/.buttons[@"IBGBugVCNextButtonAccessibilityIdentifier"]/*[[".buttons[@\"Send\"]",".buttons[@\"IBGBugVCNextButtonAccessibilityIdentifier\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/ tap];
3737

3838
XCUIElement *element = app.staticTexts[@"Thank you"];
3939
[self waitForElementToAppear:element withTimeout:5];

example/lib/main.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class _MyAppState extends State<MyApp> {
3131
try {
3232
if (Platform.isIOS) {
3333
Instabug.start('efa41f402620b5654f2af2b86e387029', <InvocationEvent>[InvocationEvent.floatingButton]);
34+
BugReporting.setReportTypes([ReportType.bug, ReportType.feedback]);
3435
}
3536
} on PlatformException {
3637
platformVersion = 'Failed to get platform version.';
@@ -50,15 +51,15 @@ class _MyAppState extends State<MyApp> {
5051
}
5152

5253
void sendBugReport() {
53-
BugReporting.invoke(InvocationMode.bug, [InvocationOption.emailFieldOptional]);
54+
BugReporting.show(ReportType.bug, [InvocationOption.emailFieldOptional]);
5455
}
5556

5657
void sendFeedback() {
57-
BugReporting.invoke(InvocationMode.feedback, [InvocationOption.emailFieldOptional]);
58+
BugReporting.show(ReportType.feedback, [InvocationOption.emailFieldOptional]);
5859
}
5960

60-
void startNewConversation () {
61-
Chats.show();
61+
void askQuestion() {
62+
BugReporting.show(ReportType.question, [InvocationOption.emailFieldOptional]);
6263
}
6364

6465
void showNpsSurvey() {
@@ -136,9 +137,9 @@ class _MyAppState extends State<MyApp> {
136137
margin: const EdgeInsets.only(left: 20.0, right: 20.0),
137138
// height: double.infinity,
138139
child: RaisedButton(
139-
onPressed: startNewConversation,
140+
onPressed: askQuestion,
140141
textColor: Colors.white,
141-
child: Text('Start a New Conversation'),
142+
child: Text('Ask a Question'),
142143
color: Colors.lightBlue),
143144
),
144145
Container(

ios/Classes/InstabugFlutterPlugin.m

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -246,30 +246,6 @@ + (void) show {
246246
[Instabug show];
247247
}
248248

249-
/**
250-
* invoke sdk manually with desire invocation mode
251-
*
252-
* @param invocationMode the invocation mode
253-
* @param invocationOptions the array of invocation options
254-
*/
255-
+ (void) invokeWithMode:(NSString *)invocationMode options:(NSArray*)invocationOptionsArray {
256-
if ([invocationMode isEqualToString:@"InvocationMode.chats"]) {
257-
[IBGChats show];
258-
return;
259-
}
260-
if ([invocationMode isEqualToString:@"InvocationMode.replies"]) {
261-
[IBGReplies show];
262-
return;
263-
}
264-
NSDictionary *constants = [self constants];
265-
NSInteger invocationOptions = 0;
266-
for (NSString * invocationOption in invocationOptionsArray) {
267-
invocationOptions |= ((NSNumber *) constants[invocationOption]).integerValue;
268-
}
269-
NSInteger invocation = ((NSNumber *) constants[invocationMode]).integerValue;
270-
[IBGBugReporting showWithReportType:invocation options:invocationOptions];
271-
}
272-
273249
/**
274250
* Logs a user event that happens through the lifecycle of the application.
275251
* Logged user events are going to be sent with each report, as well as at the end of a session.
@@ -493,7 +469,7 @@ + (void)setInvocationOptions:(NSArray *)invocationOptionsArray {
493469
for (NSString * invocationOption in invocationOptionsArray) {
494470
invocationOptions |= ((NSNumber *) constants[invocationOption]).integerValue;
495471
}
496-
IBGBugReporting.invocationOptions = invocationOptions;
472+
IBGBugReporting.bugReportingOptions = invocationOptions;
497473
}
498474

499475
/**
@@ -771,9 +747,6 @@ + (NSDictionary *)constants {
771747
@"ColorTheme.dark": @(IBGColorThemeDark),
772748
@"ColorTheme.light": @(IBGColorThemeLight),
773749

774-
@"InvocationMode.bug": @(IBGBugReportingReportTypeBug),
775-
@"InvocationMode.feedback": @(IBGBugReportingReportTypeFeedback),
776-
777750
@"InvocationOption.commentFieldRequired": @(IBGBugReportingOptionCommentFieldRequired),
778751
@"InvocationOption.disablePostSendingDialog": @(IBGBugReportingOptionDisablePostSendingDialog),
779752
@"InvocationOption.emailFieldHidden": @(IBGBugReportingOptionEmailFieldHidden),
@@ -809,6 +782,7 @@ + (NSDictionary *)constants {
809782
@"CustomTextPlaceHolderKey.emailFieldHint": kIBGEmailFieldPlaceholderStringName,
810783
@"CustomTextPlaceHolderKey.commentFieldHintForBugReport": kIBGCommentFieldPlaceholderForBugReportStringName,
811784
@"CustomTextPlaceHolderKey.commentFieldHintForFeedback": kIBGCommentFieldPlaceholderForFeedbackStringName,
785+
@"CustomTextPlaceHolderKey.commentFieldHintForQuestion": kIBGCommentFieldPlaceholderForQuestionStringName,
812786
@"CustomTextPlaceHolderKey.addVoiceMessage": kIBGAddVoiceMessageStringName,
813787
@"CustomTextPlaceHolderKey.addImageFromGallery": kIBGAddImageFromGalleryStringName,
814788
@"CustomTextPlaceHolderKey.addExtraScreenshot": kIBGAddExtraScreenshotStringName,
@@ -833,6 +807,7 @@ + (NSDictionary *)constants {
833807

834808
@"ReportType.bug": @(IBGBugReportingReportTypeBug),
835809
@"ReportType.feedback": @(IBGBugReportingReportTypeFeedback),
810+
@"ReportType.question": @(IBGBugReportingReportTypeQuestion),
836811

837812
@"ExtendedBugReportMode.enabledWithRequiredFields": @(IBGExtendedBugReportModeEnabledWithRequiredFields),
838813
@"ExtendedBugReportMode.enabledWithOptionalFields": @(IBGExtendedBugReportModeEnabledWithOptionalFields),

ios/instabug_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A new flutter plugin project.
1515
s.source_files = 'Classes/**/*'
1616
s.public_header_files = 'Classes/**/*.h'
1717
s.dependency 'Flutter'
18-
s.dependency 'Instabug', '8.5.2'
18+
s.dependency 'Instabug', '8.6.1'
1919

2020
s.ios.deployment_target = '10.0'
2121
s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-framework "Flutter" -framework "Instabug"'}

lib/BugReporting.dart

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enum InvocationOption {
1111

1212
enum DismissType { cancel, submit, addAttachment }
1313

14-
enum ReportType { bug, feedback, other }
14+
enum ReportType { bug, feedback, question, other }
1515

1616
enum ExtendedBugReportMode {
1717
enabledWithRequiredFields,
@@ -71,24 +71,6 @@ class BugReporting {
7171
}
7272
}
7373

74-
/// invoke sdk manually with desire invocation mode
75-
/// [invocationMode] the invocation mode
76-
/// [invocationOptions] the array of invocation options
77-
static void invoke(InvocationMode invocationMode,
78-
[List<InvocationOption> invocationOptions]) async {
79-
final List<String> invocationOptionsStrings = <String>[];
80-
if (invocationOptions != null) {
81-
invocationOptions.forEach((e) {
82-
invocationOptionsStrings.add(e.toString());
83-
});
84-
}
85-
final List<dynamic> params = <dynamic>[
86-
invocationMode.toString(),
87-
invocationOptionsStrings
88-
];
89-
await _channel.invokeMethod<Object>('invokeWithMode:options:', params);
90-
}
91-
9274
///Enables and disables manual invocation and prompt options for bug and feedback.
9375
/// [boolean] isEnabled
9476
static void setEnabled(bool isEnabled) async {

lib/Chats.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ class Chats {
88
final String version = await _channel.invokeMethod('getPlatformVersion');
99
return version;
1010
}
11-
11+
12+
@deprecated
13+
///Use {@link BugReporting.show} instead.
1214
///Manual invocation for chats view.
1315
static void show() async {
1416
await _channel.invokeMethod<Object>('showChats');
1517
}
1618

19+
@deprecated
20+
///Use {@link BugReporting.setReportTypes} instead.
1721
/// Enables and disables everything related to creating new chats.
1822
/// [boolean] isEnabled
1923
static void setEnabled(bool isEnabled) async {

lib/Instabug.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ enum IBGLocale {
3939
norwegian
4040
}
4141

42-
enum InvocationMode { bug, feedback, chats, replies }
43-
4442
enum ColorTheme { dark, light }
4543

4644
enum CustomTextPlaceHolderKey {
@@ -55,6 +53,7 @@ enum CustomTextPlaceHolderKey {
5553
emailFieldHint,
5654
commentFieldHintForBugReport,
5755
commentFieldHintForFeedback,
56+
commentFieldHintForQuestion,
5857
addVoiceMessage,
5958
addImageFromGallery,
6059
addExtraScreenshot,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: instabug_flutter
2-
version: 1.0.0
2+
version: 8.6.1
33
description: >-
44
Instabug is an in-app feedback and bug reporting tool for mobile apps.
55
With just a simple shake, your users or beta testers can report bugs or

test/instabug_flutter_test.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,17 +256,6 @@ test('startWithToken:invocationEvents: Test', () async {
256256
]);
257257
});
258258

259-
260-
test('invokeWithMode:options: Test', () async {
261-
BugReporting.invoke(InvocationMode.bug, [InvocationOption.commentFieldRequired]);
262-
final List<dynamic> args = <dynamic>[InvocationMode.bug.toString(), <String>[InvocationOption.commentFieldRequired.toString()]];
263-
expect(log, <Matcher>[
264-
isMethodCall('invokeWithMode:options:',
265-
arguments: args,
266-
)
267-
]);
268-
});
269-
270259
test('logUserEventWithName: Test', () async {
271260
Instabug.logUserEvent(name);
272261
final List<dynamic> args = <dynamic>[name];

0 commit comments

Comments
 (0)