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?

Thanks

Ben

Tagged:

Answers

  • 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.