Exemple #1
0
 private async void InstanceOnConnectionStatusChanged(AdpPushClient sender, ConnectionStatusType connectionStatus)
 {
     await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                   () =>
     {
         ConnectionState(connectionStatus == ConnectionStatusType.Connected);
     });
 }
        private void InstanceOnPushNotificationReceived(AdpPushClient sender, PushMessageReceive message)
        {
            if (message.SenderId != AppSetting.UserId)
            {
                if (string.IsNullOrEmpty(message.Body))
                {
                    return;
                }

                LocalDatabase.Instance.InsertMessageToDatabase(message);

                if (MessageReceived != null)
                {
                    MessageReceived.Invoke(message);
                }
            }
        }