2017-09-18 10:04:19 +03:00
|
|
|
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);
|
|
|
|
},
|
2017-09-28 15:06:30 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends error with reason.
|
|
|
|
* @param {string} error
|
|
|
|
* @param {object} reason
|
|
|
|
*/
|
|
|
|
reportError(error, reason) {
|
|
|
|
AppMetrica.reportError(error, reason);
|
|
|
|
},
|
2017-09-18 10:04:19 +03:00
|
|
|
};
|