Пример #1
0
        void PayPalFuturePaymentViewController(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization)
        {
            Debug.WriteLine("PayPal Future Payment Authorization Success!");
            futurePaymentViewController?.DismissViewController(true, () =>
            {
                NSError err     = null;
                NSData jsonData = NSJsonSerialization.Serialize(futurePaymentAuthorization, NSJsonWritingOptions.PrettyPrinted, out err);
                NSString first  = new NSString("");
                if (err == null)
                {
                    first = new NSString(jsonData, NSStringEncoding.UTF8);
                }
                else
                {
                    Debug.WriteLine(err.LocalizedDescription);
                }

                _onSuccess?.Invoke(first.ToString());
                _onSuccess = null;
                if (!_formsConfig.StoreUserData)
                {
                    ClearUserData();
                }
            });
        }
Пример #2
0
        public static string ToJson(this NSDictionary dictionary)
        {
            var json = NSJsonSerialization.Serialize(dictionary,
                                                     NSJsonWritingOptions.SortedKeys, out NSError error);

            return(json.ToString(NSStringEncoding.UTF8));
        }
Пример #3
0
        private void receivedPushNotification(NSDictionary userInfo, UIApplication application)
        {
            if (application.ApplicationState == UIApplicationState.Active)
            {
                return;
            }

            var aps = userInfo.ObjectForKey(new NSString("aps")) as NSDictionary;

            if (aps != null)
            {
                string message    = aps.ObjectForKey(new NSString("alert")) as NSString;
                var    parameters = aps.ObjectForKey(new NSString("parameters")) as NSDictionary;

                NSError error;
                var     json = NSJsonSerialization.Serialize(parameters, NSJsonWritingOptions.PrettyPrinted, out error);
                Newtonsoft.Json.Linq.JObject jObject = Newtonsoft.Json.Linq.JObject.Parse(json.ToString(NSStringEncoding.UTF8));

                Notification _notification = new Notification()
                {
                    Message    = message,
                    Parameters = jObject
                };

                crossApp.OnPushNotification(_notification);
            }
        }
Пример #4
0
        public iOSGraphResponse(NSMutableDictionary graphResponse)
        {
            NSError error;
            NSData  jsonData = NSJsonSerialization.Serialize(graphResponse, NSJsonWritingOptions.PrettyPrinted, out error);

            RawResponse = jsonData.ToString();
        }
Пример #5
0
        void FirebaseDatabaseService.AddValueEvent <T>(string nodeKey, Action <T> action)
        {
            DatabaseReference rootRef = Database.DefaultInstance.GetRootReference();

            DatabaseReference nodeRef = rootRef.GetChild(nodeKey);

            nuint handleReference = nodeRef.ObserveEvent(DataEventType.Value, (snapshot) =>
            {
                if (snapshot.Exists && snapshot.HasChildren && action != null)
                {
                    NSDictionary itemDict = snapshot.GetValue <NSDictionary>();
                    NSError error         = null;
                    string itemDictString = NSJsonSerialization.Serialize(itemDict, NSJsonWritingOptions.PrettyPrinted, out error).ToString();

                    T item = JsonConvert.DeserializeObject <T>(itemDictString);
                    action(item);
                }
                else
                {
                    T item = default(T);
                    action(item);
                }
            });

            ValueEventHandles[nodeKey] = handleReference;
        }
        private static string DictionaryToJson(NSDictionary dictionary)
        {
            NSError error;
            var     json = NSJsonSerialization.Serialize(dictionary, NSJsonWritingOptions.PrettyPrinted, out error);

            return(json.ToString(NSStringEncoding.UTF8));
        }
        public override void SendMessage(ARDSignalingMessage message)
        {
            Contract.Requires(!string.IsNullOrEmpty(RoomId));
            var data    = message.JsonData;
            var payload = data != null ? new NSString(data, NSStringEncoding.UTF8) : new NSString("{}");

            switch (State)
            {
            case ARDSignalingChannelState.Registered:
                var messageDict = new NSDictionary(
                    "cmd", "send",
                    "msg", payload);

                var messageJSON = NSJsonSerialization.Serialize(
                    messageDict, NSJsonWritingOptions.PrettyPrinted, out NSError err);

                var messageString = new NSString(
                    messageJSON, NSStringEncoding.UTF8);
                SendMessage(messageString);
                break;

            default:
                Debug.WriteLine($"C->WSS POST:{payload}");
                var url = new NSUrl(WebRestFormated);
                url.SendAsyncPostToURL(data, null);
                break;
            }
        }
