Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push to specific view controller from push notification #774

Open
yonathansteam opened this issue Mar 6, 2018 · 3 comments
Open

Push to specific view controller from push notification #774

yonathansteam opened this issue Mar 6, 2018 · 3 comments

Comments

@yonathansteam
Copy link

yonathansteam commented Mar 6, 2018

How to push specific view controller from push notification in SWRevealViewController ?
For now i can only set to homeVC how to push to anotherVC ?

//Handle payload data from push notification

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let sw = storyboard.instantiateViewController(withIdentifier: "revealControllerStoryboard") as! SWRevealViewController
self.window?.rootViewController = sw
}

@Saravana181187
Copy link

Saravana181187 commented Mar 21, 2018

Can you try this.. It will helps you.

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let sw = storyboard.instantiateViewController(withIdentifier: "RevealViewController") as! SWRevealViewController
self.window?.rootViewController = sw

        let destinationController = storyboard.instantiateViewController(withIdentifier: "NotificationViewController") as! NotificationViewController
        let navigationController = UINavigationController(rootViewController: destinationController)
        sw.pushFrontViewController(navigationController, animated: true)

@yonathansteam
Copy link
Author

i already tried that not working still go to home if i push to specific VC

@ManishaQw
Copy link

Can you try this.. It will helps you.

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let sw = storyboard.instantiateViewController(withIdentifier: "RevealViewController") as! SWRevealViewController
self.window?.rootViewController = sw

        let destinationController = storyboard.instantiateViewController(withIdentifier: "NotificationViewController") as! NotificationViewController
        let navigationController = UINavigationController(rootViewController: destinationController)
        sw.pushFrontViewController(navigationController, animated: true)

Thank's this worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants