コード例 #1
0
        async void UpdateAccessToken()
        {
            SocialNetworkModel network = SL.GetNetworkForName("Facebook");

            if (network == null)
            {
                Console.WriteLine("Unexpected: Facebook network model not found for logged in user");
                return;
            }
            string AccessTokenString = AccessToken.CurrentAccessToken?.Token;

            if (!string.IsNullOrEmpty(AccessTokenString) && network.AccessToken != AccessTokenString)
            {
                network.AccessToken = AccessTokenString;
                await SL.Manager.SaveNetworkAsync(network, true, (responseModel) => { Console.WriteLine("Access Token Update " + (responseModel.ResponseCode == 1 ? "Successful" : "Failed")); });

                Console.WriteLine("End Updating Facebook Access Token");
                return;
            }
            Console.WriteLine("Unexpected: Facebook AccessToken is null for logged in user");
        }