Пример #8
0
            public override void DidAuthorizeFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization)
            {
                // The user has successfully logged into PayPal, and has consented to future payments.
                // Your code must now send the authorization response to your server.
                try
                {
                    NSError error;
                    var     contentJsonData = NSJsonSerialization.Serialize(futurePaymentAuthorization, NSJsonWritingOptions.PrettyPrinted, out error);

                    if (error != null)
                    {
                        throw new Exception(error.LocalizedDescription + " " + error.LocalizedFailureReason);
                    }

                    var authResponse = contentJsonData.ToString().FromJson <FuturePaymentAuthorization>();
                    if (authResponse != null)
                    {
                        _futurePaymentAuthorized(authResponse.Response.Code);
                    }

                    // Be sure to dismiss the PayPalLoginViewController.
                    futurePaymentViewController.DismissViewController(true, null);
                }
                catch (Exception e)
                {
                    Logger.LogError(e);
                    Mvx.Resolve <IMessageService>().ShowMessage(Mvx.Resolve <ILocalization>()["Error"], e.GetBaseException().Message);
                }
            }
Пример #9
0
        public static PushNotification PushNotificationFromUserInfo(NSDictionary pushNotification)
        {
            NSDictionary apnPayload    = Instance.nativeManager.GetApnPayload(pushNotification);
            bool         alertIsDict   = apnPayload["alert"] is NSDictionary;
            NSObject     messageObject = null;
            NSObject     titleObject   = null;

            if (alertIsDict)
            {
                titleObject   = (apnPayload["alert"] as NSDictionary)["title"];
                messageObject = (apnPayload["alert"] as NSDictionary)["body"];
            }
            else
            {
                messageObject = apnPayload["alert"];
            }
            NSError error             = null;
            string  pushPayloadString = new NSString(NSJsonSerialization.Serialize(pushNotification, 0, out error), NSStringEncoding.UTF8);

            return(new PushNotification
            {
                Message = messageObject != null?messageObject.ToString() : null,
                              Title = titleObject != null?titleObject.ToString() : null,
                                          CustomData = Instance.nativeManager.GetCustomPushData(pushNotification),
                                          Payload = pushPayloadString
            });
        }
        public ALConversationProxy createConversation()
        {
            ALConversationProxy alConversationProxy = new ALConversationProxy();

            alConversationProxy.TopicId = @"laptop01";
            alConversationProxy.UserId  = @"adarshk";

            // Note : Uncomment following two lines to set SMS fallback's format.

            /*
             *      [alConversationProxy setSenderSMSFormat:@"SENDER SMS FORMAT"];
             *      [alConversationProxy setReceiverSMSFormat:@"RECEIVER SMS FORMAT"];
             */

            ALTopicDetail ALTopicDetail = new ALTopicDetail();

            ALTopicDetail.Title    = @"Mac Book Pro";
            ALTopicDetail.Subtitle = @"13' Retina";
            ALTopicDetail.Link     = @"https://raw.githubusercontent.com/AppLozic/Applozic-iOS-SDK/master/macbookpro.jpg";
            ALTopicDetail.Key1     = @"Product ID";
            ALTopicDetail.Value1   = @"mac-pro-r-13";
            ALTopicDetail.Key2     = @"Price";
            ALTopicDetail.Value2   = @"Rs.1,04,999.00";
            NSDictionary dict      = ALTopicDetail.Dictionary;
            NSError      error     = null;
            NSData       TopicData = NSJsonSerialization.Serialize(dict, 0, out error);

            string resultTopicDetails = new NSString(TopicData, NSStringEncoding.UTF8);

            Console.WriteLine("ALTopicDetail ### {0} ", resultTopicDetails);

            alConversationProxy.TopicDetailJson = resultTopicDetails;

            return(alConversationProxy);
        }
Пример #11
0
        public static T DeserializePushNotificationObject <T>(NSDictionary userInfo)
        {
            NSError error;
            var     data = NSJsonSerialization.Serialize(userInfo["aps"], NSJsonWritingOptions.PrettyPrinted, out error);
            var     json = NSString.FromData(data, NSStringEncoding.UTF8).ToString();

            return(JsonConvert.DeserializeObject <T>(json));
        }
