OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
104 stars 50 forks source link

GcmBroadcastReceiver not found with version 3.10.1 #217

Closed denzerd closed 3 years ago

denzerd commented 3 years ago

Description: We updated our projects packages today to the newest ones. We also updated OneSignal Xamarin SDK to the newest version 3.10.1. Before we used 3.9.0. We are implementing our own NotificationReceiver by extending from OneSignals GcmBroadcastReceiver. This is due to intercept some notifications that we want to deal with separately.

[BroadcastReceiver(Enabled = true)]
[IntentFilter(new[] {"com.google.android.c2dm.intent.RECEIVE"})]
public class F62NotificationReceiver : Com.OneSignal.Android.GcmBroadcastReceiver

This worked perfectly fine all the time. Now since updating to 3.10.1 we get the error:

The type or namespace name 'GcmBroadcastReceiver' does not exist in the namespace 'Com.OneSignal.Android' (are you missing an assembly reference?) We looked into the code of this git as well as the one of the Android Native SDK but it seems the GcmBroadcastReceiver should still be there.

So the question is, where did the GcmBroadcastReceiver go?

P.S. it is still working fine with version 3.10.0.

Environment Xamarin SDK version 4.8 OneSignal SDK version 3.10.1 Visual Studio as well as Visual Studio Community for Mac on current version.

Steps to Reproduce Issue:

  1. Create a new class
  2. try extending from Com.OneSignal.Android.GcmBroadcastReceiver --> Error
  3. Roll back to 3.10.0 --> No Error
jkasten2 commented 3 years ago

@denzerd Instead of handling a raw FCM payload from your own BroadcastReciever we recommend using OneSignal's NotificationExtenderService instead to process any notification payloads sent by OneSignal. https://documentation.onesignal.com/docs/service-extensions#android-notification-extender-service

I believe the NotificationExtenderService should provide everything you need however if it does not let us know.

jkasten2 commented 3 years ago

Closing due to inactivity. Please let us know if the above does not solve this issue.