コード例 #1
0
        public void initialise (IBillingServiceCallback callback) {
            this.callback = callback;
            if (null == publicKey || publicKey.Equals ("[Your key]")) {
                callback.logError (UnibillError.GOOGLEPLAY_PUBLICKEY_NOTCONFIGURED, publicKey);
                callback.onSetupComplete (false);
                return;
            }

            var encoder = new Dictionary<string, object>();
            encoder.Add ("publicKey", this.publicKey);
            var productIds = new List<string>();
            List<object> products = new List<object>();
            foreach (var item in db.AllPurchasableItems) {
                Dictionary<string, object> product = new Dictionary<string, object>();
                var id = remapper.mapItemIdToPlatformSpecificId(item);
                productIds.Add(id);
                product.Add ("productId", id);
                product.Add ("consumable", item.PurchaseType == PurchaseType.Consumable);
                products.Add (product);
            }
            encoder.Add("products", products);

            var json = encoder.toJson();
            rawInterface.initialise(this, json, productIds.ToArray());
        }
コード例 #2
0
		public void initialise (IBillingServiceCallback biller)
		{
			this.callback = biller;
			rawSamsung.initialise (this);

			var encoder = new Dictionary<string, object>();
			encoder.Add ("mode", config.SamsungAppsMode.ToString());
			encoder.Add ("itemGroupId", config.SamsungItemGroupId);

			rawSamsung.getProductList (encoder.toJson());
		}
コード例 #3
0
ファイル: MyClass.cs プロジェクト: jeedee/ness-node-unity3d
        public void RemoteExecute(string method, params object[] args)
        {
            Dictionary<string, object> request = new Dictionary<string, object>();
            Dictionary<string, object> requestData = new Dictionary<string, object>();

            // Op code
            request.Add("op", Ness.Op.EXECUTE);

            // Create the data dict
            requestData.Add("method", method);
            requestData.Add("parameters", args);

            // Add it to the request
            request.Add("data", requestData);

            socket.Send(request.toJson());
        }
コード例 #4
0
ファイル: FacebookAndroid.cs プロジェクト: VidicTH/SexyPuzzle
		// Calls a custom Graph API method with the key/value pairs in the Dictionary.  Pass in a null dictionary if no parameters are needed.
		public static void graphRequest( string graphPath, string httpMethod, Dictionary<string,string> parameters )
		{
			if( Application.platform != RuntimePlatform.Android )
				return;

			parameters = parameters ?? new Dictionary<string,string>();

			// call off to java land
			if( !isSessionValid() )
				babysitRequest( true, () => { _facebookPlugin.Call( "graphRequest", graphPath, httpMethod, parameters.toJson() ); } );
			else
				_facebookPlugin.Call( "graphRequest", graphPath, httpMethod, parameters.toJson() );
		}
コード例 #5
0
ファイル: FacebookAndroid.cs プロジェクト: VidicTH/SexyPuzzle
		// Shows the native Facebook Share Dialog. Valid dictionary keys are: description, title, contentURL, imageURL.
		// Results in the shareDialogSucceeded/FailedEvent firing.
		public static void showFacebookShareDialog( Dictionary<string,object> parameters )
		{
			if( Application.platform != RuntimePlatform.Android )
				return;

			_facebookPlugin.Call( "showFacebookShareDialog", parameters.toJson() );
		}
コード例 #6
0
ファイル: TwitterAndroid.cs プロジェクト: VidicTH/SexyPuzzle
		// Performs a request for any available Twitter API methods.  methodType must be either "get" or "post".  path is the
		// url fragment from the API docs (excluding https://api.twitter.com) and parameters is a dictionary of key/value pairs
		// for the given method.  See Twitter's API docs for all available methods
		public static void performRequest( string methodType, string path, Dictionary<string,string> parameters )
		{
			if( Application.platform != RuntimePlatform.Android )
				return;

			string param = parameters != null ? parameters.toJson() : string.Empty;
			_plugin.Call( "performRequest", methodType, path, param );
		}
コード例 #7
0
ファイル: FacebookBinding.cs プロジェクト: VidicTH/SexyPuzzle
		// Shows the Facebook share dialog. Valid dictionary keys (from FBSDKShareLinkContent) are: description, title, contentURL, imageURL.
		// Results in the shareDialogSucceeded/FailedEvent firing.
		public static void showFacebookShareDialog( Dictionary<string,object> parameters )
		{
			if( Application.platform == RuntimePlatform.IPhonePlayer )
				_facebookShowFacebookShareDialog( parameters.toJson() );
		}
コード例 #8
0
ファイル: FacebookBinding.cs プロジェクト: VidicTH/SexyPuzzle
		// Allows you to use any available Facebook Graph API method
	    public static void graphRequest( string graphPath, string httpMethod, Dictionary<string,object> keyValueHash )
	    {
	        if( Application.platform == RuntimePlatform.IPhonePlayer )
			{
				// convert the Dictionary to JSON
				string jsonDict = keyValueHash.toJson();
				if( jsonDict != null )
				{
					// if we arent logged in start up the babysitter
					if( !isSessionValid() )
					{
						babysitRequest( true, () => { _facebookGraphRequest( graphPath, httpMethod, jsonDict ); } );
					}
					else
					{
						_facebookGraphRequest( graphPath, httpMethod, jsonDict );
					}
				}
	 		}
		}