update: 完善 IsIAPUser 属性保护

Signed-off-by: huyufei <yufei.hu@castbox.fm>
deeplink
胡宇飞 2024-05-17 13:14:16 +08:00
parent 3811ec0d61
commit 1862517c0f
1 changed files with 5 additions and 2 deletions

View File

@ -35,7 +35,7 @@ namespace Guru
private Dictionary<string, ProductInfo> _products;
protected Dictionary<string, ProductInfo> Products => _products;
public bool IsInitialized => _storeController != null && _storeExtensionProvider != null;
public bool IsInitialized => _storeController != null && _storeExtensionProvider != null && _model != null;
private ProductInfo _curProductInfo = null;
private string _curProductCategory = "";
@ -880,8 +880,11 @@ namespace Guru
/// </summary>
/// <param name="value"></param>
public static void SetIsIAPUser(bool value = true)
{
if (Instance != null && Instance._model != null)
{
Instance._model.SetIsIapUser(value); // 用户属性
}
Analytics.SetUserProperty(Analytics.PropertyIsIAPUser, value ? "true" : "false");
}