handle button1, button2 click in appboy

133 Views Asked by At

I am implementing IInAppMessageManagerListener interface and want to handle the method onInAppMessageButtonClicked, but I want to know the button the user pressed (Button1 or Button2) to be able to handle each one with different handling.

How can I do that ?

1

There are 1 best solutions below

0
On BEST ANSWER

You can use the button id (with MessageButton.getId() mehtod) to know which one is pressed.

boolean onInAppMessageButtonClicked(MessageButton button, InAppMessageCloser inAppMessageCloser){

     switch(button.getId()){

        case button1_id:
            // do button 1 stuff
        break;

        case button2_id:
            // do button 2 stuff
        break;
     }
    .....
}