mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2026-08-31 14:11:11 +00:00
Add mapping for removeUserAttribute API
This commit is contained in:
@@ -540,7 +540,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
||||
* @param value the value
|
||||
*/
|
||||
@ReactMethod
|
||||
public static void setUserAttribute(String key, String value) {
|
||||
public void setUserAttribute(String key, String value) {
|
||||
try {
|
||||
mInstabug.setUserAttribute(key, value);
|
||||
} catch (Exception e) {
|
||||
@@ -555,7 +555,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
||||
* @return the desired user attribute
|
||||
*/
|
||||
@ReactMethod
|
||||
public static String getUserAttribute(String key) {
|
||||
public String getUserAttribute(String key) {
|
||||
try {
|
||||
return mInstabug.getUserAttribute(key);
|
||||
} catch (Exception e) {
|
||||
@@ -564,6 +564,21 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes user attribute if exists.
|
||||
*
|
||||
* @param key the attribute key as string
|
||||
* @see #setUserAttribute(String, String)
|
||||
*/
|
||||
@ReactMethod
|
||||
public void removeUserAttribute(String key) {
|
||||
try {
|
||||
mInstabug.removeUserAttribute(key);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private Locale getLocaleByKey(String instabugLocale) {
|
||||
String localeInLowerCase = instabugLocale.toLowerCase();
|
||||
switch (localeInLowerCase) {
|
||||
|
||||
Reference in New Issue
Block a user