I am currently making a Xamarin Binding (only Android for now) for MarketingCloudSDK 7.3.0 which is basically a wrapper in C#. So in java, I use the MarketingCloudSDK with the functions I need and I generate a lib (aar) that I use in my binding (C#). My problem is that everything related to push notifications does not work in the binding, but it works in my native test app (kotlin). For instance, I can find the device id in the MobilePush contact list when I use my native test app, but not with the binding. In both cases, I initialized MarketingCloud in the app's onCreate method.
When I added some logs, using MarketingCloudSdk.getInstance().getSdkState(), I did notice an important difference between both cases.
Native
"PushMessageManager": {
"pushEnabled": true,
"debugInfo": {
"senderId": "myid......",
"deviceToken": null,
"firebaseApps": [],
"c2dmReceiver": [
{
"name": "com.google.firebase.iid.FirebaseInstanceIdReceiver",
"priority": 0
}
],
"instanceIdService": [],
"messagingService": [
{
"name": "com.salesforce.marketingcloud.messages.push.MCFirebaseMessagingService",
"priority": -1
},
{
"name": "com.google.firebase.messaging.FirebaseMessagingService",
"priority": -500
}
]
}
}
Binding
"PushMessageManager": {
"pushEnabled": true,
"debugInfo": {
"senderId": "myid......(same one)",
"deviceToken": null,
"firebaseApps": [],
"c2dmReceiver": [
{
"name": "com.google.firebase.iid.FirebaseInstanceIdReceiver",
"priority": 0
}
],
"instanceIdService": [],
"messagingService": [
{
"name": "com.google.firebase.messaging.FirebaseMessagingService",
"priority": -500
}
]
}
}
Everything else is pretty much the same. Does anyone know what may have caused com.salesforce.marketingcloud.messages.push.MCFirebaseMessagingService to be absent from messagingService and how it could be added? Thank you.
namespace Com.Salesforce.Marketingcloud.Messages.Push { [Service(Exported = false)] [IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" }, Priority = -1)] public partial class MCFirebaseMessagingService { } }