Skip to content

Example application guide

Davor Komušanac edited this page Dec 5, 2022 · 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. Click on "UPLOAD" under "APNS Certificates" and locate the .p12 certificate you exported from your Keychain earlier.
    CUP Settings

Run example application in Xcode

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

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

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

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

To setup application code for Notification Service Extension add your application code to NotificationServise.swift:

MobileMessagingNotificationServiceExtension.startWithApplicationCode("your-application-code")

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

Use-cases implemented in Example application

Push messages

Received push messages will be displayed in list.

Messages list

Deeplink

Deeplink handling as described in How to use "deeplink" to land user to a particular app page?

Clone this wiki locally