2

I want to share a problem that I have been looking for a solution for a long time.I have checked all the steps in this document Integrate the SDK 10 times. There is no page on the internet that I haven't looked at. The push comes in successfully. It redirects to the page I want. But the open count does not increase on the marketing cloud page.

Millions of our users are now receiving successful push notifications.But even though they open the notifications, the open count does not increase.

I see this log.

Notification open Event Logged for id : (OTg1OjExNDow)

The user push token in the marketing cloud is the same as I see in the logs. There are no error messages in the logs.

Sdk version : 8.0.7

My Application Code

if (BuildConfig.DEBUG) {
        SFMCSdk.Companion.setLogging(com.salesforce.marketingcloud.sfmcsdk.components.logging.LogLevel.DEBUG, new LogListener.AndroidLogger());
        MarketingCloudSdk.setLogLevel(MCLogListener.VERBOSE);
        MarketingCloudSdk.setLogListener(new MCLogListener.AndroidLogListener());

        SFMCSdk.requestSdk(sfmcSdk -> {
            if (sfmcSdk.getSdkState() != null) {
                try {
                    JSONObject jsonObject = new JSONObject(sfmcSdk.getSdkState().getString("PUSH"));
                    Log.i("~#SdkState", "Sdk Version: " + sfmcSdk.getSdkState().get("sfmcSDKVersion"));
                    Log.i("~#SdkState", "initConfig: " + jsonObject.get("initConfig"));
                    Log.i("~#SdkState", "initStatus: " + jsonObject.get("initStatus"));
                    Log.i("~#SdkState", "PushMessageManager: " + jsonObject.get("PushMessageManager"));
                    Log.i("~#SdkState", "InAppMessageManager: " + jsonObject.get("InAppMessageManager"));
                    Log.i("~#SdkState", "InApp Events: " + jsonObject.get("Event"));
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
        });
    }

    SFMCSdk.configure(getApplicationContext(), SFMCSdkModuleConfig.build(builder -> {
        builder.setPushModuleConfig(MarketingCloudConfig.builder()
            //TODO PROVIDE YOUR APPLICATION'S VALUES
            .setApplicationId(BuildConfig.MARKETING_CLOUD_APPLICATION_ID)
            .setAccessToken(BuildConfig.MARKETING_CLOUD_ACCESS_TOKEN)
            .setSenderId(getString(R.string.rbm_marketing_automation_tool_sender_id))
            .setMarketingCloudServerUrl(getString(R.string.rbm_marketing_automation_tool_cloud_url))
            .setMid(getString(R.string.rbm_marketing_automation_tool_mid))
            //TODO ENABLE MARKETING CLOUD FEATURES
            .setDelayRegistrationUntilContactKeyIsSet(true)
            .setNotificationCustomizationOptions(
                    NotificationCustomizationOptions.create((context, notificationMessage) -> {
                        Intent openActivityIntent = createIntentAndPutDatas(context, notificationMessage);
                        return com.salesforce.marketingcloud.notifications.NotificationManager.getDefaultNotificationBuilder(
                                context,
                                notificationMessage,
                                com.salesforce.marketingcloud.notifications.NotificationManager.createDefaultNotificationChannel(context),
                                R.drawable.app_launcher_icon
                        )
                        .setContentIntent(
                            com.salesforce.marketingcloud.notifications.NotificationManager.redirectIntentForAnalytics(
                                    context,
                               PendingIntent.getActivity(
                                    context,
                                    Random.Default.nextInt(),
                                    openActivityIntent,
                                       PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE
                                 ),
                                 notificationMessage,
                                 true
                            )
                        )
                        .setPriority(NotificationCompat.PRIORITY_DEFAULT)
                        .setCategory(NotificationCompat.CATEGORY_STATUS)
                        .setSmallIcon(R.drawable.app_launcher_icon)
                        .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), AudioManager.STREAM_NOTIFICATION);
                    })
            )
            .setMarkMessageReadOnInboxNotificationOpen(true)
            .setAnalyticsEnabled(ANALYTICS_ENABLED)
            .setPiAnalyticsEnabled(PI_ENABLED)
            .setUseLegacyPiIdentifier(false)
            .setInboxEnabled(true)
            .build(getApplicationContext()));
        return Unit.INSTANCE;
    }), initStatus -> Unit.INSTANCE);

    SFMCSdk.requestSdk( sdk -> {
        sdk.mp( it -> {
            it.getPushMessageManager().enablePush();
            it.getInAppMessageManager().setInAppMessageListener(new InAppMessageManager.EventListener() {
                @Override
                public boolean shouldShowMessage(@NonNull InAppMessage inAppMessage) {
                    return true;
                }

                @Override
                public void didShowMessage(@NonNull InAppMessage inAppMessage) {

                }

                @Override
                public void didCloseMessage(@NonNull InAppMessage inAppMessage) {

                }
            });
        });
    });

My Push Message Received Code

   if (PushMessageManager.isMarketingCloudPush(remoteMessage)) {
            SFMCSdk.requestSdk( sdk -> {
                    sdk.mp( it -> {
                it.getPushMessageManager().handleMessage(remoteMessage);
               });
      });
    }
0

0

You must log in to answer this question.

Browse other questions tagged .