void successInit() { // AbrStudioIab started successfully. Debug.Log("AbrStudioIab started successfully."); // Querying inventory for owned items, providing a list of skus. AbrStudioIab.QueryInventory(new[] { SampleSku }, successQueryInventory, failedQueryInventory); }
void successPurchase(Purchase purchase) { // Purchase was successfull. // You can find purchase token and other details in purchase object. Debug.Log("Purchase was successful."); // Consuming purchase after successfull purchase // You can consume the purchase whenever you want. AbrStudioIab.Consume(purchase, successConsume, failedConsume); // AbrStudioIab.MultiConsume(new[] {purchase}, multiConsumeResult); }
public void Start() { AndroidJNIHelper.debug = false; // Just for debug mode and testing AbrStudio.EnableDebug(); // Comment this line for production // First of all you have to initialize the AbrStudio sdk using your app's API & Sign key. AbrStudio.Initialize(ApiKey, SignKey); /* * You have to call AbrStudioIab#Start function before doing anything else related to in-app-billing. */ AbrStudioIab.Start(IabPublicKey, successInit, failedInit); }
private void OnGUI() { GUILayout.BeginArea(new Rect(10f, 10f, Screen.width - 15f, Screen.height - 15f)); GUI.skin.button.fixedHeight = 50; GUI.skin.button.fontSize = 20; if (Button("Purchase Test")) { // User clicked the "Purchase Test" button // Generating Guid as developer payload just for test. // You have to generate and pass your own developer payload string to AbrStudioIab#Purchase function string developerPayload = Guid.NewGuid().ToString(); // launching the purchase flow // You will be notified of purchase result via successPurchase or failedPurchase actions. AbrStudioIab.Purchase(SampleSku, developerPayload, successPurchase, failedPurchase); } GUILayout.EndArea(); }