rdelrosario / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
179 stars 161 forks source link

Not hitting OnMessage even when I register #108

Closed avinash-ramireddy closed 6 years ago

avinash-ramireddy commented 7 years ago

it is not hitting void IPushNotificationListener.OnMessage(JObject parameters, DeviceType deviceType) . It is hitting void IPushNotificationListener.OnRegistered(string Token, DeviceType deviceType)

In myactivity.cs, adding

CrossPushNotification.Initialize<CrossPushNotificationListener>(Constants.SenderID);
CrossPushNotification.Current.Register();

global::Xamarin.Forms.Forms.Init(this, bundle);
 LoadApplication(new App());

but it is just not hitting.

In docs it says "Must compile against 21 as plugin is using API 21 specific things." I have API level 23(Xamarin forms android accelerate_x86,platform-6), Does it have to do anything with this?

Please help. Trying from past one week to get it work.

rdelrosario commented 7 years ago

Did you get to solve your issue?

avinash-ramireddy commented 7 years ago

I didn't check this after the issue. As alternative,I followed below link https://developer.xamarin.com/guides/android/application_fundamentals/notifications/firebase-cloud-messaging for push notifications.

prashant-v commented 6 years ago

I am facing same issue there. https://developer.xamarin.com/guides/android/application_fundamentals/notifications/firebase-cloud-messaging is not active now.

Any help is appreciated!

gtaspider commented 6 years ago

i have the same issue! I receive [0:] Push Notification - Device Registered - Token : ******* when I Debug on Emulator, but when I to create a new message in Firebase (With target App, or directly by device token) it tells me the messages successfully send, but I do not receive anything on my App and the OnMessage Method will not be called.

I also tried to run it in Release mode, but then the Emulator always gives the following error: INSTALL_FAILED_NO_MATCHING_ABIS . Afterwards I tried to install the Release-signed-apk on my Android Phone. This works like a charm, but also no Notifications :(

Thankful for any suggestions

avinash-ramireddy commented 6 years ago

I am currently using FCM.