Hello,
I have implemented in my app the possibility to receive push notifications via the FCM service. I have managed to do all required configurations and I can receive the notifications on all the devices that have the app installed on them.
In the messages sent, I am using a special key that should indicate the app what window should it open, to help the user access the functionality that the notification is referring to. Until now, I have implemented in the AppDelegate.m file, using the method didReceiveNotificationResponse, a line where I am posting the received notification inside the app, with the following line of code:
[[NSNotificationCenter defaultCenter] postNotificationName:@"Notification" object: nil userInfo:userInfo];
After doing so, I went to the main view controller, that is accessed every time the app opens, and implemented an observer that should get the posted notification from above:
[[NSNotificationCenter defaultCenter] addObserver: self selector:@selector(receiveNotification:) name:@"Notification" object:nil];
The receiveNotification method contains code that should performSegueWithIdentifier, based on the value of the key inside the notification object.
My question is, am I doing it right? If not, how can I handle this issue?
Thank you in advance!