Skip to content

Commit

Permalink
added ability to disable automatic consumption purchases while initia…
Browse files Browse the repository at this point in the history
…lization IAP process
  • Loading branch information
am1goo committed Nov 29, 2023
1 parent 25393c0 commit 43586db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Assets/Huawei/Scripts/IAP/HMSIAPManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ private void Prepare_IAP_Products()

void ConsumeControl()
{
if (!HMSIAPKitSettings.Instance.Settings.GetBool(HMSIAPKitSettings.ConsumptionOwnedItemsOnInitialize))
return;

RestoreOwnedPurchases((ownedPurchaseResult) =>
{
Debug.Log($"[{Tag}]: Success on Prepare_IAP_Products");
Expand Down
1 change: 1 addition & 0 deletions Assets/Huawei/Scripts/Settings/HMSIAPKitSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class HMSIAPKitSettings : HMSEditorSingleton<HMSIAPKitSettings>
{
private const string SettingsFilename = "HMSIAPKitSettings";
public const string InitializeOnStart = "InitializeOnStart";
public const string ConsumptionOwnedItemsOnInitialize = "ConsumptionOwnedItemsOnInitialize";
private SettingsScriptableObject loadedSettings;

private HMSSettings _settings;
Expand Down

0 comments on commit 43586db

Please sign in to comment.