mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-02 14:10:40 +00:00
Enable logUserEventWithName
API for android
This commit is contained in:
parent
81e595598b
commit
b009e16315
@ -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) {
|
||||
|
8
index.js
8
index.js
@ -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);
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user