incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aurelien MERCIER (JIRA)" <>
Subject [jira] [Commented] (CB-923) SplashScreen doesn't hide while getting push notification
Date Fri, 15 Jun 2012 20:57:42 GMT


Aurelien MERCIER commented on CB-923:

Sure, here is the story: we can send direct messages from our application. When receiving
a push, when we click on it it will launch our app with an argument, the name of the community.
Then we can open the right community directly in the inbox page with the content message.

Concerning the implementation, we followed the google instructions detailed here:
and we had to implement the following method to process a push:

private void processPushNotification(Context context, Intent intent) {
        String hostname = intent.getStringExtra(Constants.HOSTNAME_PARAMETER_NAME);
        if (shouldShowNotification(hostname)) {
            NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
            int icon = R.drawable.icon;
            String message = intent.getStringExtra(Constants.MESSAGE_PARAMETER_NAME);
            Notification notification = new Notification(icon, message, System.currentTimeMillis());
            notification.flags = Notification.FLAG_AUTO_CANCEL;
            notification.defaults = Notification.DEFAULT_ALL;

            String community = intent.getStringExtra(Constants.COMMUNITY_PARAMETER_NAME);
            int unreadCount = Integer.parseInt(intent.getStringExtra(Constants.UNREAD_COUNT_PARAMETER_NAME));

            String contentText = unreadCount > 1 ? String.format("%d unread items", unreadCount)
: message;
            Intent notificationIntent = new Intent(context, JiveMobileActivity.class);
            Bundle bundle = Helper.buildBundleFromNotificationIntent(intent);
            notificationIntent.putExtra(Constants.NOTIFICATION_BUNDLE, bundle);
            PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent,
            notification.setLatestEventInfo(context, community, contentText, contentIntent);
            notificationManager.notify(hostname, Constants.JIVE_MOBILE_ACTIVITY_NOTIFICATION_ID,

JiveMobileActivity is the main class extending DroidGap.


> SplashScreen doesn't hide while getting push notification
> ---------------------------------------------------------
>                 Key: CB-923
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.7.0
>            Reporter: Aurelien MERCIER
>            Assignee: Joe Bowser
> After rebuilding cordova 1.7.0 and having put some log around spashscreen, I saw that
hide function doesn't work when receiving a push notification that will launch our app(same
with the timeout). I saw that you will refactor the code outside droid gap, if it becomes
a plugin it should solved the problem since it will be a new intent? Right now putting the
splashDialog static volatile solve the problem on most droid phones except the one with ICS

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message