-
Notifications
You must be signed in to change notification settings - Fork 17
Sending messages
Mobile Messaging library provides the ability to send inbound messages from mobile device, also known as Mobile Originated (MO) messages.
MO messages sent from users' smartphone can be forwarded by our system to your own server. To activate the service please follow the configuration setup and action setup.
Once your server receives an MO message, it’s up to its' logic to identify the message recipient (destination identifier) and what to do with data received from mobile devices. Destination identifier might be any string you choose to define as the wanted destination of your MO message.
NOTE: Please, follow the instructions linked above for configuring MO forward action. Without this configuration you won't be able to receive MO messages on your server
Following example code shows how you can send MO messages from mobile device:
Message message = new Message();
message.setDestination("jgbh-r#HJbtyx7ny3ugd-34fhj3LKjl");
message.setBody("This is my mobile-originated message!");
JSONObject customPayload = new JSONObject();
customPayload.put("order_name", "pizza_capriciossa");
customPayload.put("rushed_delivery", true);
customPayload.put("coupon_number", 44869320);
message.setCustomPayload(customPayload);
MobileMessaging.getInstance(context).sendMessages(message);
You can receive message status using two methods:
- supply ResultListener of MobileMessaging;
- register BroadcastReceiver in order to receive status information about each sent message as described in MESSAGES_SENT event.
After you've configured desired MO actions your server is able to receive sent inbound messages.
An error "Push MO route is not available for your account. Please contact your account manager." (HTTP status code 403) may be received in response to attempt to send a message from mobile device. Contact your account manager to address the issue.
If you have any questions or suggestions, feel free to send an email to support@infobip.com or create an issue.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
Geofencing API- DEPRECATED- Android Manifest components
- Privacy settings
- In-app chat
- Infobip RTC calls and UI
- Backup rules