Example #1
0
        private void ProcessNotification(NSDictionary options, bool fromFinishedLaunching)
        {
            // check for a notification
            if (options != null)
            {
                // check for a local notification
                if (options.ContainsKey(UIApplication.LaunchOptionsLocalNotificationKey))
                {
                    Debug.WriteLine("Local notification recieved");
                    ProcessLocalNotification(options);
                    return;
                }

                // Check for push notification
                if (options.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey))
                {
                    options = options.GetTypeValueFromOptions <NSDictionary>(UIApplication.LaunchOptionsRemoteNotificationKey);
                }

                if (options.ContainsKey(new NSString("aps")))
                {
                    Debug.WriteLine("Push notification recieved");
                    ProcessPushNotification(options, fromFinishedLaunching);
                    return;
                }

                Debug.WriteLine($"Notification recieved but is not a local and does not contain 'aps' signature, first entry : {options.First()}");
            }
            else
            {
                Debug.WriteLine("Process notification options = null");
            }
        }