新增快手广告接口调用
This commit is contained in:
@@ -93,7 +93,7 @@ public class SplashActivity extends BaseActivity implements View.OnClickListener
|
||||
|
||||
UMConfigure.getOaid(this, oaid -> {
|
||||
OaidUtil.setOaid(oaid);
|
||||
if (first) ChannelPageModel.get().checkByteDanceAd("0");
|
||||
if (first) ChannelPageModel.get().checkAd();
|
||||
});
|
||||
|
||||
mBinding.tvSkip.setVisibility(View.VISIBLE);
|
||||
|
@@ -66,6 +66,22 @@ public class ChannelPageModel extends BaseModel implements IChannelPageModel {
|
||||
.compose(RxHelper.handleSchAndExce());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void checkAd() {
|
||||
|
||||
if (BasicConfig.INSTANCE.isKwaiChannel()) {
|
||||
checkKwaiAd("0");
|
||||
}
|
||||
|
||||
if (BasicConfig.INSTANCE.isByteDanceChannel()) {
|
||||
checkByteDanceAd("0");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param evenType 暂时只有0
|
||||
*/
|
||||
@@ -83,6 +99,23 @@ public class ChannelPageModel extends BaseModel implements IChannelPageModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param evenType 暂时只有0
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void checkKwaiAd(String evenType) {
|
||||
try {
|
||||
api.checkKwaiAd(evenType,
|
||||
NetworkUtils.getIPAddress(BasicConfig.INSTANCE.getAppContext()),
|
||||
System.getProperty("http.agent"))
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.subscribe();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
|
||||
/**
|
||||
@@ -106,6 +139,16 @@ public class ChannelPageModel extends BaseModel implements IChannelPageModel {
|
||||
@Field("evenType") String evenType,
|
||||
@Field("ip") String ip,
|
||||
@Field("ua") String ua);
|
||||
|
||||
/**
|
||||
* 快手推广接口
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/kuaishouAd/activeTrack")
|
||||
Single<ServiceResult<ChannelPageInfo>> checkKwaiAd(
|
||||
@Field("evenType") String evenType,
|
||||
@Field("ip") String ip,
|
||||
@Field("ua") String ua);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,5 +15,9 @@ public interface IChannelPageModel {
|
||||
|
||||
Single<InviteUserInfo> checkInviteUserInRoom(String inviteCode);
|
||||
|
||||
void checkAd();
|
||||
|
||||
void checkByteDanceAd(String evenType);
|
||||
|
||||
void checkKwaiAd(String evenType);
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.yizhuan.xchat_android_library.utils.cache.CacheClientFactory;
|
||||
import com.yizhuan.xchat_android_library.utils.file.StorageUtils;
|
||||
@@ -84,6 +85,14 @@ public enum BasicConfig {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public boolean isByteDanceChannel() {
|
||||
return !TextUtils.isEmpty(channel) && channel.contains("toutiao");
|
||||
}
|
||||
|
||||
public boolean isKwaiChannel() {
|
||||
return !TextUtils.isEmpty(channel) && channel.contains("kuaishou");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Application context
|
||||
*/
|
||||
@@ -263,5 +272,4 @@ public enum BasicConfig {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user