Enable logUserEventWithName API for android

This commit is contained in:
DevHossamHassan 2017-06-22 00:30:12 +02:00
parent 81e595598b
commit b009e16315
2 changed files with 17 additions and 6 deletions

View File

@ -830,6 +830,21 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
}
}
/**
* Logs a user event that happens through the lifecycle of the application.
* Logged user events are going to be sent with each report, as well as at the end of a session.
*
* @param {string} name Event name.
*/
@ReactMethod
public void logUserEventWithName(String name) {
try {
mInstabug.logUserEvent(name);
} catch (java.lang.Exception exception) {
exception.printStackTrace();
}
}
private InstabugCustomTextPlaceHolder.Key getStringToKeyConstant(String key) {
String keyInLowerCase = key.toLowerCase();
switch (keyInLowerCase) {

View File

@ -460,9 +460,7 @@ module.exports = {
* @param {string} name Event name.
*/
logUserEventWithName: function (name) {
if (Platform.OS == 'ios') {
Instabug.logUserEventWithName(name);
}
Instabug.logUserEventWithName(name);
},
/**
@ -472,9 +470,7 @@ module.exports = {
* @param {Object} params An optional dictionary or parameters to be associated with the event.
*/
logUserEventWithNameAndParams: function (name, params) {
if (Platform.OS == 'ios') {
Instabug.logUserEventWithNameAndParams(name, params);
}
Instabug.logUserEventWithNameAndParams(name, params);
},
/**