I have a messaging app, which gets data from server through push notification.
In the following image, you can see the process and also check where it gets faulted:[![enter image description here](https://i.stack.imgur.com/plchp.png)](https://i.stack.imgur.com/plchp.png)

I have researched a lot about this problem but not getting a universal solution.

One solution I get is to use silent notification , [discussed Here](https://stackoverflow.com/questions/36694963/what-is-silent-push-notification-when-does-the-device-receive-it) , to get data before it is shown and save it. But I didn't find how to show notification from app delegate once I received silent notification.

Kindly correct me if I am conceptually wrong somewhere.

Update:
One of problem is that the *application:didReceiveRemoteNotification:fetchCompletionHandler:* is only called when 

1. app is in foreground
2. user clicks the notification

But when user **doesn't** click the notification, *application:didReceiveRemoteNotification:fetchCompletionHandler:* is not called, and I can't find a way to save the data, that is present in notification.