I am getting notification appdelegate didReceiveRemoteNotification
but i want to use this payload data in view controller how to do that?
There are a number of ways to achieve this, and the question is a little vague. Assuming that you have a view controller in your application this is active when your notification arrives, perhaps the simplest way would be to use an NSNotification to broadcast the payload from the app delegate to your interested view controller.
In your view controller:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receivedRemoteNotification:)
name:@"RemoteNotification"
object:nil];
And implement the method -receviedRemoteNotfication
.
Then, in your app delegate's remote notification method:
[[NSNotificationCenter defaultCenter]
postNotificationName:@"RemoteNotification"
object:payload];