## What is Mobile Connect?

Mobile Connect is a **mobile application for Android** that allows you to connect your phone to the BulkGate Portal use your mobile phone plan in the business communication with your customers. In practice, you can create an SMS campaign on the Portal and then send it to your phone by selecting the right sender, which will then distribute the SMS campaign to your customers from your mobile plan.

When it comes to Mobile Connect app, if the phone is not being used by the user (ie. screen is turned off), phone can switch to sleep mode (for saving battery life) which could cause SMS not being send on time or not at all. Phone must be in active state during usage - which means app must be on and active.

Sleep mode can also be set by default on some devices (depends on manufacturer, OS distribution, or agressivity of sleep mode when it comes to turning off applications).

If you send the first MT SMS (original message), the MO SMS (incoming message) is automatically assigned to your wallet.
If you plan to send the first MO SMS without MT SMS, please contact us so that we can assign your default wallet in the system. This will automatically assign the MO SMS to the correct account.

> [!WARNING]
> Please note that when using the Mobile Connect app, this is a machine text messaging service. Mobile operators do not allow machine text messaging in some countries. Always follow your mobile operator's terms and conditions. 

> [!WARNING]
> On this basis, we cannot guarantee deliverability.

## Installation

The first step is to download the Android application from [here](/download/mobile-connect.apk).

After the installation, the basic screen appears.

![init_page](helpdesk:mobile-connect-install/mobile_connect_en2)

There you will see a `Key` and `PIN` which you subsequently enter into the Portal.

## Linking the application

1. Go to `Modules & APIs` in the left menu on [BulkGate Portal](https://portal.bulkgate.com/)
2. Select `Mobile Connect` in the list
3. Click `Create API`

![init_page](helpdesk:mobile-connect-install/mobile_connect_portal1_en)

Now type the `Key` and `PIN` from the phone screen into the portal in the appropriate fields and click `Save.`

![init_page](helpdesk:mobile-connect-install/mobile_connect_portal2_en)

The installation is now completed.

## Sender settings
1. Go to the second step of the SMS campaign.
2. On the right side of the SMS text editor, click on the `Sender Type` menu and select `Mobile Connect`.
3. Another menu `Mobile Connector` will appear
4. Select which connector you want to use


![Sender setting](helpdesk:mobile-connect-install/mobile-connect-sender-setting-en)


## Use

There is a big `Start` button on the main screen that turns on and off sending of messages.

![init_page](helpdesk:mobile-connect-install/mobile_connect_en3)

After activation, the application switches to the `Idle` state, waiting for messages from the Portal.

### Settings

The application has the following settings:

- **Randomize delay** - Allows to delay the sending of a message in the range of 1s-20s (user defines the interval e.g. 5s-18s).
- **Process SMS replies** - All responses received by the phone are transferred to the Portal.
- **Support long messages** - Messages that exceed 160 characters (or 70 in Unicode) are sent in batch (split message into more 160/70 character messages), and the recipient's phone receives more parts of the message separately.
  
The `Sent daily`/`Sent total` statistics are calculated according to the number of text messages (i.e. 1 message received from the API and divided into several SMS messages will be counted as 1 message in the statistics).

### Sending

To send SMS from the application, it is necessary to select `Mobile Connect` sender type in the campaign and then the appropriate mobile phone. Then everything happens just like with a regular campaign.
If the application is sending, it is in the `Running` state.

![init_page](helpdesk:mobile-connect-install/mobile_connect_en4)


## PUSH Notifications

The app can only receive messages to your phone without forwarding them. Click on the bell in the top right menu to get to the list of received messages.

![init_page](helpdesk:mobile-connect-install/mobile_connect_en5)

## API settings

To start using the Mobile Connect API you need:
1. Install the Mobile Connect App. Download [here](/download/mobile-connect.apk).
2. Create an API on the [BulkGate Portal](https://portal.bulkgate.com/)
3. Choose Sender ID type: `sender_iD: gMobile`.
4. Insert key: `sender_ID_value: KEY`, where you get the `KEY` from the @[Mobile Connect App in the phone](#installation) you want to use to send the message.


**Example of a complete HTTP Advanced API v2 request (applies to HTTP Advanced API v1 and v2 (transactional and marketing), and HTTP Simple API):**
```http-json
POST /api/2.0/advanced/transactional HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
Cache-Control: no-cache

{
    "application_id": 451,
    "application_token": "NKN02TWE6NfBkfl-your-secret-token-Wf05GaqLIWLW4aBj",
    "number": "420111222333",
    "text": "example text <first_name>",
    "variables": {"first_name": "John Doe"},
    "country": "cz",
    "schedule": "2018-05-14T18:30:00-01:00",
    "channel": {
      "sms": {
        "sender_id": "gMobile",
        "sender_id_value": "KEY",
        "unicode": true,
        "text": "example text"
      }
    }
}
```
