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; private Dictionary<string, ProductInfo> _products;
protected Dictionary<string, ProductInfo> Products => _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 ProductInfo _curProductInfo = null;
private string _curProductCategory = ""; private string _curProductCategory = "";
@ -881,7 +881,10 @@ namespace Guru
/// <param name="value"></param> /// <param name="value"></param>
public static void SetIsIAPUser(bool value = true) public static void SetIsIAPUser(bool value = true)
{ {
Instance._model.SetIsIapUser(value); // 用户属性 if (Instance != null && Instance._model != null)
{
Instance._model.SetIsIapUser(value); // 用户属性
}
Analytics.SetUserProperty(Analytics.PropertyIsIAPUser, value ? "true" : "false"); Analytics.SetUserProperty(Analytics.PropertyIsIAPUser, value ? "true" : "false");
} }