Conductor: How to determine the current active controller from inside a service

Created on 2 Nov 2017  Â·  2Comments  Â·  Source: bluelinelabs/Conductor

I am recieving push notification from Firebase cloud messaging(FCM) and i want to treat the notification differently depending on which controller is active. but i cannot figure out the best way to achieve thtat. any help

All 2 comments

Dont do that. Whatever you want to do, getting info about UI (like
ViewController) is the entirely wrong way to go.
Btw. You can't do that either with fragments or activties.

Osmandiyaka notifications@github.com schrieb am Do., 2. Nov. 2017, 12:42:

I am recieving push notification from Firebase cloud messaging(FCM) and i
want to treat the notification differently depending on which controller is
active. but i cannot figure out the best way to achieve thtat. any help

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/bluelinelabs/Conductor/issues/379, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAjnrnksoMBprjRVvAngZn-b2v0-gjwrks5syaqegaJpZM4QPjfZ
.

This is how i am currently doing it. i attach a routerChangerListener to my router and track the current controller. i can then return it in a static method

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomblenz picture tomblenz  Â·  4Comments

EricKuck picture EricKuck  Â·  5Comments

DJafari picture DJafari  Â·  4Comments

vincent-paing picture vincent-paing  Â·  6Comments

ghost picture ghost  Â·  5Comments