Fix Application Context
This commit is contained in:
parent
3728f018dd
commit
40781fe813
|
@ -22,11 +22,11 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
|||
private Instabug mInstabug;
|
||||
private String mAndroidApplicationToken;
|
||||
private Instabug.Builder mBuilder;
|
||||
private Application mApplication;
|
||||
private Application androidApplication;
|
||||
|
||||
public RNInstabugReactnativeModule(ReactApplicationContext reactContext) {
|
||||
public RNInstabugReactnativeModule(ReactApplicationContext reactContext, Application androidApplication) {
|
||||
super(reactContext);
|
||||
this.mApplication = reactContext.getApplicationContext();
|
||||
this.androidApplication = androidApplication
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,7 +44,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
|||
{
|
||||
this.mAndroidApplicationToken = androidApplicationToken;
|
||||
|
||||
mInstagbug = new Instabug.Builder(mApplication, mAndroidApplicationToken)
|
||||
mInstagbug = new Instabug.Builder(androidApplication, mAndroidApplicationToken)
|
||||
.setDebugEnabled(true)
|
||||
.setEmailFieldRequired(false)
|
||||
.setFloatingButtonOffsetFromTop(400)
|
||||
|
|
|
@ -16,10 +16,16 @@ import com.facebook.react.bridge.JavaScriptModule;
|
|||
|
||||
public class RNInstabugReactnativePackage implements ReactPackage {
|
||||
|
||||
Application androidApplication;
|
||||
|
||||
public RNInstabugReactnativePackage(Application application) {
|
||||
this.androidApplication = application;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
||||
List<NativeModule> modules = new ArrayList<>();
|
||||
modules.add(new RNInstabugReactnativeModule(reactContext));
|
||||
modules.add(new RNInstabugReactnativeModule(reactContext,androidApplication));
|
||||
return modules;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue