public void NewObject()
    {
        var obj = new SKProductsRequest("woot");

        Assert.AreNotEqual(IntPtr.Zero, obj.ClassHandle);
        Assert.AreNotEqual(IntPtr.Zero, obj.Handle);
    }
 public void Start()
 {
     string productId = "woot";
     var request = new SKProductsRequest(productId);
     request.ReceivedResponse += (sender, e) =>
     {
         Assert.AreEqual(productId, e.Response.InvalidProducts[0]);
         Console.WriteLine("Received Response!");
     };
     request.Failed += (sender, e) =>
     {
         Console.WriteLine("Failed: " + e.Error.LocalizedDescription);
     };
     request.Finished += (sender, e) =>
     {
         Console.WriteLine("Finished!");
     };
     request.Start();
 }
Esempio n. 3
0
	public void GetIAPPrices()
	{
		if (Application.platform != RuntimePlatform.IPhonePlayer)
		{
			Debug.Log("Only supported on iOS!");
			return;
		}

		//NOTE: for this to work, your app's bundle ID should match what you have setup in iTunes Connect
		//	Each in-app purchase ID should be what you have setup in iTunes Connect also
		var request = new SKProductsRequest("com.yourcompany.iap1", "com.yourcompany.iap2");
		request.Failed += (sender, e) => 
		{
			Debug.Log("Error retrieviing prices: " + e.Error.LocalizedDescription);
		};
		request.ReceivedResponse += (sender, e) => 
		{
			//Invalid ones -- this will print out by default
			if (e.Response.InvalidProducts != null)
			{
				foreach (string invalidId in e.Response.InvalidProducts) 
				{
					Debug.Log ("Invalid ID: " + invalidId);
				}
			}

			//Successful ones
			PrintProducts(e.Response.Products);
		};
		request.Start();
	}
 public void ObjectSame()
 {
     var a = new SKProductsRequest("woot");
     var b = Runtime.GetNSObject<SKProductsRequest>(a.Handle);
     Assert.AreSame(a, b);
 }
 public void NewObjectDispose()
 {
     var obj = new SKProductsRequest("woot");
     obj.Dispose();
 }