Opening a shared page from an Android notification (via Activity)

JanGoessensJanGoessens NLMember

I've made an app that uses DependencyService to send a local notification on Android from a shared project.
I want the app to show a specific shared page when the notification is pressed, but I'v only been able to show an Android specific Activity.

How do I make it so when you press the notification it shows a shared page, of how can I show the shared page from an Android Activity?

Answers

  • adamkempadamkemp USInsider, Developer Group Leader mod

    MessagingService is a good way to post a global in-process notification that some other code can handle. You could handle the message in your App class in the PCL.

  • batmacibatmaci DEMember ✭✭✭✭✭

    @adamkemp said:
    MessagingService is a good way to post a global in-process notification that some other code can handle. You could handle the message in your App class in the PCL.

    Hi @adamkemp ,

    Do you mean that send a message from mainactivity.cs and subscribe it in app.cs of XF project?

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Yes, and I meant to say "MessagingCenter" so I'm glad you figured that out.

  • KathirVelKathirVel USMember ✭✭

    @adamkemp But how you identify that , Mainactivity is loaded by tapping on Notification or from application icon Navigation?

  • adamkempadamkemp USInsider, Developer Group Leader mod

    @KathirVel, that's an Android API question. If you figure out how to do it in Android in general then you can use MessagingCenter to transfer the work to your PCL. But you have to start with "how do I handle notification actions in Android". I don't know how that works, but there is an Android forum here for asking such questions.

Sign In or Register to comment.