2

I've implemented Marketing Cloud Mobile Push, we have multiple SDKs however I'm letting Marketing cloud handle tokens, all I'm doing is using a custom GCMListenerService to process my push if its from Marketing Cloud. The app receives the push notifications however its not displayed.

marketingCloudSdk.getNotificationManager().areNotificationsEnabled() 

is true

marketingCloudSdk.getPushMessageManager().isPushEnabled() is also true

and this returns true as well

boolean isHandled = marketingCloudSdk.getPushMessageManager().handlePushMessage(bundle);

and so is the above.

This is my on messageReceived in the service

@Override
public void onMessageReceived(String s, final Bundle extras) {
    track.sendNoInteraction(AnalyticsView.notificationReceived, TrackingAction.AnalyticsAction.alertNotificationReceived, TrackingPreferences.DEFAULT_EVENT_LABEL);
    SalesForceNotificationHandler notificationHandler = new DefaultSalesForceNotificationHandler(getApplicationContext(), extras);
    if (notificationHandler.canHandle()) {
        notificationHandler.handle();
        return;
    }
    handleAppPushNotification(extras);
}

Does anyone have any suggestions on what could be going wrong?

Thanks

  • 1
    It looks like you've wrapped the interactions with the SDK to handle the push inside on this DefaultSalesForceNotification class. What is the code you have in that class? Are you providing an implementation of the NotificationBuilder override when initializing the SDK? Do you see other notifications getting displayed? – Seth Feb 20 '18 at 12:03
  • Hey Seth, I identified the issue, it was only on Oreo and above, if I didn't specify a NotificationChannel the notification would fail on Oreo devices, by specifying a channel its now working fine. Thanks. – akshaydashrath Feb 21 '18 at 13:04
  • What version of the Marketing Cloud SDK are you using? There is suppose to be a check in the SDK, after v5.2.0, that makes sure that the notification channel is setup correctly when your project is targeting Android API >=26. Did you provide a channel name during init or did you opt to use the notification channel override interface? – Seth Feb 21 '18 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.