BuildIt.Bot.Client.Impl.UWP.BotClientApplicationBase.RegisterForPushNotification C# (CSharp) Method

RegisterForPushNotification() private method

private RegisterForPushNotification ( string deviceToken ) : System.Threading.Tasks.Task
deviceToken string
return System.Threading.Tasks.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);
            }
        }