public void CallEndedEvent(CTCall call)
 {
     if (TelephoneManager.IsListening && call.CallState == "CTCallStateDisconnected")
     {
         TelephoneManager.IsListening = false;
         CoreDependencyService.SendViewModelMessage(TelephoneManager.CallBackKey, true);
     }
 }
Пример #2
0
        public override void WillPresentNotification(UNUserNotificationCenter center, UNNotification notification, Action <UNNotificationPresentationOptions> completionHandler)
        {
            DependencyService.Get <INotificationManager>().ReceiveNotification(notification.Request.Content.Title, notification.Request.Content.Body);

            var dict = new Dictionary <string, string>();

            dict.Add("Title", notification.Request.Content.Title);
            dict.Add("Message", notification.Request.Content.Body);

            foreach (var key in notification.Request.Content.UserInfo.Keys)
            {
                dict.Add(key.ToString(), notification.Request.Content.UserInfo[key].ToString());
            }

            CoreDependencyService.SendViewModelMessage(CoreSettings.RemoteNotificationReceived, dict);

            // alerts are always shown for demonstration but this can be set to "None"
            // to avoid showing alerts if the app is in the foreground
            completionHandler(UNNotificationPresentationOptions.Alert);
        }
Пример #3
0
 /// <summary>
 /// Broadcast message to a particular view model instance
 /// </summary>
 /// <param name="key">Key.</param>
 /// <param name="obj">Object.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 protected void SendViewMessage <T>(string key, object obj) where T : CoreViewModel
 {
     CoreDependencyService.SendViewModelMessage <T>(key, obj);
 }
Пример #4
0
 /// <summary>
 /// Broadcast message to all view model instances
 /// </summary>
 /// <param name="key">Key.</param>
 /// <param name="obj">Object.</param>
 protected void SendViewMessage(string key, object obj)
 {
     CoreDependencyService.SendViewModelMessage(key, obj);
 }