Dismiss Message center rich text that display using landing page after click on Rich text button

I am using landing page for display Rich text of Message Center push notification using following intent

new Intent("com.urbanairship.actions.SHOW_LANDING_PAGE_INTENT_ACTION")).setPackage(UAirship.getPackageName()).addFlags(805306368).setData(Uri.fromParts("message", messageId, (String)null))

When landing page Rich text is showing and after click on Rich text button landing page is automatic dismiss and related action is perform but When we use landing page for showing Message Center push notification after click on Rich text button, action is perform but landing page is not dismiss. It is showing.

Now I want when we click on button of landing page that is display message center notification, Showing Rich text is automatic dismiss like landing page rich text.

How can we achieve this functionality?

Didn't find what you were looking for?

New post



  • Hi Shailesh,

    Could you better explain what use case you're trying to accomplish here?

    A Rich Page can describe both a Landing Page or a Message Center message. Rich text is not valid terminology to describe content inside.

    Typically, the are two situations to use when putting together a Rich page. If you are using the out-of-the-box message center that acts like an inbox, then anytime a user taps on a notification tied to a Message Center message, it will open directly to that message.

    A Landing page, however, does not live inside the inbox. Instead, it is a dialog box that can be dismissed by the user. The content, like the Message Center, will remain the same.

    It sounds as though you want the Message Center message that lives inside the app to pop-up in a landing page looking dialog, is that correct? If not, can you explain more clearly what you're trying to accomplish?

    Comment actions Permalink
  • Yes I want Message Center message that lives inside the app to pop-up in a landing page looking dialog and it is also displaying like landing page dialog.
    Now my requirement is that when we click on button of landing page dialog then landing page dialog is automatically dismiss and appropriate action is being perform, but when we click on button of Message Center message that lives inside the app to pop-up in a landing page looking dialog then action is being perform but dialog box is not automatically dismiss.

    Now I want to know that how to dismiss landing page dialog box after click on button of Message center that lives inside the app to pop-up in a landing page looking dialog

    Comment actions Permalink
  • Gotcha, okay.

    So, what you'll need to do is instead use the OverlayRichPushMessage action to be able to perform what you need it to.

    In this case, you're telling the app to perform the action, display rich push as an overlay, and then you're give it the Message Id that you want.

    This is described in our reference guide.

    Note that you should only be doing this if you are building out a custom Message Center.

    If you're currently using the out-of-the-box Message Center, and are trying to change the current functionality, then you will be unable to do so.


    Comment actions Permalink
  • Hi Michael,

    I am using below custom message center

    public class CustomMessageCenter extends Activity {
    String messageId = null;
    protected void onCreate(Bundle savedInstanceState) {
    Log.e("custom", "custom activity opened");
    if(HomeActivity.myURLMessageCenter != null)
    messageId = HomeActivity.myURLMessageCenter;

    else if(getIntent() != null && getIntent().getData() != null &&
    messageId = getIntent().getData().getSchemeSpecificPart();
    (new Handler(Looper.getMainLooper())).post(new Runnable() {
    public void run() {
    Intent intent = (new Intent("com.urbanairship.actions.SHOW_LANDING_PAGE_INTENT_ACTION")).setPackage(UAirship.getPackageName()).addFlags(805306368).setData(Uri.fromParts("message", messageId, (String)null));

    try {
    } catch (ActivityNotFoundException var3) {
    Logger.error("Unable to view the inbox message in a landing page. The landing page activity is either missing in the manifest or does not include the message scheme in its intent filter.");


    with following intent filter
    <action android:name="com.urbanairship.VIEW_RICH_PUSH_MESSAGE" />

    <data android:scheme="message" />

    <category android:name="android.intent.category.DEFAULT" />

    Using above code I am able to display custom message in landing dialog,
    but now I want to dismiss landing dialog when we click on button of landing page.
    Comment actions Permalink
  • Shailesh,

    You might try, instead, calling UAirship.close() inside the HTML page itself. Note that this will be using the Javascript bridge instead of writing this into the app itself.

    Comment actions Permalink

Please sign in to leave a comment.