Skip to content

Example application guide

Tereza Juric edited this page Apr 24, 2018 · 12 revisions

How to run example application

Prepare application configuration in portal

As the first step, you will need to have an Application with Push enabled set up in Infobip Portal for your account. If you already have it, then you can skip this section, otherwise:

  1. Prepare your App ID, provisioning profiles and APNs certificate (APNs Certificate Guide).

  2. Prepare your Infobip account (https://portal.infobip.com/push/applications) to get your Application Code:

    1. Create new application on Infobip Push portal.
    2. Navigate to your Application where you will get the Application Code.
    3. Mark the "Available on iOS" checkbox.
    4. Mark the "Sandbox" checkbox if you are using sandbox environment for the application.
    5. Click on "UPLOAD" under "APNS Certificates" and locate the .p12 certificate you exported from your Keychain earlier.
    CUP Settings

Run chat example application in XCode

First you will need to clone the SDK repository and install all dependencies for the app. So please go into ChatExample directory and run pod install:

$ cd infobip-mobile-messaging-ios/ChatExample
$ pod install

Now open MobileChatExample.xcworkspace and add your application code to AppDelegate.swift:

MobileMessaging
    .withApplicationCode("your-application-code", notificationType: .alert)?
    .withMobileChat()
    .start()

Then you can run the application on real device. Once application starts, you will be able to send and receive messages.

Mobile Chat Example

You can use Chat HTTP APIs to receive messages in your backend and send messages from your backend. Use push registration ID of this device for targeting. All communication between your backend and this device will be stored on device.

Clone this wiki locally