-1

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 ?

Rami
  • 7,879
  • 12
  • 36
  • 66
Amira Elsayed Ismail
  • 9,216
  • 30
  • 92
  • 175

1 Answers1

1

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;
     }
    .....
}
Rami
  • 7,879
  • 12
  • 36
  • 66