Commit 5a7b18dd authored by wanglei's avatar wanglei

[修改]pangle上报

parent 80dea11a
......@@ -91,8 +91,24 @@ object PangleEvent {
Adjust.trackAdRevenue(adjustAdRevenue)
//fb
// 1. 安全获取货币代码
val currencyCode = when {
// 优先使用ISO 4217代码(如USD/CNY)
showEcpm.currency.length == 3 -> showEcpm.currency.uppercase()
// 处理货币符号(如$→USD, ¥→CNY)
showEcpm.currency == "$" -> "USD"
showEcpm.currency == "¥" || showEcpm.currency == "¥" -> "CNY"
showEcpm.currency == "€" -> "EUR"
showEcpm.currency == "£" -> "GBP"
// 默认回退方案
else -> {
"USD"
}
}
val fbLogger = AppEventsLogger.newLogger(MyApplication.Companion.appContext)
fbLogger.logPurchase(BigDecimal.valueOf(showEcpm.cpm.toDouble() / 100000), Currency.getInstance(showEcpm.currency))
fbLogger.logPurchase(BigDecimal.valueOf(showEcpm.cpm.toDouble() / 100000), Currency.getInstance(currencyCode))
//firebase
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment