RegisterPushAsync() public method

Method which, by making a call to the service, registers your device to push notifications hub.
public RegisterPushAsync ( PushRegistration pushRegistration ) : Task
pushRegistration BuildIt.Web.Models.PushNotifications.PushRegistration
return Task
 private async Task RegisterForPushNotification(string deviceToken)
 {
     try
     {
         var registration = new PushRegistration()
         {
             Handle = deviceToken,
             RegistrationId = RetrieveCurrentRegistrationId?.Invoke(),
             Platform = PushPlatform.WNS
         };
         var botClientMobileAppClient = new BotClientMobileAppClient(endpointRouteDetails);
         var hubRegistrationResult = await botClientMobileAppClient.RegisterPushAsync(registration);
         if (hubRegistrationResult != null)
         {
             RegistrationSuccessful?.Invoke(hubRegistrationResult.RegistrationId);
         }
         else
         {
             RegistrationFailure?.Invoke(new Exception("Registration Failure"));
         }
     }
     catch (Exception ex)
     {
         RegistrationFailure?.Invoke(ex);
         Debug.WriteLine(ex.Message);
     }
 }