From 6e9449cb3d502eb37607c52dfe1191ca68fc6094 Mon Sep 17 00:00:00 2001 From: Aleksei Androsov Date: Mon, 18 Sep 2017 10:04:19 +0300 Subject: [PATCH] Initial JS implementation --- index.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..ecea787 --- /dev/null +++ b/index.js @@ -0,0 +1,22 @@ +import { NativeModules } from 'react-native'; +const { AppMetrica } = NativeModules; + +export default { + + /** + * Starts the statistics collection process. + * @param {string} apiKey + */ + activateWithApiKey(apiKey) { + AppMetrica.activateWithApiKey(apiKey); + }, + + /** + * Sends a custom event message and additional parameters (optional). + * @param {string} message + * @param {object} [params=null] + */ + reportEvent(message, params = null) { + AppMetrica.reportEvent(message, params); + }, +};