ApiTapiPurchases 1.0.0

ApiTapiPurchases 1.0.0

Vladimir Vasilev 维护。



  • Vladimir Vasilev

apitapi-purchases-ios

用于跟踪购买的框架。

安装

CocoaPods

pod 'ApiTapiPurchases'

用法

import ApiTapiPurchases

初始化

let purchases = ApiTapiPurchases(serverUrl: "<YOUR_APITAPI_SERVER_URL>", // optional, e.g. "https://new.apitapi.com"
                                 authToken: "<YOUR_APITAPI_AUTH_TOKEN>",
                                 deviceToken: "<YOUR_DEVICE_TOKEN")

如何跟踪购买?

purchases.track(productId: "<YOUR_PRODUCT_IDENTIFIER>", // SKProduct productIdentifier
                revenue: 99.0, // SKProduct price.doubleValue
                currency: "USD", // SKProduct priceLocale.currencyCode
                receipt: "<YOUR_RECEIPT_AS_BASE64_STRING>", // optional, the receipt as base64 string, it will take Bundle.main.appStoreReceiptURL content if parameter is not provided
                analyticsIdentifiers: [:], // optional, the dictionary of specific analytics identifiers e.g. ["appMetrica": "<YOUR_APP_METRICA_IDENTIFIER>"], WIP feature
                completion: { error in })

如何调试?

purchases.showDebug = true // false by default, to print all debugging info in the console
purchases.log = { text in } // to define your own log handler
let duration = purchases.lastOperationDuration // the duration of the last operation in seconds

==================================================

您可以在附带的项目的使用示例中查看。