mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-03 06:30:41 +00:00
Add mapping for setUserAttribute API
This commit is contained in:
parent
527394412d
commit
5ecfa5612e
@ -533,6 +533,21 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets user attribute to overwrite it's value or create a new one if it doesn't exist.
|
||||
*
|
||||
* @param key the attribute
|
||||
* @param value the value
|
||||
*/
|
||||
@ReactMethod
|
||||
public static void setUserAttribute(String key, String value) {
|
||||
try {
|
||||
mInstabug.setUserAttribute(key, value);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private Locale getLocaleByKey(String instabugLocale) {
|
||||
String localeInLowerCase = instabugLocale.toLowerCase();
|
||||
switch (localeInLowerCase) {
|
||||
|
13
index.js
13
index.js
@ -622,6 +622,19 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets user attribute to overwrite it's value or create a new one if it doesn't exist.
|
||||
*
|
||||
* @param key the attribute
|
||||
* @param value the value
|
||||
*/
|
||||
setUserAttribute(key, value){
|
||||
if (!key || !value)return;
|
||||
if (Platform.OS === 'android') {
|
||||
Instabug.setUserAttribute(key, value);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* The event used to invoke the feedback form
|
||||
* @readonly
|
||||
|
Loading…
x
Reference in New Issue
Block a user