Exemple #1
0
    void CheckForOffer()
    {
        ProductCheckRequest requestForIphone = new ProductCheckRequest();

        print("Here backtory");

        // Request server whether iphone is available or not
        BacktoryCloudcode.RunInBackground <ProductCheckResponse>(
            // Name of cloud code function
            "test",

            // Request for iphone
            requestForIphone,

            // Callback to handle result
            backtoryResponse =>
        {
            print(backtoryResponse.Code);
            if (backtoryResponse.Successful)
            {     // = context.succeed is called in server
                // Extract ok and price from response
                ProductCheckResponse result = backtoryResponse.Body;
                StartCoroutine(loadPanel(result.Img));
                StartCoroutine(LoadButton(result.URL));

                // Log the result
            }
        }
            );
    }
Exemple #2
0
 public void onSearchCloudCode()
 {
     BacktoryCloudcode.RunInBackground <Person> ("hello", new Info()
     {
         Id = "453"
     }, response => {
         if (response.Successful)
         {
             Person person   = response.Body;
             ResultText.text = "Search result.\nname: " + person.Name;
         }
         else
         {
             ResultText.text = "Search failed;\n" + response.Code + " " + ((BacktoryHttpStatusCode)response.Code).ToString();
         }
     });
 }
Exemple #3
0
 /*
  * CloudCode
  */
 public void onEchoCloudCode()
 {
     BacktoryCloudcode.RunInBackground("echo", "Hello World!", PrintCallBack <string> ());
 }