Last active
August 25, 2020 03:19
-
-
Save bachhm-dev/07eb0f09e1b526ab0e5a5acb10888897 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as firebase from "nativescript-plugin-firebase"; | |
// example of parameters | |
// const parameters = [{ | |
// key: "item_id", | |
// value: "...some_uuid...", | |
// }, | |
// { | |
// key: "item_name", | |
// value: "Test log event", | |
// }], | |
trackLogEvent(event, parameters = []) { | |
return firebase.analytics | |
.logEvent({ | |
key: event, | |
parameters: parameters, | |
}) | |
.then( | |
() => { | |
console.log(`Firebase Analytics event logged ${event}`); | |
}, | |
(error) => { | |
console.log(`Firebase Analytics event error ${error}`); | |
} | |
); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment