Hi, I’m searching for a method to open a view after tapping on a notification received when the app is not active. Specifically, I want the view to be presented in a way that if the user can go to the parent view controller smoothly.
I was thinking if it is possible to send the view controller ID along with the notification so the app can present it, but got confused with how to walk through the “chain” of view controllers from the root. Especially when there is a table view controller in the “chain”, I don’t know if I should load the data or not.
Many thanks.
Hello - basically, given push notification payloads are in JSON form, you can pass in some data telling the app what view to open. Simply handle that in > applicationDidLaunchWithOptions
I found a more in depth explanation here
Does your push notifications book tutorial cover this?
@gargoyle Can you please help with this when you get a chance? Thank you - much appreciated! :]
I discuss opening a specific view controller based on a notification, yes. However, you’re asking to essentially open the entire “tree” if I’m understanding properly, and that is more based on your app architecture than a push notification.
So, you can identify “where” the app should open, but the route most apps take is that it just displays that view controller directly, and you’re not really in a navigation stack to it. If you can easily implement that logic in your app, awesome.
So, yes, I show an example of opening a specific view controller based on the details of a push notification, but no, I don’t show pushing an entire hierarchy of view controllers as that’s really unrelated to push notifications.