Created
July 29, 2019 05:54
-
-
Save shohan4556/a1319513ccf24a5a3e69223ca527f184 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using HuaweiMobileService; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class RemoveAdsIAP : MonoBehaviour { | |
public static RemoveAdsIAP removeAdsIAP_instance; | |
string merchantName = "Zeptomobile Sdn Bhd"; | |
string productNo = "com.b2mgames.BoomSwipe.huawei.noads"; | |
//public string requestID; | |
[TextArea(5,10)] | |
private string rsaPrivateKey; | |
// Use this for initialization | |
void Start () { | |
rsaPrivateKey = "key will goes here"; | |
CheckUpdate(); | |
} | |
private void CheckUpdate () { | |
Purchasing.CheckUpdate(new CheckUpdateCallbackImpl()); | |
} | |
// mechant name | |
// product no | |
// date time | |
// request id | |
// rsa private key | |
// button event | |
public void RemoveAds(){ | |
if(PlayerPrefs.GetInt("noAds") == 0){ | |
Debug.Log("Likhon------------**********----------- : not bought "); | |
ProductPay(); | |
} else if (PlayerPrefs.GetInt("noAds") == 1) { | |
Debug.Log("Likhon------------**********----------- : Already bought "); | |
} | |
} | |
public void ProductPay() | |
{ | |
ProductPayRequest request = new ProductPayRequestBuild() | |
.Info(merchantName, productNo, DateTime.Now.ToString("yyyyMMddhhmmssfff")) | |
.OptServiceCatalog("X6") // game | |
.RsaSign(rsaPrivateKey)// or OptSign(“signedString”) | |
.Build(); | |
Purchasing.ProductPay(request, new ProductPayImpl()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment