File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
android/src/main/java/com/instabug/reactlibrary Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
22
22
private Instabug mInstabug ;
23
23
private String mAndroidApplicationToken ;
24
24
private Instabug .Builder mBuilder ;
25
- private Application mApplication ;
25
+ private Application androidApplication ;
26
26
27
- public RNInstabugReactnativeModule (ReactApplicationContext reactContext ) {
27
+ public RNInstabugReactnativeModule (ReactApplicationContext reactContext , Application androidApplication ) {
28
28
super (reactContext );
29
- this .mApplication = reactContext . getApplicationContext ();
29
+ this .androidApplication = androidApplication
30
30
}
31
31
32
32
@ Override
@@ -44,7 +44,7 @@ public void startInstabugWithTokenForAndroid(String androidApplicationToken)
44
44
{
45
45
this .mAndroidApplicationToken = androidApplicationToken ;
46
46
47
- mInstagbug = new Instabug .Builder (mApplication , mAndroidApplicationToken )
47
+ mInstagbug = new Instabug .Builder (androidApplication , mAndroidApplicationToken )
48
48
.setDebugEnabled (true )
49
49
.setEmailFieldRequired (false )
50
50
.setFloatingButtonOffsetFromTop (400 )
Original file line number Diff line number Diff line change 16
16
17
17
public class RNInstabugReactnativePackage implements ReactPackage {
18
18
19
+ Application androidApplication ;
20
+
21
+ public RNInstabugReactnativePackage (Application application ) {
22
+ this .androidApplication = application ;
23
+ }
24
+
19
25
@ Override
20
26
public List <NativeModule > createNativeModules (ReactApplicationContext reactContext ) {
21
27
List <NativeModule > modules = new ArrayList <>();
22
- modules .add (new RNInstabugReactnativeModule (reactContext ));
28
+ modules .add (new RNInstabugReactnativeModule (reactContext , androidApplication ));
23
29
return modules ;
24
30
}
25
31
You can’t perform that action at this time.
0 commit comments