Пример #12
0
        void RequestUserData(Dictionary <string, object> fieldsDictionary)
        {
            string[] fields      = new string[] { };
            var      extraParams = string.Empty;

            if (fieldsDictionary != null && fieldsDictionary.ContainsKey("fields"))
            {
                fields = fieldsDictionary["fields"] as string[];
                if (fields.Length > 0)
                {
                    extraParams = $"?fields={string.Join(",", fields)}";
                }
            }

            //email,first_name,gender,last_name,birthday

            if (AccessToken.CurrentAccessToken != null)
            {
                Dictionary <string, object> userData = new Dictionary <string, object>();
                var graphRequest      = new GraphRequest($"/me{extraParams}", null, AccessToken.CurrentAccessToken.TokenString, null, "GET");
                var requestConnection = new GraphRequestConnection();
                requestConnection.AddRequest(graphRequest, (connection, result, error) =>
                {
                    if (error == null)
                    {
                        NSData responseData = NSJsonSerialization.Serialize(result, NSJsonWritingOptions.PrettyPrinted, out NSError jsonError);
                        if (jsonError == null)
                        {
                            NSString responseString = NSString.FromData(responseData, NSStringEncoding.UTF8);
                            var fbResponse          = new FBEventArgs <string>(responseString, FacebookActionStatus.Completed);
                            OnUserData?.Invoke(this, fbResponse);
                            _userDataTcs?.TrySetResult(new FacebookResponse <string>(fbResponse));
                        }
                        else
                        {
                            var fbResponse = new FBEventArgs <string>(null, FacebookActionStatus.Error, $" Facebook response parse failed - {jsonError.Code} - {jsonError.Description}");
                            OnUserData?.Invoke(this, fbResponse);
                            _userDataTcs?.TrySetResult(new FacebookResponse <string>(fbResponse));
                        }
                    }
                    else
                    {
                        var fbArgs = new FBEventArgs <string>(null, FacebookActionStatus.Error, $"Facebook User Data Request Failed - {error.Code} - {error.Description}");
                        OnUserData?.Invoke(this, fbArgs);
                        _userDataTcs?.TrySetResult(new FacebookResponse <string>(fbArgs));
                    }
                });
                requestConnection.Start();
            }
            else
            {
                var fbArgs = new FBEventArgs <string>(null, FacebookActionStatus.Canceled, "User cancelled facebook operation");
                OnUserData?.Invoke(this, null);
                _userDataTcs?.TrySetResult(new FacebookResponse <string>(fbArgs));
            }
        }
 public static Dictionary<string, object> NSDictToPureDict(NSDictionary nsDict)
 {
    if (nsDict == null)
       return null;
    NSError error;
    NSData jsonData = NSJsonSerialization.Serialize(nsDict, 0, out error);
    NSString jsonNSString = NSString.FromData(jsonData, NSStringEncoding.UTF8);
    string jsonString = jsonNSString.ToString();
    return Json.Deserialize(jsonString) as Dictionary<string, object>;
 }
