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