1

I am working on app that receiving notification from server its working fine.
When my app is on background mode and server send notification iPhone shows notification alert.

Problem

if i click to that notification alert my app comes to foreground mode
method didReceiveRemoteNotification called
then i easily get notification data and perform some action according to notification data.
But if i click to app, not notification alert then app comes in foreground mode but
methoddidReceiveRemoteNotification not called.

What i want?

Is there any method that check when app in background mode,is there any notification receive or not,if receive then get his data,when app comes in foreground mode?

Community
  • 1
  • 1
vky
  • 475
  • 1
  • 6
  • 14

1 Answers1

1

There is no way to accomplish what you want unless you click the notification and read it's data in didFinishLaunchingWithOptions

you can use pull mechanism to store notifications in server and read them when app opens from API request facebook does this

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87