Skip to content

Commit 190808d

Browse files
committed
Updated logic for logging of isEmptyBody check.
1 parent ae0bd36 commit 190808d

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterablePushReceiver.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,27 @@ public void onReceive(Context context, Intent intent) {
4545
private void handlePushReceived(Context context, Intent intent) {
4646
if (intent.hasExtra(IterableConstants.ITERABLE_DATA_KEY)) {
4747
Bundle extras = intent.getExtras();
48-
if (!IterableNotification.isGhostPush(extras) && !IterableNotification.isEmptyBody(extras)) {
49-
IterableLogger.d(TAG, "Iterable push received " + extras);
50-
Context appContext = context.getApplicationContext();
51-
PackageManager packageManager = appContext.getPackageManager();
52-
Intent packageIntent = packageManager.getLaunchIntentForPackage(appContext.getPackageName());
53-
ComponentName componentPackageName = packageIntent.getComponent();
54-
String mainClassName = componentPackageName.getClassName();
55-
Class mainClass = null;
56-
try {
57-
mainClass = Class.forName(mainClassName);
58-
} catch (ClassNotFoundException e) {
59-
IterableLogger.w(TAG, e.toString());
60-
}
48+
if (!IterableNotification.isGhostPush(extras)) {
49+
if (!IterableNotification.isEmptyBody(extras)) {
50+
IterableLogger.d(TAG, "Iterable push received " + extras);
51+
Context appContext = context.getApplicationContext();
52+
PackageManager packageManager = appContext.getPackageManager();
53+
Intent packageIntent = packageManager.getLaunchIntentForPackage(appContext.getPackageName());
54+
ComponentName componentPackageName = packageIntent.getComponent();
55+
String mainClassName = componentPackageName.getClassName();
56+
Class mainClass = null;
57+
try {
58+
mainClass = Class.forName(mainClassName);
59+
} catch (ClassNotFoundException e) {
60+
IterableLogger.w(TAG, e.toString());
61+
}
6162

62-
IterableNotification notificationBuilder = IterableNotification.createNotification(
63-
appContext, intent.getExtras(), mainClass);
64-
new IterableNotificationBuilder().execute(notificationBuilder);
63+
IterableNotification notificationBuilder = IterableNotification.createNotification(
64+
appContext, intent.getExtras(), mainClass);
65+
new IterableNotificationBuilder().execute(notificationBuilder);
66+
} else {
67+
IterableLogger.d(TAG, "Iterable OS notification push received");
68+
}
6569
} else {
6670
IterableLogger.d(TAG, "Iterable ghost silent push received");
6771
}

0 commit comments

Comments
 (0)