If you are not seeing "Push Opens" or Click-Through Rate (CTR) statistics for your Android application, the most common cause is a custom NotificationServiceExtension whose onMessageReceived method returns true.
NotificationServiceExtension is the Pushwoosh Android SDK hook that lets you inspect and process an incoming push before it is displayed. The boolean value you return from onMessageReceived is critical for statistics tracking:
-
return true;: tells the SDK that you have fully handled the message yourself. The notification is not displayed by the SDK, so there is nothing for the user to tap and no open event is reported. This suppresses open/CTR statistics. -
return false;: tells the SDK to continue its default processing — display the notification and track its open event.
How to Fix the Issue
- Find the class in your Android project that extends
com.pushwoosh.notification.NotificationServiceExtension(it is the class named in thecom.pushwoosh.notification_service_extensionmeta-data of yourAndroidManifest.xml). - Locate the
onMessageReceived(PushMessage message)method. - Make sure it returns
falsefor any notification you want Pushwoosh to display and track.
Example:
import com.pushwoosh.notification.NotificationServiceExtension;
import com.pushwoosh.notification.PushMessage;
public class MyNotificationServiceExtension extends NotificationServiceExtension {
@Override
protected boolean onMessageReceived(PushMessage message) {
// Your custom logic to inspect the push payload can go here.
// Note: this callback runs on a background worker thread.
// To ensure Pushwoosh displays the notification and tracks opens,
// you must return false. Returning true suppresses both.
return false;
}
}
And its registration in AndroidManifest.xml:
<meta-data
android:name="com.pushwoosh.notification_service_extension"
android:value="com.your.package.MyNotificationServiceExtension" />
If you have logic that sometimes handles pushes with your own UI, make sure it returns true only in those specific cases and false for everything else where you expect standard display and tracking behavior.
If you must return true and still want the open counted — for example when you show your own in-app UI while the app is in the foreground — add this meta-data to your AndroidManifest.xml. The SDK then reports the open event even though it did not display the notification itself:
<meta-data
android:name="com.pushwoosh.send_push_stats_if_alert_disabled"
android:value="true" />
Comments
0 comments
Please sign in to leave a comment.