Integrating Your iMessage App

Messages for Business provides an iMessage app that makes it simple for you to send interactive messages to customers. But if you want to give your customers an interactive experience that is unique to your business, you can also use the Messages framework to create a standalone iMessage app or extend your iOS app so that it interacts with Messages. For more information, see iMessage App.

Exercise: Using Custom iMessage Apps

In this exercise, you perform the following tasks:

  • Set up the sample iMessage app.
  • Send an interactive message payload to trigger the sample iMessage app with custom parameters.

Step 1: Set up a sample iMessage app

  1. Make sure you are using Xcode 12 or later.
  2. Download the iMessage App sample, as part of the resources sample-code.
  3. Open the Xcode project, install and run the app on the test device.

Step 2: Send a custom iMessage app payload

  1. Copy Development Team ID and Bundle Identifier of the app from Xcode.
  2. Generate the bid parameter using prefix, team ID, and bundle identifier.
  3. Assemble the app parameter using URL parameters.
  4. Assemble and send the Message payload.

Perform the following tasks on your test server:

  1. Locate the code zip folder and unzip it.
  2. Open and edit the 22_invoke_custom_extension.py file by inserting the destination_id, located towards the bottom of the file, with the source_id from the output in Exercise: Receiving a Text Message.
  3. Save and run the 22_invoke_custom_extension.py file.

Expected MSP server response

Messages for Business server return code: 200

Expected client device response

Initial Response in Messages for Business iMessage App
On the user device, you should see the following message bubble. When the user taps the message bubble, a detailed map opens up with a location pin.