Merge pull request #11 from KELiON/master
Implement setUserProfileID method
This commit is contained in:
commit
08b9455e79
@ -59,6 +59,11 @@ public class AppMetricaModule extends ReactContextBaseJavaModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ReactMethod
|
||||||
|
public void setUserProfileID(String profileID) {
|
||||||
|
YandexMetrica.setUserProfileID(profileID);
|
||||||
|
}
|
||||||
|
|
||||||
private String convertReadableMapToJson(final ReadableMap readableMap) {
|
private String convertReadableMapToJson(final ReadableMap readableMap) {
|
||||||
ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
|
ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
|
8
index.js
8
index.js
@ -30,4 +30,12 @@ export default {
|
|||||||
reportError(error: string, reason: Object) {
|
reportError(error: string, reason: Object) {
|
||||||
AppMetrica.reportError(error, reason);
|
AppMetrica.reportError(error, reason);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the ID of the user profile.
|
||||||
|
* @param {string} userProfileId
|
||||||
|
*/
|
||||||
|
setUserProfileID(userProfileId: string) {
|
||||||
|
AppMetrica.setUserProfileID(userProfileId);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
@ -26,4 +26,8 @@ RCT_EXPORT_METHOD(reportError:(NSString *)message) {
|
|||||||
NSException *exception = [[NSException alloc] initWithName:message reason:nil userInfo:nil];
|
NSException *exception = [[NSException alloc] initWithName:message reason:nil userInfo:nil];
|
||||||
[YMMYandexMetrica reportError:message exception:exception onFailure:NULL];
|
[YMMYandexMetrica reportError:message exception:exception onFailure:NULL];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RCT_EXPORT_METHOD(setUserProfileID:(NSString *)userProfileID) {
|
||||||
|
[YMMYandexMetrica setUserProfileID:userProfileID];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
Loading…
Reference in New Issue
Block a user