mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-03 14:40:54 +00:00
Add mapping for getUserAttribute API
This commit is contained in:
parent
5ecfa5612e
commit
4d61214abc
@ -548,6 +548,22 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets specific user attribute.
|
||||||
|
*
|
||||||
|
* @param key the attribute key as string
|
||||||
|
* @return the desired user attribute
|
||||||
|
*/
|
||||||
|
@ReactMethod
|
||||||
|
public static String getUserAttribute(String key) {
|
||||||
|
try {
|
||||||
|
return mInstabug.getUserAttribute(key);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Locale getLocaleByKey(String instabugLocale) {
|
private Locale getLocaleByKey(String instabugLocale) {
|
||||||
String localeInLowerCase = instabugLocale.toLowerCase();
|
String localeInLowerCase = instabugLocale.toLowerCase();
|
||||||
switch (localeInLowerCase) {
|
switch (localeInLowerCase) {
|
||||||
|
13
index.js
13
index.js
@ -635,6 +635,19 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets specific user attribute.
|
||||||
|
*
|
||||||
|
* @param key the attribute key as string
|
||||||
|
* @return the desired user attribute
|
||||||
|
*/
|
||||||
|
getUserAttribute(key){
|
||||||
|
if (!key) throw new TypeError("Invalid param type, Expected String");
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
return Instabug.getUserAttribute(key);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The event used to invoke the feedback form
|
* The event used to invoke the feedback form
|
||||||
* @readonly
|
* @readonly
|
||||||
|
Loading…
x
Reference in New Issue
Block a user