Ejemplo n.º 1
0
        /// <summary>
        /// iOS 6 SKStoreProductViewController display
        /// </summary>
        void Buy(int productId)
        {
            Console.WriteLine("Buy " + productId);

            var spp = new StoreProductParameters(productId);

            var productViewController = new SKStoreProductViewController();

            productViewController.Finished += (sender, err) => {
                Console.WriteLine("ProductViewDelegate Finished");

                // Apple's docs says to use this
                this.DismissModalViewControllerAnimated(true);
            };

            productViewController.LoadProduct(spp, (ok, err) => {
                Console.WriteLine("load product");
                if (ok)
                {
                    PresentModalViewController(productViewController, true);
                }
                else
                {
                    Console.WriteLine(" failed ");
                    if (err != null)
                    {
                        Console.WriteLine(" with error " + err);
                    }
                }
            });
        }
Ejemplo n.º 2
0
        public void InitiateReviewProcess(int appID)
        {
            Successful = false;
            ErrorMessage = "";

            StoreProductParameters spp = new StoreProductParameters(appID);

            if (_rootViewController == null)
            {
                _rootViewController = UIApplication.SharedApplication.Windows[0].RootViewController;
            }

            _storeProductViewController.LoadProduct(spp, (ok, err) => {
                if (ok) {
                    _rootViewController.PresentViewController(_storeProductViewController,true,() => {
                        Successful = true;
                    });
                } else if (err != null) {
                    ErrorMessage = err.ToString();
                }
            });
        }
		/// <summary>
		/// iOS 6 SKStoreProductViewController display
		/// </summary>
		void Buy (int productId)
		{
			Console.WriteLine ("Buy " + productId);

			var spp = new StoreProductParameters(productId);

			var productViewController = new SKStoreProductViewController ();
			productViewController.Finished += (sender, err) => {
				Console.WriteLine ("ProductViewDelegate Finished");

				// Apple's docs says to use this
				this.DismissModalViewController (true);
			};

			productViewController.LoadProduct (spp, (ok, err) => {
				Console.WriteLine ("load product");
				if (ok) {
					PresentModalViewController (productViewController, true);
				} else {
					Console.WriteLine (" failed ");
					if (err != null)
						Console.WriteLine (" with error " + err);
				}
			});
		}