Skip to content

Commit

Permalink
🤝 Merge pull request #56 from Instabug/hotfix/add_send_event_method
Browse files Browse the repository at this point in the history
🐛 Fix a bug where the sendEvent method was not added
  • Loading branch information
DevHossamHassan authored Aug 10, 2017
2 parents b47e21f + 5c05f53 commit 65ae5a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.Nullable;

import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
Expand All @@ -16,6 +18,7 @@
import com.facebook.react.bridge.WritableNativeMap;
import com.facebook.react.bridge.Callback;

import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.instabug.library.Instabug;
import com.instabug.library.internal.module.InstabugLocale;
import com.instabug.library.invocation.InstabugInvocationEvent;
Expand Down Expand Up @@ -1013,7 +1016,6 @@ public void setIntroMessageEnabled(boolean enabled) {
}
}


/**
* Sets the runnable that gets executed just before showing any valid survey<br/>
* WARNING: This runs on your application's main UI thread. Please do not include
Expand Down Expand Up @@ -1237,6 +1239,14 @@ private Locale getLocaleByKey(String instabugLocale) {
}
}

private void sendEvent(ReactApplicationContext reactContext,
String eventName,
@Nullable WritableMap params) {
reactContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit(eventName, params);
}

@Override
public Map<String, Object> getConstants() {
final Map<String, Object> constants = new HashMap<>();
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NativeModules, NativeAppEventEmitter, Platform} from "react-native";
import {NativeModules, NativeAppEventEmitter, DeviceEventEmitter, Platform} from "react-native";
let {Instabug} = NativeModules;

/**
Expand Down

0 comments on commit 65ae5a9

Please sign in to comment.