diff --git a/app/build.gradle b/app/build.gradle index f49417da8..8cfa14299 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -271,7 +271,7 @@ dependencies { implementation 'com.github.mmin18:realtimeblurview:1.2.1' - implementation 'com.appsflyer:af-android-sdk:6.8.2' +// implementation 'com.appsflyer:af-android-sdk:6.8.2' implementation 'com.github.zhpanvip:BannerViewPager:3.5.6' @@ -293,7 +293,7 @@ dependencies { //wheelView implementation 'com.contrarywind:wheelview:4.1.0' - implementation 'tech.sud.mgp:SudMGP-static:1.3.3.1158' +// implementation 'tech.sud.mgp:SudMGP-static:1.3.3.1158' implementation project(':modules:module_base') if (!isolationMode) { diff --git a/app/src/main/java/com/chwl/app/avroom/firstcharge/FirstChargeDialog.kt b/app/src/main/java/com/chwl/app/avroom/firstcharge/FirstChargeDialog.kt index 2c8bfd2ab..77cb77981 100644 --- a/app/src/main/java/com/chwl/app/avroom/firstcharge/FirstChargeDialog.kt +++ b/app/src/main/java/com/chwl/app/avroom/firstcharge/FirstChargeDialog.kt @@ -16,9 +16,9 @@ import android.view.WindowManager import android.widget.PopupWindow import android.widget.TextView import androidx.recyclerview.widget.GridLayoutManager -import com.appsflyer.AFInAppEventParameterName -import com.appsflyer.AFInAppEventType -import com.appsflyer.AppsFlyerLib +//import com.appsflyer.AFInAppEventParameterName +//import com.appsflyer.AFInAppEventType +//import com.appsflyer.AppsFlyerLib import com.example.module_base.support.billing.IBillingResult import com.example.module_base.support.billing.IBillingService import com.example.module_base.support.billing.IProductDetails @@ -276,35 +276,35 @@ class FirstChargeDialog : BaseViewBindingActivity(), { token: String -> //L.i("token=" + token); billingManager?.consumeAsync(token) - var skuDetails: IProductDetails? = null - val goodList = goodsList - if (!goodList.isNullOrEmpty()) { - for (datum in goodList) { - if (datum.chargeProdId == purchase.getProducts()[0]) { - skuDetails = datum.productDetails - break - } - } - } - if (skuDetails != null) { - val eventValue: MutableMap = - HashMap() - eventValue[AFInAppEventParameterName.CONTENT_TYPE] = "Gold" - eventValue[AFInAppEventParameterName.QUANTITY] = 1 - eventValue[AFInAppEventParameterName.CONTENT_ID] = purchase.getOrderId()!! - skuDetails.getOneTimePurchaseOfferDetails()?.let { - eventValue[AFInAppEventParameterName.REVENUE] = - it.getPriceAmountMicros() / 1000000f - eventValue["Price"] = it.getFormattedPrice() - eventValue[AFInAppEventParameterName.CURRENCY] = - it.getPriceCurrencyCode() - } - AppsFlyerLib.getInstance().logEvent( - applicationContext, - AFInAppEventType.PURCHASE, - eventValue - ) - } +// var skuDetails: IProductDetails? = null +// val goodList = goodsList +// if (!goodList.isNullOrEmpty()) { +// for (datum in goodList) { +// if (datum.chargeProdId == purchase.getProducts()[0]) { +// skuDetails = datum.productDetails +// break +// } +// } +// } +// if (skuDetails != null) { +// val eventValue: MutableMap = +// HashMap() +// eventValue[AFInAppEventParameterName.CONTENT_TYPE] = "Gold" +// eventValue[AFInAppEventParameterName.QUANTITY] = 1 +// eventValue[AFInAppEventParameterName.CONTENT_ID] = purchase.getOrderId()!! +// skuDetails.getOneTimePurchaseOfferDetails()?.let { +// eventValue[AFInAppEventParameterName.REVENUE] = +// it.getPriceAmountMicros() / 1000000f +// eventValue["Price"] = it.getFormattedPrice() +// eventValue[AFInAppEventParameterName.CURRENCY] = +// it.getPriceCurrencyCode() +// } +// AppsFlyerLib.getInstance().logEvent( +// applicationContext, +// AFInAppEventType.PURCHASE, +// eventValue +// ) +// } } ) { throwable: Throwable -> if (throwable !is IgnoreException) { diff --git a/app/src/main/java/com/chwl/app/ui/login/helper/LogoutHelper.java b/app/src/main/java/com/chwl/app/ui/login/helper/LogoutHelper.java index ec1ab548c..9a9286f43 100644 --- a/app/src/main/java/com/chwl/app/ui/login/helper/LogoutHelper.java +++ b/app/src/main/java/com/chwl/app/ui/login/helper/LogoutHelper.java @@ -7,7 +7,6 @@ import android.text.style.ForegroundColorSpan; import androidx.core.content.ContextCompat; -import com.appsflyer.internal.components.network.http.exceptions.HttpException; import com.chwl.app.R; import com.chwl.app.base.BaseActivity; import com.chwl.core.auth.AuthModel; @@ -24,6 +23,8 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; +import retrofit2.HttpException; + /** * create by lvzebiao @2019/12/9 */ diff --git a/app/src/main/java/com/chwl/app/ui/pay/ChargeActivity.java b/app/src/main/java/com/chwl/app/ui/pay/ChargeActivity.java index b02d03742..ad3a9022d 100644 --- a/app/src/main/java/com/chwl/app/ui/pay/ChargeActivity.java +++ b/app/src/main/java/com/chwl/app/ui/pay/ChargeActivity.java @@ -22,9 +22,9 @@ import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; -import com.appsflyer.AFInAppEventParameterName; -import com.appsflyer.AFInAppEventType; -import com.appsflyer.AppsFlyerLib; +//import com.appsflyer.AFInAppEventParameterName; +//import com.appsflyer.AFInAppEventType; +//import com.appsflyer.AppsFlyerLib; import com.example.module_base.support.billing.IBillingService; import com.example.module_base.support.billing.IProductDetails; import com.example.module_base.support.billing.IPurchase; @@ -228,25 +228,25 @@ public class ChargeActivity extends BaseMvpActivity { billingManager.consumeAsync(token); - IProductDetails productDetails = null; - for (ChargeBean datum : mChargeAdapter.getData()) { - if (datum.getChargeProdId().equals(purchase.getProducts().get(0))) { - productDetails = datum.getProductDetails(); - break; - } - } - if (productDetails != null) { - Map eventValue = new HashMap<>(); - eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "Gold"); - eventValue.put(AFInAppEventParameterName.QUANTITY, 1); - eventValue.put(AFInAppEventParameterName.CONTENT_ID, purchase.getOrderId()); - if (productDetails.getOneTimePurchaseOfferDetails() != null) { - eventValue.put(AFInAppEventParameterName.REVENUE, productDetails.getOneTimePurchaseOfferDetails().getPriceAmountMicros() / 1000000f); - eventValue.put("Price", productDetails.getOneTimePurchaseOfferDetails().getFormattedPrice()); - eventValue.put(AFInAppEventParameterName.CURRENCY, productDetails.getOneTimePurchaseOfferDetails().getPriceCurrencyCode()); - } - AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.PURCHASE, eventValue); - } +// IProductDetails productDetails = null; +// for (ChargeBean datum : mChargeAdapter.getData()) { +// if (datum.getChargeProdId().equals(purchase.getProducts().get(0))) { +// productDetails = datum.getProductDetails(); +// break; +// } +// } +// if (productDetails != null) { +// Map eventValue = new HashMap<>(); +// eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "Gold"); +// eventValue.put(AFInAppEventParameterName.QUANTITY, 1); +// eventValue.put(AFInAppEventParameterName.CONTENT_ID, purchase.getOrderId()); +// if (productDetails.getOneTimePurchaseOfferDetails() != null) { +// eventValue.put(AFInAppEventParameterName.REVENUE, productDetails.getOneTimePurchaseOfferDetails().getPriceAmountMicros() / 1000000f); +// eventValue.put("Price", productDetails.getOneTimePurchaseOfferDetails().getFormattedPrice()); +// eventValue.put(AFInAppEventParameterName.CURRENCY, productDetails.getOneTimePurchaseOfferDetails().getPriceCurrencyCode()); +// } +// AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.PURCHASE, eventValue); +// } }, throwable -> { if (!(throwable instanceof IgnoreException)) { diff --git a/app/src/main/java/com/chwl/app/vip/VipMainActivity.kt b/app/src/main/java/com/chwl/app/vip/VipMainActivity.kt index 1df53cb58..7bd6fcdfa 100644 --- a/app/src/main/java/com/chwl/app/vip/VipMainActivity.kt +++ b/app/src/main/java/com/chwl/app/vip/VipMainActivity.kt @@ -12,9 +12,9 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.isInvisible import androidx.core.view.isVisible import androidx.recyclerview.widget.GridLayoutManager -import com.appsflyer.AFInAppEventParameterName -import com.appsflyer.AFInAppEventType -import com.appsflyer.AppsFlyerLib +//import com.appsflyer.AFInAppEventParameterName +//import com.appsflyer.AFInAppEventType +//import com.appsflyer.AppsFlyerLib import com.example.module_base.support.billing.IBillingResult import com.example.module_base.support.billing.IBillingService import com.example.module_base.support.billing.IProductDetails @@ -453,36 +453,36 @@ class VipMainActivity : BaseViewBindingActivity(), { token: String -> //L.i("token=" + token); billingManager?.consumeAsync(token) - var skuDetails: IProductDetails? = null - if (googleChargeBean?.getChargeProdId() == purchase.getProducts() - .firstOrNull() - ) { - skuDetails = googleChargeBean?.productDetails - } - if (skuDetails != null) { - val eventValue: MutableMap = - HashMap() - eventValue[AFInAppEventParameterName.CONTENT_TYPE] = "Gold" - eventValue[AFInAppEventParameterName.QUANTITY] = 1 - eventValue[AFInAppEventParameterName.CONTENT_ID] = - purchase.getOrderId()!! - if (skuDetails.getOneTimePurchaseOfferDetails() != null) { - eventValue[AFInAppEventParameterName.REVENUE] = - skuDetails.getOneTimePurchaseOfferDetails() - ?.getPriceAmountMicros()!! / 1000000f - eventValue["Price"] = - skuDetails.getOneTimePurchaseOfferDetails() - ?.getFormattedPrice()!! - eventValue[AFInAppEventParameterName.CURRENCY] = - skuDetails.getOneTimePurchaseOfferDetails() - ?.getPriceCurrencyCode()!! - } - AppsFlyerLib.getInstance().logEvent( - applicationContext, - AFInAppEventType.PURCHASE, - eventValue - ) - } +// var skuDetails: IProductDetails? = null +// if (googleChargeBean?.getChargeProdId() == purchase.getProducts() +// .firstOrNull() +// ) { +// skuDetails = googleChargeBean?.productDetails +// } +// if (skuDetails != null) { +// val eventValue: MutableMap = +// HashMap() +// eventValue[AFInAppEventParameterName.CONTENT_TYPE] = "Gold" +// eventValue[AFInAppEventParameterName.QUANTITY] = 1 +// eventValue[AFInAppEventParameterName.CONTENT_ID] = +// purchase.getOrderId()!! +// if (skuDetails.getOneTimePurchaseOfferDetails() != null) { +// eventValue[AFInAppEventParameterName.REVENUE] = +// skuDetails.getOneTimePurchaseOfferDetails() +// ?.getPriceAmountMicros()!! / 1000000f +// eventValue["Price"] = +// skuDetails.getOneTimePurchaseOfferDetails() +// ?.getFormattedPrice()!! +// eventValue[AFInAppEventParameterName.CURRENCY] = +// skuDetails.getOneTimePurchaseOfferDetails() +// ?.getPriceCurrencyCode()!! +// } +// AppsFlyerLib.getInstance().logEvent( +// applicationContext, +// AFInAppEventType.PURCHASE, +// eventValue +// ) +// } } ) { throwable: Throwable -> if (throwable !is IgnoreException) {