To log payments using Logsnag in Swift, you can follow the steps below:
main.swift15 chars2 lines
main.swift96 chars3 lines
main.swift128 chars5 lines
In this example, we log an error event using the notifyError
method. The PaymentError.paymentFailed
is a custom error enum defined elsewhere in your project, and groupingKey
is a string that you can use to group similar errors together in the Logsnag dashboard.
notifyError
method.main.swift248 chars11 lines
In this example, we add three key-value pairs to the metadata dictionary: payment_id
, amount
, and customer_id
.
That's it! With these steps, you can log payment events using Logsnag in your Swift project.
gistlibby LogSnag