Forum Xamarin.Forms

Open Page in PCL when Local notification is clicked

JassimRahmaJassimRahma USMember ✭✭✭✭
edited May 2018 in Xamarin.Forms


I am using below code in my Droid project within my PCL solution:

global::Android.Net.Uri uri = global::Android.Net.Uri.Parse("android.resource://" + this.PackageName + "/Raw/" + Resource.Raw.AthanAffasi);

Notification.Builder builder = new Notification.Builder(this)
    .SetContentTitle("حان الآن موعد أذان الفجر") 
    .SetVibrate(new long[] { 1000, 1000 })
    .SetContentText("نسألكم الدعاء");

NotificationManager notificationManager = (NotificationManager)GetSystemService(Context.NotificationService);
notificationManager.Notify(60000, builder.Build());

I want to know how can i open a page named MyPage in my PCL project when the notification is clicked?



  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Raise an event or MessageCenter event from the platform project.
    Then let the PCL handle the logic from there. The platform project shouldn't be trying to control navigation. But rather just say "I'm done with blah blah", and let the logic of the app take over from there.

Sign In or Register to comment.