Reputation: 307
I am trying to setup push notifications on a Xamarin.Forms Android app following this tutorial and this sample. My AndroidManifest.xml, FirebaseService.cs and MainActivity.cs are basically the same as the sample. When I fire up the Android Emulator and do a Test Send from Azure Notification Hubs I get: "Message was successfully sent, but there were no matching targets." Is that tutorial outdated?
Upvotes: 1
Views: 1482
Reputation: 307
I used a real device to debug the application and I got an error message: "Java.Lang.RuntimeException: 'Unable to instantiate receiver com.google.firebase.iid.FirebaseInstanceIdReceiver: java.lang.InstantiationException: java.lang.Class<com.google.firebase.iid.FirebaseInstanceIdReceiver> cannot be instantiated'"
This was due to my code shrinker (ProGuard/R8) missing some configurations. Following this article I created a proguard.cfg file and added this:
-dontwarn com.google.android.gms.**
-keep class com.google.android.gms.** { *; }
-keep class com.google.firebase.** { *; }
I tried a Test Send from Azure Notification Hubs and it worked!
Upvotes: 6