コード例 #1
0
    public void ClickStart()
    {
        if (BarcodeScanner == null)
        {
            Log.Warning("No valid camera - Click Start");
            return;
        }

        // Start Scanning
        BarcodeScanner.Scan((barCodeType, barCodeValue) => {
            BarcodeScanner.Stop();
            TextHeader.text = "Found: " + barCodeType + " / " + barCodeValue;

            Debug.Log("Now scanning...");
            Boot.scanAmount = Boot.scanAmount + 1;
            caller.CallAPI();

            Data.scans++;
            Data.experience    = Data.experience + UnityEngine.Random.Range(3, 8);
            Data.currentScanID = barCodeValue;
            Debug.Log("Now loading product page with ID..." + Data.currentScanID);
            SceneManager.LoadScene("ProductPage");
            // Feedback
            Audio.Play();


                        #if UNITY_ANDROID || UNITY_IOS
            Handheld.Vibrate();
                        #endif
        });
    }
コード例 #2
0
        public static void JoinChannel(string channelId)
        {
            APICaller AC      = new APICaller();
            var       content = new FormUrlEncodedContent(new[] {
                new KeyValuePair <string, string>("token", AuthToken),
                new KeyValuePair <string, string>("name", channelId)
            });

            AC.CallAPI(content, "https://slack.com/api/channels.join");
        }
コード例 #3
0
        private static string GetWSConnectionString()
        {
            string ConnectionString = null;
            var    content          = new FormUrlEncodedContent(new[] {
                new KeyValuePair <string, string>("token", AuthToken),
                new KeyValuePair <string, string>("simple_latest", ""),
                new KeyValuePair <string, string>("no_unreads", "")
            });
            APICaller AC = new APICaller();

            ConnectionString = AC.CallAPI(content, "https://slack.com/api/rtm.start")["url"].ToString();
            return(ConnectionString);
        }
コード例 #4
0
ファイル: Users.cs プロジェクト: BjornKjellkvist/IZSlackBot
 /// <summary>
 /// clears the list and fetches a new list of users from slack
 /// </summary>
 public static void FetchAllUsers()
 {
     //made this thread safe for no reason
     lock (locked) {
         _Users.RemoveRange(0, _Users.Count());
         APICaller AC      = new APICaller();
         var       content = new FormUrlEncodedContent(new[] {
             new KeyValuePair <string, string>("token", SlackConnector.AuthToken)
         });
         var response = AC.CallAPI(content, "https://slack.com/api/users.list");
         var Users    = response.ToObject <RTMListOfUsers>();
         foreach (var u in Users.members)
         {
             _Users.Add(User.convertFromMember(u));
         }
     }
 }
コード例 #5
0
ファイル: SharedSteps.cs プロジェクト: CLeach85/BDCodeTest
 public void WhenICallTheAPI()
 {
     apiContext.result = APICaller.CallAPI(apiContext.path);
 }