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 {
2222 private Instabug mInstabug ;
2323 private String mAndroidApplicationToken ;
2424 private Instabug .Builder mBuilder ;
25- private Application mApplication ;
25+ private Application androidApplication ;
2626
27- public RNInstabugReactnativeModule (ReactApplicationContext reactContext ) {
27+ public RNInstabugReactnativeModule (ReactApplicationContext reactContext , Application androidApplication ) {
2828 super (reactContext );
29- this .mApplication = reactContext . getApplicationContext ();
29+ this .androidApplication = androidApplication
3030 }
3131
3232 @ Override
@@ -44,7 +44,7 @@ public void startInstabugWithTokenForAndroid(String androidApplicationToken)
4444 {
4545 this .mAndroidApplicationToken = androidApplicationToken ;
4646
47- mInstagbug = new Instabug .Builder (mApplication , mAndroidApplicationToken )
47+ mInstagbug = new Instabug .Builder (androidApplication , mAndroidApplicationToken )
4848 .setDebugEnabled (true )
4949 .setEmailFieldRequired (false )
5050 .setFloatingButtonOffsetFromTop (400 )
Original file line number Diff line number Diff line change 1616
1717public class RNInstabugReactnativePackage implements ReactPackage {
1818
19+ Application androidApplication ;
20+
21+ public RNInstabugReactnativePackage (Application application ) {
22+ this .androidApplication = application ;
23+ }
24+
1925 @ Override
2026 public List <NativeModule > createNativeModules (ReactApplicationContext reactContext ) {
2127 List <NativeModule > modules = new ArrayList <>();
22- modules .add (new RNInstabugReactnativeModule (reactContext ));
28+ modules .add (new RNInstabugReactnativeModule (reactContext , androidApplication ));
2329 return modules ;
2430 }
2531
You can’t perform that action at this time.
0 commit comments