Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

MessagingCenter not working

geedsengeedsen USMember ✭✭
edited March 2018 in Xamarin.Forms

I had this Android App working. Then I started working on another branch, and today I continued on the Android App.
But it is no longer working. Reason is the MessagingCenter no longer works.
I have this at one location:

        MessagingCenter.Subscribe<App, FCM.NETStandard.Models.Message>(App.Current, "Hi", async (sender, arg) =>
            await MessageReceived(arg);

And at another location I have

        MessagingCenter.Send<object, FCM.NETStandard.Models.Message>(this, "Hi", msg);

And I can see that the subscription is made, but when the send happens, the subscribed delegate is not executed (any longer).
Tried it with other messages and it just does not do anything. What could be the reason?





  • albertoha94albertoha94 Member ✭✭✭

    I believe you should also be sending the App when calling the Send function.
    MessagingCenter.Send<App, FCM.NETStandard.Models.Message>(App.Current, "Hi", msg);

Sign In or Register to comment.