i create a new class to put all the Firebase Analytics functions
this is example
class ClientAnalytics
{
static func purchaseEvent(itemAdded : String , value : Double , currency : String)
{
Analytics.logEvent(AnalyticsEventEcommercePurchase, parameters:
[
AnalyticsParameterItemID : itemAdded as NSObject,
AnalyticsParameterValue : value,
AnalyticsParameterCurrency : currency
])
}
how to call
ClientAnalytics.purchaseEvent(itemAdded: ToolName, value: toolValue, currency: "USD")
the purpose of this functions is to log any purchase Event the user
i create a new class to put all the Firebase Analytics functions
this is example
class ClientAnalytics
{
static func purchaseEvent(itemAdded : String , value : Double , currency : String)
{
Analytics.logEvent(AnalyticsEventEcommercePurchase, parameters:
[
AnalyticsParameterItemID : itemAdded as NSObject,
AnalyticsParameterValue : value,
AnalyticsParameterCurrency : currency
])
}
how to call
ClientAnalytics.purchaseEvent(itemAdded: ToolName, value: toolValue, currency: "USD")
the purpose of this functions is to log any purchase Event the user