When we are doing the in-app message design on SFMC, there is a confirm button and a close button on the UI message. According to the SDK, we can only find the didCloseMessage and didShowMessage callback functions. However, it seems that there is no callback functions for the developers to determine which button user is clicked. Since we have different handling when user confirmed or closed the message, we need to have the callback function for each button. Could you please advise is there any callback functions in the SDK to trigger when user clicked the confirm button and close button? If not, please advise how the SDK let the app knows user clicked confirm or close button. For example, · didConfirmButtonClick() · didCloseButtonClick()

  • The close button i am referring here is x button available on the In app message configuration. This button is not working fine. When you click on the message it is redirecting to the same App url given on the CTA button. – Someshwar K Mar 23 '20 at 6:21
  • That is not what is stated in your question at all. Please ask a "new" question with the details of your issue. – Bill Mote Mar 23 '20 at 20:06

GREAT question! Your application must handle any URLs sent down to the device.

I think I understand what you're trying to do; you want to add a CTA (aka Confirm button) that simply has the action of "close" and you want to be able to distinguish that from the default close button displayed in the upper corder of the message, correct?

You are correct, we do not expose which button was pressed. The assumption was that a close button is a close button is a close button :) And a button with a URL action requires that you provide a PendingIntent from which you could track the button click yourselves. I will confer with the team and Product Owner about your use case. Please open a VOICE OF CUSTOMER request through your Account Executive. In the interim, it would be worth trying a URL action and recording your "confirm" action via your URL handler. I haven't tried a custom URL scheme in an InApp Message, but I don't see why you could not make it work; something like confirm://inapp.message.button or (if it needs a proper looking URL) http://confirm.iam.button.clicked (etc, etc). Then just have your PendingIntent do whatever you need :)

UPDATED: Verified. You can set your button with a custom URL in the URL Action for the message (screenshot attached).

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.