boolean onHandlePush(Activity activity) { Bundle pushBundle = activity.getIntent().getBundleExtra("pushBundle"); if (null == pushBundle || null == mContext) { return false; } mLastBundle = pushBundle; JSONObject dataObject = new JSONObject(); Set<String> keys = pushBundle.keySet(); for (String key : keys) { // backward compatibility if (key.equals("u")) { try { dataObject.put("userdata", pushBundle.get("u")); } catch (JSONException e) { // pass } } try { dataObject.put(key, pushBundle.get(key)); } catch (JSONException e) { // pass } } PushEventsTransmitter.onMessageReceive(mContext, dataObject.toString(), pushBundle); // push message handling String url = (String) pushBundle.get("h"); if (url != null) { url = String.format(HTML_URL_FORMAT, url); // show browser Intent intent = new Intent(activity, PushWebview.class); intent.putExtra("url", url); activity.startActivity(intent); } String customPageUrl = (String) pushBundle.get("r"); if (customPageUrl != null) { // show browser Intent intent = new Intent(activity, PushWebview.class); intent.putExtra("url", customPageUrl); activity.startActivity(intent); } // temporary disable this code until the server supports it String packageName = (String) pushBundle.get("l"); if (false && packageName != null) { Intent launchIntent = null; try { launchIntent = mContext.getPackageManager().getLaunchIntentForPackage(packageName); } catch (Exception e) { // if no application found } if (launchIntent != null) { activity.startActivity(launchIntent); } else { url = (String) pushBundle.get("al"); if (url != null) { launchIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); activity.startActivity(launchIntent); } } } // send pushwoosh callback sendPushStat(mContext, pushBundle.getString("p")); return true; }