2

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.

3
  • That service, and others, are declared in the manifest. Does your merged manifest contain them?
    – Bill Mote
    Commented Nov 11, 2020 at 13:23
  • @BillMote Yes, that's it! I was missing some important parts in my manifest. Thank you! I can now add them in my binding with Additions: namespace Com.Salesforce.Marketingcloud.Messages.Push { [Service(Exported = false)] [IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" }, Priority = -1)] public partial class MCFirebaseMessagingService { } }
    – omstring
    Commented Nov 11, 2020 at 17:40
  • 1
    Care to publish your whole binding file here for everyone or linking to your repo for the binding file? :)
    – Bill Mote
    Commented Nov 11, 2020 at 20:46

1 Answer 1

0

Make sure your merged manifest has all the receivers & services that would be declared by the SDK in a native implementation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .