コード例 #1
0
        /// This is the specific download request for the user list from Slack and saves it to the load storage for quick reloading if internet is not available, Ideally this is would have been stored in database
        private async Task DownloadData()
        {
            SlackAPIRequests slackapirequests = new SlackAPIRequests();
            slackapirequests.AddUrlParameter("presence", "1");

            //In a more complete solution I would put token as part of a logged in User Security Class, this allows for easier profile switching and portability as it can also be saved in the 
            //users roaming profile for Windows 8.1/10 or other Windows Phones. HERE IS JUST A SAMPLE TOKEN JUST REPLACE WITH YOUR OWN TEAMS TOKEN TO PLAY WITH
            String contentstring = await slackapirequests.SlackAPIGETRequest("xoxp-5048173296-5048487710-19045732087-b5427e3b46", "https://slack.com/api/users.list");

            if (contentstring.StartsWith("Error: No ") == false && contentstring.StartsWith("Connection Error: ") == false)
            {
                ParseJSONStringData(contentstring);
            }
            else
            {
                //If error occurs with token they need to be handled here, such as re-authentication, if connection error, the users has already been notified about this issue with a popup.
            }
        }
コード例 #2
0
 public UsersListViewModel()
 {
     slackAPIRequests = new SlackAPIRequests();
 }