Skip to content

Commit 819c29e

Browse files
authored
* 💎 Bump to version 8.6.4
1 parent 02666da commit 819c29e

File tree

9 files changed

+56
-13
lines changed

9 files changed

+56
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
## Version 8.6.4 (2019-09-16)
2+
3+
* Updates native SDK dependencies to 8.6.3
4+
15
## Version 8.6.3 (2019-09-05)
26

3-
* You can now initialize Instabug on Android by calling `Instabug.start` from Javascript, instead of calling the builder method from the application class.
47
* Updates native SDK dependencies to 8.6.2
58

69
## Version 8.6.1 (2019-08-26)

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ flutter packages get
4444
import 'package:instabug_flutter/Instabug.dart';
4545
```
4646

47-
2. Initialize the SDK in `initState()`. This line enables the SDK with the default behavior and sets it to be shown when the device is shaken.
47+
2. Initialize the SDK in `initState()`. This line enables the SDK with the default behavior and sets it to be shown when the device is shaken. Ignore this if you're building for Android only.
4848

4949
```dart
5050
Instabug.start('APP_TOKEN', [InvocationEvent.shake]);
5151
```
52-
Make sure to replace `app_APP_TOKEN` with your application token.
5352

5453
3. Add the following Maven repository to your project level `build.gradle`
5554

@@ -63,8 +62,24 @@ allprojects {
6362
}
6463
```
6564

65+
Make sure to replace `app_token` with your application token.
6666

67+
4. If your app supports Android, create a new Java class that extends `FlutterApplication` and add it to your `AndroidManifest.xml`.
6768

69+
```xml
70+
<application
71+
android:name=".CustomFlutterApplication"
72+
...
73+
</application>
74+
````
75+
76+
5. In your newly created `CustomFlutterApplication` class, override `onCreate()` and add the following code.
77+
78+
```java
79+
ArrayList<String> invocationEvents = new ArrayList<>();
80+
invocationEvents.add(InstabugFlutterPlugin.INVOCATION_EVENT_SHAKE);
81+
new InstabugFlutterPlugin().start(CustomFlutterApplication.this, "APP_TOKEN", invocationEvents);
82+
```
6883

6984
## Microphone and Photo Library Usage Description (iOS Only)
7085

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.6.3.0'
37+
implementation 'com.instabug.library:instabug:8.6.3.1'
3838
testImplementation 'junit:junit:4.12'
3939
}

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,19 @@
5151
*/
5252
public class InstabugFlutterPlugin implements MethodCallHandler {
5353

54+
final public static String INVOCATION_EVENT_NONE = "InvocationEvent.none";
55+
final public static String INVOCATION_EVENT_SCREENSHOT = "InvocationEvent.screenshot";
56+
final public static String INVOCATION_EVENT_TWO_FINGER_SWIPE_LEFT = "InvocationEvent.twoFingersSwipeLeft";
57+
final public static String INVOCATION_EVENT_FLOATING_BUTTON = "InvocationEvent.floatingButton";
58+
final public static String INVOCATION_EVENT_SHAKE = "InvocationEvent.shake";
59+
5460
private InstabugCustomTextPlaceHolder placeHolder = new InstabugCustomTextPlaceHolder();
5561

5662
static MethodChannel channel;
57-
static Registrar myRegistrar;
5863
/**
5964
* Plugin registration.
6065
*/
6166
public static void registerWith(Registrar registrar) {
62-
myRegistrar = registrar;
6367
channel = new MethodChannel(registrar.messenger(), "instabug_flutter");
6468
channel.setMethodCallHandler(new InstabugFlutterPlugin());
6569
}
@@ -98,18 +102,19 @@ public void onMethodCall(MethodCall call, Result result) {
98102
/**
99103
* starts the SDK
100104
*
105+
* @param application the application Object
101106
* @param token token The token that identifies the app, you can find
102107
* it on your dashboard.
103108
* @param invocationEvents invocationEvents The events that invoke
104109
* the SDK's UI.
105110
*/
106-
public void startWithToken( String token, ArrayList<String> invocationEvents) {
111+
public void start(Application application, String token, ArrayList<String> invocationEvents) {
107112
InstabugInvocationEvent[] invocationEventsArray = new InstabugInvocationEvent[invocationEvents.size()];
108113
for (int i = 0; i < invocationEvents.size(); i++) {
109114
String key = invocationEvents.get(i);
110115
invocationEventsArray[i] = ArgsRegistry.getDeserializedValue(key, InstabugInvocationEvent.class);
111116
}
112-
new Instabug.Builder(myRegistrar.activity().getApplication(), token).setInvocationEvents(invocationEventsArray).build();
117+
new Instabug.Builder(application, token).setInvocationEvents(invocationEventsArray).build();
113118
enableScreenShotByMediaProjection();
114119
}
115120

@@ -133,7 +138,7 @@ public void showWelcomeMessageWithMode(String welcomeMessageMode) {
133138
* @param userEmail User's default email
134139
*/
135140
public void identifyUserWithEmail(String userEmail, String userName) {
136-
Instabug.identifyUser(userEmail, userName);
141+
Instabug.identifyUser(userName, userEmail);
137142
}
138143

139144
/**

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
additional functionality it is fine to subclass or reimplement
1414
FlutterApplication and put your custom class here. -->
1515
<application
16-
android:name="io.flutter.app.FlutterApplication"
16+
android:name=".CustomFlutterApplication"
1717
android:label="instabug_flutter_example"
1818
android:icon="@mipmap/ic_launcher">
1919
<activity
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.instabug.instabugflutterexample;
2+
3+
import io.flutter.app.FlutterApplication;
4+
import com.instabug.instabugflutter.InstabugFlutterPlugin;
5+
6+
import java.util.ArrayList;
7+
8+
public class CustomFlutterApplication extends FlutterApplication {
9+
@Override
10+
public void onCreate() {
11+
super.onCreate();
12+
ArrayList<String> invocation_events = new ArrayList<>();
13+
invocation_events.add(InstabugFlutterPlugin.INVOCATION_EVENT_FLOATING_BUTTON);
14+
InstabugFlutterPlugin instabug = new InstabugFlutterPlugin();
15+
instabug.start(CustomFlutterApplication.this, "efa41f402620b5654f2af2b86e387029", invocation_events);
16+
instabug.setWelcomeMessageMode("WelcomeMessageMode.disabled");
17+
}
18+
}

example/lib/main.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ class _MyAppState extends State<MyApp> {
2121
@override
2222
void initState() {
2323
super.initState();
24-
Instabug.start('efa41f402620b5654f2af2b86e387029', <InvocationEvent>[InvocationEvent.floatingButton]);
24+
if (Platform.isIOS) {
25+
Instabug.start('efa41f402620b5654f2af2b86e387029', <InvocationEvent>[InvocationEvent.floatingButton]);
26+
}
2527
initPlatformState();
2628
}
2729

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.6.2'
18+
s.dependency 'Instabug', '8.6.3'
1919

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

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: 8.6.3
2+
version: 8.6.4
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

0 commit comments

Comments
 (0)