|
1 | 1 | package com.instabug.reactlibrary; |
2 | 2 |
|
3 | 3 | import android.app.Application; |
| 4 | +import android.util.Log; |
4 | 5 |
|
5 | 6 | import com.facebook.react.ReactPackage; |
6 | 7 | import com.facebook.react.bridge.NativeModule; |
7 | 8 | import com.facebook.react.bridge.ReactApplicationContext; |
8 | 9 | import com.facebook.react.uimanager.ViewManager; |
9 | 10 | import com.instabug.bug.BugReporting; |
10 | 11 | import com.instabug.crash.CrashReporting; |
| 12 | +import com.instabug.library.Platform; |
11 | 13 | import com.instabug.library.Feature; |
12 | 14 | import com.instabug.library.Instabug; |
13 | 15 | import com.instabug.library.InstabugColorTheme; |
14 | 16 | import com.instabug.library.invocation.InstabugInvocationEvent; |
15 | 17 | import com.instabug.library.invocation.util.InstabugFloatingButtonEdge; |
16 | 18 | import com.instabug.library.visualusersteps.State; |
17 | 19 | import com.instabug.reactlibrary.utils.InstabugUtil; |
| 20 | +import com.instabug.reactlibrary.utils.MainThreadHandler; |
18 | 21 |
|
19 | 22 | import android.graphics.Color; |
20 | 23 |
|
@@ -47,10 +50,10 @@ public RNInstabugReactnativePackage(String androidApplicationToken, Application |
47 | 50 | this.parseInvocationEvent(invocationEventValues); |
48 | 51 |
|
49 | 52 | setBaseUrlForDeprecationLogs(); |
50 | | - |
| 53 | + setCrossPlatform(); |
| 54 | + |
51 | 55 | new Instabug.Builder(this.androidApplication, this.mAndroidApplicationToken) |
52 | 56 | .setInvocationEvents(this.invocationEvents.toArray(new InstabugInvocationEvent[0])) |
53 | | - .setReproStepsState(State.DISABLED) |
54 | 57 | .build(); |
55 | 58 | if (crashReportingEnabled) |
56 | 59 | CrashReporting.setState(Feature.State.ENABLED); |
@@ -96,6 +99,20 @@ private void parseInvocationEvent(String[] invocationEventValues) { |
96 | 99 | } |
97 | 100 | } |
98 | 101 |
|
| 102 | + private void setCrossPlatform() { |
| 103 | + try { |
| 104 | + Method method = InstabugUtil.getMethod(Class.forName("com.instabug.library.Instabug"), "setCrossPlatform", int.class); |
| 105 | + if (method != null) { |
| 106 | + Log.i("IB-CP-Bridge", "invoking setCrossPlatform with platform: " + Platform.RN); |
| 107 | + method.invoke(null, Platform.RN); |
| 108 | + } else { |
| 109 | + Log.e("IB-CP-Bridge", "setCrossPlatform was not found by reflection"); |
| 110 | + } |
| 111 | + } catch (Exception e) { |
| 112 | + e.printStackTrace(); |
| 113 | + } |
| 114 | + } |
| 115 | + |
99 | 116 | private void setBaseUrlForDeprecationLogs() { |
100 | 117 | try { |
101 | 118 | Method method = InstabugUtil.getMethod(Class.forName("com.instabug.library.util.InstabugDeprecationLogger"), "setBaseUrl", String.class); |
|
0 commit comments