Reputation: 93
We are integrating two new notifications SDK within the same app. Firebase and Salesforce Marketing Cloud (formerly ExactTarget).
Our IOS versions is working perfectly and no interference has been detected. We send notifications from both tools.
However, we are having problems with our Android versions. The behavior of some of our test-devices is:
InvalidRegistration,2016-11-22 04:00:00,TokenRejection,|ID|8|:(ServiceStatus,ServiceResponse,TrackingDate,FailureType,SystemToken)
Our guess (we’ve done a lot of tests) is that changes in tokens within GCM are producing that problems. We’ve tried to push into Salesforce a new token every time is renew (we get it from Firebase) using their method Registration.getInstance().setSystemTokenInCache(token)
, with no success up to now.
Upvotes: 1
Views: 1017
Reputation: 403
We solved the issue is a different way. We forced the notifications to be received in our Firebase service (by implementing intent rules in manifest). Then in onMessageReceived()
method, we check if the notification from the ExactTarget with PushMessageManager.isMarketingCloudPush(Bundle)
. If this is true, we let Marketing cloud handle it via
MarketingCloudSdk.requestSdk(new
MarketingCloudSdk.WhenReadyListener() {
@Override
public void ready(MarketingCloudSdk marketingCloudSdk) {
marketingCloudSdk.getPushMessageManager().handlePushMessage(bundle);
}
});
else we handle it as Firebase push notification for our app.
Upvotes: 0
Reputation: 93
We did not solve it. We were in touch with Salesforce itself and were given some tips but none of them seemed to work:
Here's what we were told. Rather than creating two projects in Firebase and adjusting the google-services.json file, I just used the sender ID from one project. In your code, you keep the Marketing Cloud initialisation the same and the google-services.json file the same, you only need to change the call FirebaseInstanceId.getInstance().getToken(); to FirebaseInstanceId.getInstance().getToken("158036016337", "FCM"); where the first parameter is your sender ID (which is the same sender ID you use in your Marketing Cloud initialisation), and "FCM" is the scope.
What this did was, it returned two different tokens, one from Firebase and one from Marketing Cloud. Both tokens however had an 11 character prefix followed by a colon which was identical. I sent to pushes using both tokens and both worked well. I then subscribed for topics in Firebase FirebaseMessaging.getInstance().subscribeToTopic("xxxxx"); And sent a push using the Firebase API to that topic and that worked as well. Sent some pushes from Marketing Cloud and that worked as well. I agree that you should test this however.
Upvotes: 0