-2

I'm getting http response in the form of a json object in my iOS app. The json object looks like

{
    coupons =     {
        1 = "You have 20% off
    };
    latitude = "3.043";
    "location_address" = "Pico";
    "location_name" = Starbucks;
    longitude = "-18.421964";
}

Now I want to send this as notification on my app. How do I do it? Any ideas? Thanks

  • You want to send it from serverside ? –  Dec 05 '18 at 05:02
  • Yes! I'm getting this response from server side. But I want to show it on the app instead of printing in console of my xcode project – user10747532 Dec 05 '18 at 05:09
  • Please make it clear what task you trying to achieve, please provide more details. –  Dec 05 '18 at 05:12
  • I'm sending out my location from the app and receiving back this json object from my server if it's near a coffee shop. I want to show the result as a notification on the app. – user10747532 Dec 05 '18 at 05:15
  • you have to show local notification or you can also show alert –  Dec 05 '18 at 05:21
  • if your app is in foreground, show an alert, else use a local notification. see [this link](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/SchedulingandHandlingLocalNotifications.html) and [this answer](https://stackoverflow.com/a/22660122/7698092) – Awais Fayyaz Dec 05 '18 at 06:41
  • But my issue is how do I parse the json object I'm getting in the notification? – user10747532 Dec 05 '18 at 06:50

1 Answers1

0

by using userNotificatinCenterDelegate you can achieve it

lokesh
  • 64
  • 4