Пример #14
0
        public override void WillPresentNotification(UNUserNotificationCenter center, UNNotification notification, Action <UNNotificationPresentationOptions> completionHandler)
        {
            try {
                if (!(notification.Request.Content.UserInfo.ObjectForKey(new NSString("aps")) is NSDictionary aps))
                {
                    return;
                }

                if (notification.Request.Identifier == REBUILD_NOTIFICATION_KEY)
                {
                    completionHandler(UNNotificationPresentationOptions.Sound | UNNotificationPresentationOptions.Alert);
                }
                else
                {
                    NSData jsonData   = NSJsonSerialization.Serialize(aps, 0, out NSError error);
                    string jsonResult = jsonData.ToString();
                    bool   forMe      = default(bool);

                    NotificationMessage notificationMessage = Newtonsoft.Json.JsonConvert.DeserializeObject <NotificationMessage>(jsonResult);
                    forMe = BaseSingleton <GlobalSetting> .Instance.UserProfile?.NetId == notificationMessage.UserNetId;

                    if (forMe)
                    {
                        // Rebuild notification
                        var content = new UNMutableNotificationContent {
                            Sound    = UNNotificationSound.Default,
                            Title    = "Запит по фізичній особі",
                            Body     = "Оброблено",
                            UserInfo = notification.Request.Content.UserInfo
                        };

                        // New trigger time
                        var trigger = UNTimeIntervalNotificationTrigger.CreateTrigger(1, false);

                        // ID of Notification to be updated
                        var requestID = REBUILD_NOTIFICATION_KEY;
                        var request   = UNNotificationRequest.FromIdentifier(requestID, content, trigger);

                        // Add to system to modify existing Notification
                        UNUserNotificationCenter.Current.AddNotificationRequest(request, (err) => {
                            if (err != null)
                            {
                                // Do something with error...
                                Debugger.Break();
                            }
                        });
                    }
                }
            } catch (Exception ex) {
                string message = ex.Message;
                Debugger.Break();
            }
        }
        public static string NSDictToString(NSDictionary nsDict)
        {
            if (nsDict == null)
            {
                return(null);
            }
            NSError  error;
            NSData   jsonData     = NSJsonSerialization.Serialize(nsDict, 0, out error);
            NSString jsonNSString = NSString.FromData(jsonData, NSStringEncoding.UTF8);

            return(jsonNSString.ToString());
        }
        public static Dictionary <string, string> NSObjectToPureDict(NSObject nSObject)
        {
            if (nSObject == null)
            {
                return(null);
            }
            NSError  error;
            NSData   jsonData     = NSJsonSerialization.Serialize(nSObject, 0, out error);
            NSString jsonNSString = NSString.FromData(jsonData, NSStringEncoding.UTF8);
            string   jsonString   = jsonNSString.ToString();

            return(Json.Deserialize(jsonString) as Dictionary <string, string>);
        }
Пример #17
0
        public async Task HandleMessageReceivedAsync(UIApplicationState applicationState, NSDictionary userInfo)
        {
            var data = NSJsonSerialization.Serialize(userInfo, 0, out var error);
            var json = data.ToString();

            if (applicationState == UIApplicationState.Active)
            {
                _pushNotificationsService.HandleForegroundNotification(json);
            }
            else
            {
                await _pushNotificationsService.HandleNotificationTappedAsync(json);
            }
        }
        private T DeserializeDictionary <T>(NSDictionary dict)
        {
            if (dict != null)
            {
                NSError jsonError;
                var     jsonData = NSJsonSerialization.Serialize(dict, NSJsonWritingOptions.PrettyPrinted, out jsonError);
                if (jsonData != null)
                {
                    var jsonString = new NSString(jsonData, NSStringEncoding.UTF8);
                    return(DeserializeString <T>(jsonString));
                }
            }

            return(default(T));
        }
        public void ExecuteAsync(FBGraphRequest request)
        {
            NSDictionary parameters = null;

            if (request.Parameters != null)
            {
                parameters = NSDictionary.FromObjectsAndKeys(request.Parameters.Values.ToArray(), request.Parameters.Keys.ToArray());
            }

            //throw new NotImplementedException();
            new FBSDKGraphRequest(request.GraphPath, parameters, FBSDKAccessToken.Current.TokenString, null, ConvertMethod(request.Method)).
            StartWithCompletionHandler((connection, result, error) => {
                NSError errorJson;
                request.Completed?.Invoke(NSJsonSerialization.Serialize(result, NSJsonWritingOptions.PrettyPrinted, out errorJson).ToString());
            });
        }
Пример #20
0
        public static Dictionary <string, object> ToDictionary(IOSNativeBranch.BranchUniversalObject universalObject)
        {
            if (universalObject == null)
            {
                return(new Dictionary <string, object> ());
            }

            var keywordsList = new List <object>();

            if (universalObject.Keywords != null)
            {
                foreach (string obj in universalObject.Keywords)
                {
                    keywordsList.Add(obj);
                }
            }

            NSError error    = null;
            NSData  jsonData = NSJsonSerialization.Serialize(universalObject.ContentMetadata.Dictionary(), 0, out error);

            string jsonStr = jsonData.ToString();
            Dictionary <string, object> metadataDict = JsonConvert.DeserializeObject <Dictionary <string, object> >(jsonStr);

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

            dict.Add("$canonical_identifier", universalObject.CanonicalIdentifier != null ? universalObject.CanonicalIdentifier : "");
            dict.Add("$canonical_url", universalObject.CanonicalUrl != null ? universalObject.CanonicalUrl : "");
            dict.Add("$og_title", universalObject.Title != null ? universalObject.Title : "");
            dict.Add("$og_description", universalObject.ContentDescription != null ? universalObject.ContentDescription : "");
            dict.Add("$og_image_url", universalObject.ImageUrl != null ? universalObject.ImageUrl : "");
            dict.Add("$publicly_indexable", universalObject.PubliclyIndex ? "0" : "1");
            dict.Add("$locally_indexable", universalObject.LocallyIndex ? "0" : "1");
            dict.Add("$exp_date", universalObject.ExpirationDate != null ? (universalObject.ExpirationDate.SecondsSinceReferenceDate * 1000).ToString() : "");

            if (keywordsList != null)
            {
                dict.Add("$keywords", keywordsList);
            }

            if (metadataDict != null)
            {
                dict.Add("metadata", metadataDict);
            }

            return(dict);
        }
