Skip to content

Commit

Permalink
HUP: 329,377,379 (#381)
Browse files Browse the repository at this point in the history
* HUP-379: Editor unitypackage exporting missing command about -Assets/Huawei/Prefabs-  has been added

* HUP-377: IAP Demo , add subscription management functionality

* HUP-329: when all kits were enabled there used to be build error . SOLVED
  • Loading branch information
bunyamineymen authored Oct 31, 2022
1 parent 59199b1 commit be8f98e
Show file tree
Hide file tree
Showing 4 changed files with 588 additions and 48 deletions.
1 change: 1 addition & 0 deletions Assets/Editor/HMSUnityPackageCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ private static void PreparePackages()
"Assets/Huawei/Demos",
"Assets/Huawei/Dlls",
"Assets/Huawei/Editor",
"Assets/Huawei/Prefabs",
"Assets/Huawei/Scripts",
"Assets/Huawei/VERSION",
"Assets/Huawei/HuaweiMobileServices.Core.asmdef",
Expand Down
25 changes: 25 additions & 0 deletions Assets/Huawei/Demos/IAP/IAPDemoUIView.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

using HmsPlugin;

using HuaweiMobileServices.IAP;

using UnityEngine;
using UnityEngine.UI;

Expand All @@ -10,6 +14,8 @@ public class IAPDemoUIView : MonoBehaviour
private Button Btn_ItemRemoveAds;
private Button Btn_ItemPremium;
private Button Btn_SignIn;
private Button Btn_ManageSubscriptions;
private Button Btn_EditSubscriptions;

private Text Txt_Log;

Expand All @@ -24,6 +30,9 @@ private void Awake()
Btn_ItemPremium = GameObject.Find("ItemBuyButtonPremium").GetComponent<Button>();
Btn_SignIn = GameObject.Find("LoginButton").GetComponent<Button>();

Btn_ManageSubscriptions = GameObject.Find("ManageSubscription").GetComponent<Button>();
Btn_EditSubscriptions = GameObject.Find("EditSubscription").GetComponent<Button>();

Txt_Log = GameObject.Find("StatusText").GetComponent<Text>();
}

Expand All @@ -35,6 +44,9 @@ private void OnEnable()
Btn_ItemPremium.onClick.AddListener(ButtonClick_BuyItemPremium);
Btn_SignIn.onClick.AddListener(ButtonClick_BuySignIn);

Btn_ManageSubscriptions.onClick.AddListener(OpenSubscriptionManagementScreen);
Btn_EditSubscriptions.onClick.AddListener(OpenSubscriptionEditingScreen);

IapDemoManager.IAPLog += OnIAPLog;
}

Expand All @@ -46,6 +58,9 @@ private void OnDisable()
Btn_ItemPremium.onClick.RemoveListener(ButtonClick_BuyItemPremium);
Btn_SignIn.onClick.RemoveListener(ButtonClick_BuySignIn);

Btn_ManageSubscriptions.onClick.RemoveListener(OpenSubscriptionManagementScreen);
Btn_EditSubscriptions.onClick.RemoveListener(OpenSubscriptionEditingScreen);

IapDemoManager.IAPLog -= OnIAPLog;
}

Expand Down Expand Up @@ -87,6 +102,16 @@ private void ButtonClick_BuySignIn()
IapDemoManager.Instance.SignIn();
}

private void OpenSubscriptionEditingScreen()
{
HMSIAPManager.Instance.RedirectingtoSubscriptionEditingScreen("premium");
}

private void OpenSubscriptionManagementScreen()
{
HMSIAPManager.Instance.RedirectingtoSubscriptionManagementScreen("premium");
}

#endregion

}
Loading

0 comments on commit be8f98e

Please sign in to comment.