@@ -46,22 +46,26 @@ private void handlePushReceived(Context context, Intent intent) {
4646 if (intent .hasExtra (IterableConstants .ITERABLE_DATA_KEY )) {
4747 Bundle extras = intent .getExtras ();
4848 if (!IterableNotification .isGhostPush (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- }
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