Пример #21
0
        nuint AddChildEvent <T>(DatabaseReference nodeRef, DataEventType type, Action <string, T> eventAction)
        {
            nuint handleReference = nodeRef.ObserveEvent(type, (snapshot) =>
            {
                if (snapshot.HasChildren && eventAction != null)
                {
                    NSDictionary itemDict = snapshot.GetValue <NSDictionary>();
                    NSError error         = null;
                    string itemDictString = NSJsonSerialization.Serialize(itemDict, NSJsonWritingOptions.PrettyPrinted, out error).ToString();

                    T item = JsonConvert.DeserializeObject <T>(itemDictString);
                    eventAction(snapshot.Key, item);
                }
            });

            return(handleReference);
        }
Пример #22
0
        public void POST(string urlString, NSDictionary param)
        {
            NSError err;
            // 格式化字典
            NSData dataParam = NSJsonSerialization.Serialize(param, NSJsonWritingOptions.PrettyPrinted, out err);

            NSString urlstring = new NSString(urlString);
            // 请求配置
            NSMutableUrlRequest request = new NSMutableUrlRequest(new NSUrl(urlstring))
            {
                HttpMethod      = "POST",
                Body            = dataParam,
                TimeoutInterval = 15.0
            };

            PubliceRequestMethod(request);
        }
Пример #23
0
        void RegisterWithCollider(string roomId, string clientId)
        {
            if (_state == ARDWebSocketChannelState.kARDWebSocketChannelStateRegistered)
            {
                return;
            }
            NSDictionary registerMessage = new NSDictionary("cmd", "register", "roomid", roomId, "clientid", clientId);
            NSError      error           = null;
            NSData       message         = NSJsonSerialization.Serialize(registerMessage, NSJsonWritingOptions.PrettyPrinted, out error);
            NSString     messageString   = new NSString(message, NSStringEncoding.UTF8);

            System.Diagnostics.Debug.WriteLine($"Registering on WSS for rid:{roomId} cid:{clientId}");
            //// Registration can fail if server rejects it. For example, if the room is
            //// full.
            _socket.Send(messageString);
            SetState(ARDWebSocketChannelState.kARDWebSocketChannelStateRegistered);
        }
