Commit 291bf543 authored by jyx's avatar jyx

快手及OneWay激励视频对接

parent 80818114
......@@ -273,7 +273,9 @@ dependencies {
implementation(name: 'tzsdk_core-3.0.0-20200807131516-release', ext: 'aar')
implementation(name: 'tzsdk_reporter-3.0.0-20200807131516-release', ext: 'aar')
// 快手
implementation(name: 'kssdk-ad-3.3.6-publishRelease', ext: 'aar')
implementation(name: 'kssdk-all--3.3.16-publishRelease-9ffe2b94e', ext: 'aar')
// OneWay
implementation(name: 'oneway-common-core-1.0.10', ext: 'aar')
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
......
......@@ -36,6 +36,7 @@
<uses-permission android:name="android.permission.ANSWER_PHONE_CALLS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="com.mints.goldspace.permission" />
<permission
android:name="com.mints.goldspace.permission"
android:protectionLevel="normal" />
......@@ -203,10 +204,17 @@
android:screenOrientation="portrait" />
<activity
android:name=".call.permission.PermissionActivity"
android:screenOrientation="portrait"/>
android:screenOrientation="portrait" />
<activity
android:name=".call.detail.DetailApplyActivity"
android:screenOrientation="portrait"/>
android:screenOrientation="portrait" />
<!-- OneWay激励视频 -->
<activity
android:name="mobi.oneway.export.AdShowActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<service
android:name=".service.UpdateService"
......@@ -258,29 +266,11 @@
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name="cn.sharesdk.tencent.qq.ReceiveActivity"
android:launchMode="singleTask"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tencent1109991028" />
</intent-filter>
</activity>
<activity
android:name=".wxapi.WXEntryActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name=".apshare.ShareEntryActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<provider
android:name="androidx.core.content.FileProvider"
......@@ -357,6 +347,15 @@
android:resource="@xml/wn_file_paths" />
</provider>
<provider
android:name="mobi.oneway.export.OWProvider"
android:authorities="${applicationId}.OWProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/ow_file_paths" />
</provider>
<!-- 来电秀 -->
<service
......
......@@ -16,6 +16,7 @@ import com.mints.goldspace.manager.KsManager;
import com.mints.goldspace.manager.LiebaoManager;
import com.mints.goldspace.manager.MhManager;
import com.mints.goldspace.manager.MiitHelper;
import com.mints.goldspace.manager.OwManager;
import com.mints.goldspace.manager.RsNewsManager;
import com.mints.goldspace.manager.TtCsjAdManager;
import com.mints.goldspace.manager.TzManager;
......@@ -128,6 +129,9 @@ public class MintsApplication extends MultiDexApplication {
// 枫岚广告
MhManager.INSTANCE.initWn(this);
// OneWay广告
OwManager.INSTANCE.init(this);
// 天卓珊瑚
TzManager.INSTANCE.initTz(this);
......
package com.mints.goldspace.ad.express
import android.annotation.SuppressLint
import android.content.DialogInterface
import android.text.TextUtils
import android.util.Log
import android.view.LayoutInflater
......@@ -96,7 +97,7 @@ object KsPreLoadExpressManager {
}
override fun onVideoPlayError(what: Int, extra: Int) {
LogUtil.d("KsPreLoadExpressManager","id=${what} extra=${extra}")
LogUtil.d("KsPreLoadExpressManager", "id=${what} extra=${extra}")
}
})
......@@ -192,6 +193,10 @@ object KsPreLoadExpressManager {
// Toast.makeText(mContext, "广告" + ad.appName + "展示", Toast.LENGTH_SHORT).show()
}
}
override fun handleDownloadDialog(p0: DialogInterface.OnClickListener?): Boolean {
return false
}
})
// 广告描述
......
......@@ -111,6 +111,8 @@ class KsVideoAdManager private constructor() :
}
}
override fun onRequestResult(p0: Int) {}
})
......
package com.mints.goldspace.ad.video
import android.app.Activity
import com.mints.goldspace.ad.video.base.BaseVideoAd
import com.mints.goldspace.ad.video.base.VideoAdStatusListener
import com.mints.goldspace.common.AppConfig
import com.mints.goldspace.common.Constant
import com.mints.goldspace.manager.OwManager
import com.mints.goldspace.manager.TrackManager
import mobi.oneway.export.Ad.OWRewardedAd
import mobi.oneway.export.AdListener.OWRewardedAdListener
import mobi.oneway.export.enums.OnewayAdCloseType
import mobi.oneway.export.enums.OnewaySdkError
private val TAG = OwVideoAdManager::class.java.simpleName
/**
* OneWay广告视频
*/
class OwVideoAdManager private constructor() :
BaseVideoAd() {
private var videoAdStatusListener: VideoAdStatusListener? = null
private var owRewardedAd: OWRewardedAd? = null
private var isClickScreen: Boolean = true
companion object {
private var _inst: OwVideoAdManager? = null
fun getInstance(): OwVideoAdManager? {
return if (_inst != null) {
_inst
} else {
_inst = OwVideoAdManager()
_inst
}
}
}
override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) {
isClickScreen = true
//创建激励视频事件监听器
val owRewardedAdListener: OWRewardedAdListener = object : OWRewardedAdListener {
override fun onAdReady() {
owRewardedAd?.show(activity)
}
override fun onAdShow(tag: String) {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_ZERO, "", "")
}
override fun onAdClick(tag: String) {
if (AppConfig.needReportClickAdEvent) {
TrackManager.getInstance().reportClickAdEvent()
}
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_TWO, "", "")
if (isClickScreen) {
// 防止重复
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_FOUR, "", "")
isClickScreen = false
}
videoAdStatusListener?.adDownload()
}
override fun onAdClose(tag: String, onewayVideoCloseType: OnewayAdCloseType) {
TrackManager.getInstance().reportAddCoinMsg(activity, getAdMapVO(carrierType, Constant.AD_SOURCE_OW, extraId, curCoin))
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_THREE, "", "")
videoAdStatusListener?.adSuccess()
}
override fun onAdFinish(s: String, onewayAdCloseType: OnewayAdCloseType, s1: String) {
}
override fun onSdkError(onewaySdkError: OnewaySdkError, s: String) {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_ONE, s, "")
videoAdStatusListener?.adFail()
}
}
//创建激励视频对象
owRewardedAd = OWRewardedAd(activity, OwManager.REWARD_PID, owRewardedAdListener)
owRewardedAd?.loadAd()
}
fun setVideoAdStatusListener(videoAdStatusListener: VideoAdStatusListener?) {
this.videoAdStatusListener = videoAdStatusListener
}
override fun onDestroy() {
owRewardedAd?.destory()
owRewardedAd = null
}
}
\ No newline at end of file
......@@ -150,6 +150,7 @@ object Constant {
const val AD_SOURCE_CSJFULL = "CSJFULL"
const val AD_SOURCE_SH = "CORAL" //珊瑚天卓
const val AD_SOURCE_KS = "KS" //快手
const val AD_SOURCE_OW = "OW" //OneWay
// 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重
const val EVENT_TYPE_ZERO = "0"
......
......@@ -12,13 +12,13 @@ import com.mints.goldspace.R
*/
object KsManager {
private const val KS_APP_ID = "551900003"
private const val KS_APP_ID = "574600004"
/*信息流*/
const val KS_AD_NATIVEEXPRESS_AWARD = 5519000010
const val KS_AD_NATIVEEXPRESS_AWARD = 5746000025
/* vedio-postid */
const val KS_AD_VEDIO_POSTID = 5519000009
const val KS_AD_VEDIO_POSTID = 5746000024
/**
* 初始化
......
package com.mints.goldspace.manager
import android.app.Application
import com.maplehaze.adsdk.MaplehazeSDK
import mobi.oneway.export.Ad.OnewaySdk
/**
* 描述:OneWay激励视频
* 作者:孟崔广
*/
object OwManager {
private const val PUBLISH_ID = "dae8ca1f086a4e27"
const val REWARD_PID = "CZFL1VG8J6YQFR7I"
/**
* 初始化
*/
fun init(application: Application) {
OnewaySdk.configure(application, PUBLISH_ID)
}
}
\ No newline at end of file
......@@ -8,12 +8,19 @@ import com.mints.goldspace.MintsApplication
import com.mints.goldspace.R
import com.mints.goldspace.common.AppConfig
import com.mints.goldspace.common.Constant
import com.mints.goldspace.manager.OwManager
import com.mints.goldspace.ui.activitys.base.BaseActivity
import com.mints.goldspace.utils.LogUtil
import com.mints.goldspace.utils.ToastUtil
import com.mints.library.utils.CommonUtils
import com.mints.library.utils.ConstantUtil
import kotlinx.android.synthetic.main.activity_aboutus.*
import kotlinx.android.synthetic.main.header_layout.*
import mobi.oneway.export.Ad.OWRewardedAd
import mobi.oneway.export.AdListener.OWRewardedAdListener
import mobi.oneway.export.enums.OnewayAdCloseType
import mobi.oneway.export.enums.OnewaySdkError
/**
* 描述:关于我们
......@@ -40,6 +47,41 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
true
}
//创建激励视频事件监听器
val owRewardedAdListener: OWRewardedAdListener = object : OWRewardedAdListener {
override fun onAdReady() {
LogUtil.d(" onAdReady")
}
override fun onAdShow(tag: String) {
LogUtil.d(" onAdShow")
}
override fun onAdClick(tag: String) {
LogUtil.d(" onAdClick")
}
override fun onAdClose(tag: String, onewayVideoCloseType: OnewayAdCloseType) {
LogUtil.d(" OnAdClose: $tag, type: $onewayVideoCloseType")
}
override fun onAdFinish(s: String, onewayAdCloseType: OnewayAdCloseType, s1: String) {
LogUtil.d(" onAdFinish: $s, type: $onewayAdCloseType")
}
override fun onSdkError(onewaySdkError: OnewaySdkError, s: String) {
LogUtil.d("onSdkError$onewaySdkError:$s")
}
}
//创建激励视频对象
val owRewardedAd = OWRewardedAd(this, OwManager.REWARD_PID, owRewardedAdListener)
owRewardedAd.loadAd()
tv_title.setOnClickListener {
owRewardedAd.show(this)
}
initListener()
}
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<paths>
<root-path
name="root"
path="" />
<files-path
name="files"
path="" />
<external-path
name="sdcard"
path="" />
<cache-path
name="cache"
path="" />
<external-files-path
name="exFiles"
path="" />
<external-cache-path
name="exCache"
path="" />
</paths>
</resources>
\ No newline at end of file
......@@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon Mar 15 17:59:26 CST 2021
sdk.dir=/Users/mcg/Library/Android/sdk
#Wed May 12 10:08:26 CST 2021
sdk.dir=/Users/Hello/Library/Android/sdk
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