Use Callbacks in getUserAttribute API

This commit is contained in:
DevHossamHassan
2017-06-21 05:23:05 +02:00
parent cae5a8910f
commit 4471d3b402
2 changed files with 5 additions and 8 deletions
@@ -645,13 +645,14 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
* @return the desired user attribute
*/
@ReactMethod
public String getUserAttribute(String key) {
public void getUserAttribute(String key, Callback userAttributeCallback) {
String userAttribute;
try {
return mInstabug.getUserAttribute(key);
userAttribute = mInstabug.getUserAttribute(key);
} catch (Exception e) {
e.printStackTrace();
return null;
}
userAttributeCallback.invoke(userAttribute);
}
/**