Пример #24
0
        public virtual async Task <System.Collections.Generic.IEnumerable <T> > GetItemsAsync(bool forceRefresh = false)
        {
            try
            {
                if (!initialized)
                {
                    await InitializeStore();
                }

                TaskCompletionSource <IEnumerable <T> > getData = new TaskCompletionSource <IEnumerable <T> >();
                var query = entityNode.GetQueryOrderedByPriority();
                query.ObserveSingleEvent(
                    DataEventType.Value, (DataSnapshot snapshot) =>
                {
                    var values = snapshot.GetValue() as NSDictionary;

                    if (values != null)
                    {
                        List <T> items = new List <T>();

                        var data = NSJsonSerialization.Serialize(values, NSJsonWritingOptions.PrettyPrinted, out NSError toJsonError);

                        var json          = JToken.Parse(data.ToString());
                        var parsedResults = this.ParseJsonResults(json);

                        if (parsedResults != null)
                        {
                            items.AddRange(parsedResults);
                        }

                        getData.SetResult(items);
                    }
                    else
                    {
                        getData.SetResult(new List <T>());
                    }
                });

                return(await getData.Task);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #25
0
        static string NSObjectToJSON(NSObject obj)
        {
            NSError err;
            NSData  jsonData = NSJsonSerialization.Serialize(obj, 0, out err);

            if (err != null)
            {
                return(string.Empty);
            }

            NSString myString = NSString.FromData(jsonData, NSStringEncoding.UTF8);

            jsonData.Dispose();

            var json = myString.ToString();

            myString.Dispose();
            return(json);
        }
Пример #26
0
        private void ReceivedRemoteNotification(NSDictionary dict)
        {
            NSError error;
            var     jsonData = NSJsonSerialization.Serialize(dict,
                                                             NSJsonWritingOptions.PrettyPrinted, out error);

            if (error != null)
            {
                return;
            }

            var json = jsonData.ToString();

            Mvx.Resolve <IMvxMessenger>().Publish(new NotificationReceivedMessage(this)
            {
                Body  = json,
                Local = false
            });
        }
        // Provided by by Erlend :)
        public static string GetJsonFromDictionary(this NSDictionary dict)
        {
            if (dict == null)
            {
                return(null);
            }

            NSError err;
            var     jsonData = NSJsonSerialization.Serialize(dict, NSJsonWritingOptions.PrettyPrinted,
                                                             out err);

            if (err != null)
            {
                return(null);
            }
            var strData          = jsonData.ToString();
            var notificationJson = "{" + strData.TrimStart('{').TrimEnd('}') + "}";

            return(notificationJson);
        }
Пример #28
0
 public void PayPalProfileSharingViewController(PayPalProfileSharingViewController profileSharingViewController, NSDictionary profileSharingAuthorization)
 {
     Debug.WriteLine("PayPal Profile Sharing Authorization Success!");
     profileSharingViewController.DismissViewController(true, () =>
     {
         NSError err     = null;
         NSData jsonData = NSJsonSerialization.Serialize(profileSharingAuthorization, NSJsonWritingOptions.PrettyPrinted, out err);
         NSString first  = new NSString("");
         if (err == null)
         {
             first = new NSString(jsonData, NSStringEncoding.UTF8);
         }
         else
         {
             Debug.WriteLine(err.LocalizedDescription);
         }
         OnSuccess?.Invoke(first.ToString());
         OnSuccess = null;
     });
 }
Пример #29
0
            public override void AdjustSessionTrackingSucceeded(ADJSessionSuccess sessionSuccessResponseData)
            {
                if (!_delegateOptions.SetSessionTrackingSuccessDelegate)
                {
                    return;
                }

                Console.WriteLine(TAG + ": SesssionTrackingSucceeded, sessionSuccessResponseData = " + sessionSuccessResponseData);
                AddInfoToSendSafe("message", sessionSuccessResponseData.Message);
                AddInfoToSendSafe("timestamp", sessionSuccessResponseData.TimeStamp);
                AddInfoToSendSafe("adid", sessionSuccessResponseData.Adid);
                if (sessionSuccessResponseData.JsonResponse != null)
                {
                    NSError  error              = new NSError();
                    NSData   dataJsonResponse   = NSJsonSerialization.Serialize(sessionSuccessResponseData.JsonResponse, 0, out error);
                    NSString stringJsonResponse = new NSString(dataJsonResponse, NSStringEncoding.UTF8);
                    AddInfoToSendSafe("jsonResponse", stringJsonResponse.ToString());
                }
                _testLibrary.SendInfoToServer(_currentBasePath);
            }
Пример #30
0
        public override void DidReceiveNotificationResponse(UNUserNotificationCenter center, UNNotificationResponse response, Action completionHandler)
        {
            try {
                NSDictionary aps      = response.Notification.Request.Content.UserInfo.ObjectForKey(new NSString("aps")) as NSDictionary;
                NSData       jsonData = NSJsonSerialization.Serialize(aps, 0, out NSError error);
                string       jsonNotificationMessage = jsonData.ToString();

                bool forMe = default(bool);

                INotificationMessage notificationMessage = Newtonsoft.Json.JsonConvert.DeserializeObject <NotificationMessage>(jsonNotificationMessage);
                forMe = BaseSingleton <GlobalSetting> .Instance.UserProfile?.NetId == notificationMessage.UserNetId;
                if (forMe)
                {
                    MessagingCenter.Send <object, INotificationMessage>(this, Drive.Client.Services.Notifications.NotificationService.RESIDENT_VEHICLE_DETAIL_RECEIVED_NOTIFICATION, notificationMessage);
                }
            } catch (Exception exc) {
                string message = exc.Message;
                Debugger.Break();
            }
        }