update: 添加SDK model内置的 no_ad 属性
parent
bc002d1501
commit
049de5acd3
|
|
@ -30,6 +30,7 @@ namespace Guru
|
|||
public int b_level = 0;
|
||||
public int b_play = 0;
|
||||
public int buy_count = 0;
|
||||
public bool no_ads = false;
|
||||
|
||||
public List<PurchasedProduct> purchased;
|
||||
//-------------- data ---------------
|
||||
|
|
@ -94,7 +95,15 @@ namespace Guru
|
|||
|
||||
public bool IsIapUser => PurchasedCount > 0;
|
||||
|
||||
|
||||
public bool IsNoAds
|
||||
{
|
||||
get => no_ads;
|
||||
set
|
||||
{
|
||||
no_ads = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private BindableProperty<int> _successLevel;
|
||||
private BindableProperty<int> _totalPlayed;
|
||||
|
|
|
|||
|
|
@ -249,6 +249,7 @@ namespace Guru
|
|||
SetUserIsIAP(Model.IsIapUser); // 预先设置用户的 IAP User 属性
|
||||
SetUserBLevel(Model.SuccessLevelId); // 预先设置用户的 BLevel 属性
|
||||
SetUserBPlay(Model.TotalPlayedCount); // 预先设置用户的 BPlay 属性
|
||||
if (Model.IsNoAds) SetBuyNoAds(true); // 设置用户已经购买了去广告
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@ namespace Guru
|
|||
/// <param name="value"></param>
|
||||
public static void SetBuyNoAds(bool value = true)
|
||||
{
|
||||
Model.IsNoAds = value;
|
||||
ADService.Instance.IsBuyNoAds = value;
|
||||
SetUserProperty(Consts.PropertyNoAds, value? "true" : "false");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue