Exemplo n.º 1
0
 public static void TryGetImpersonationToken(ImpersonationTokenResponse response)
 {
     // if the user is logged in and has an alias ID, try to get it
     if (MobileApp.Shared.Network.RockMobileUser.Instance.LoggedIn == true && MobileApp.Shared.Network.RockMobileUser.Instance.Person.PrimaryAliasId.HasValue == true)
     {
         // make the request
         ApplicationApi.GetImpersonationToken(MobileApp.Shared.Network.RockMobileUser.Instance.Person.Id,
                                              delegate(System.Net.HttpStatusCode statusCode, string statusDescription, string impersonationToken)
         {
             // whether it succeeded or not, hand them the response
             response(impersonationToken);
         });
     }
     else
     {
         // they didn't pass requirements, so hand back an empty string.
         response(string.Empty);
     }
 }