Add mapping for removeUserAttribute API

This commit is contained in:
Hossam Hassan
2017-02-04 06:10:26 +02:00
parent ab7188ac13
commit d0844de778
2 changed files with 31 additions and 2 deletions
@@ -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) {