React Native bridge to the AppMetrica on both iOS and Android.
- прописать в терминале: echo "\n[url \"ssh://[email protected]/\"]\n\tinsteadOf = https://github.com/" >> ~/.gitconfig
- или добавить вручную в .gitconfig [url "ssh://[email protected]/"] insteadOf = https://github.com/
- добавить в package.json в dependencies "@odva/react-native-appmetrica": "git+https://github.com/odvapro/react-native-appmetrica.git",
- iOS only
npx pod-install
import AppMetrica from "@odva/react-native-appmetrica";
// Starts the statistics collection process.
AppMetrica.activate({
apiKey: "...KEY...",
sessionTimeout: 120,
firstActivationAsUpdate: false,
});
// Sends a custom event message and additional parameters (optional).
AppMetrica.reportEvent("My event");
AppMetrica.reportEvent("My event", { foo: "bar" });
// Send a custom error event.
AppMetrica.reportError("My error");
//Send a ECommerce Event
AppMetrica.reportECommerce("checkout", (attributes = ECommerceObject));
interface ECommerceObject {
screen: {
screenName: "MyScreenName",
};
productsInfo: Product[];
orderId: String;
}
interface Product {
price: {
price: number,
typeOfCurrency: String,
};
product: {
article: String,
name: String,
categoryName: String,
};
quantity: number;
}