Features: Mobile SDK

Messaging

Create social collaborative apps where your users can message and send data to each other.

Collaborative Apps Can Change the World…

But messages cannot run amok. Regardless of your app, messages must be managed: correctly routed and delivered with security, and a guaranteed quality of service. With collaborative apps, messages are sent to multiple users who subscribe to a particular topic. MAS Messaging securely delivers these messages so only authenticated users can access specific messages.

Collaborative Apps Can Change the World…

But messages cannot run amok. Regardless of your app, messages must be managed: correctly routed and delivered with security, and a guaranteed quality of service. With collaborative apps, messages are sent to multiple users who subscribe to a particular topic. MAS Messaging securely delivers these messages so only authenticated users can access specific messages.

Lightweight is Better

Mobile apps deliver messages across the planet in milliseconds. And some apps require dozens of updates like sports scores and weather alerts. Our messaging solution uses the MQTT protocol, providing lightweight messaging that is ideal for real-time communications.

Lightweight is Better

Mobile apps deliver messages across the planet in milliseconds. And some apps require dozens of updates like sports scores and weather alerts. Our messaging solution uses the MQTT protocol, providing lightweight messaging that is ideal for real-time communications.

Security is Woven into Your App

MAS Messaging is fully integrated with the CA Mobile API Gateway (MAG). The MAG handles all user authentication and authorization using mutual TLS with CA certificates that establishes client-server trust. And data is secured using these heavy-weight features.

Security is Woven into Your App

MAS Messaging is fully integrated with the CA Mobile API Gateway (MAG). The MAG handles all user authentication and authorization using mutual TLS with CA certificates that establishes client-server trust. And data is secured using these heavy-weight features.

Open and Customizable

Roll your own solution using the open source Mobile SDKs, and our APIs.

 

 

Open and Customizable

Roll your own solution using the open source Mobile SDKs, and our APIs.

 

 



iOS Mobile SDK: Messaging

Implementation Highlights

MAS Messaging is implemented using the MQTT protocol. Why MQTT? It is lightweight and simple for constrained communication environments like IoT. Not to mention it has a small code footprint where network bandwidth is at a premium.

Code Sample

All of the backend complexity is abstracted away, so your interaction with the iOS Mobile SDK looks simply like this:

Send Messages

    //Authenticated users have the ability to send messages (Text, Data, Image) to a user
MASUser *myUser = [MASUser currentUser];
MASUser *userB = Some user retrieved from the server

[myUser sendMessage:@"Hello World" toUser:userB completion:^(BOOL success, NSError * _Nullable error) {
    
    NSLog(@"Message Sent : %@\nerror : %@", success ? @"YES":@"NO", error);
}];
    //Authenticated users can send messages (Text, Data, Image) to a user on a specific topic
MASUser *myUser = [MASUser currentUser];
MASUser *userB = Some user retrieved from the server

//
// Get image from App Bundle
//
NSString* filePath = [[NSBundle mainBundle] pathForResource:@"image" ofType:@"jpg"];
NSData *message = [NSData dataWithContentsOfFile:filePath];

//
// Create MASMessage object
//
MASMessage *messageImage = [[MASMessage alloc] initWithPayloadData:message contentType:@"image/jpeg"];
//
// Send Message to Recipient
//
[myUser sendMessage:messageImage toUser:userB onTopic:@"vacations" completion:^(BOOL success, NSError * _Nullable error) {
    
    NSLog(@"Message Sent : %@\nerror : %@", success ? @"YES":@"NO", error);
}];

More code samples:

Chat
What would you like to chat about?
Contact
Call us at +1-800-225-5224
Call us at +1-800-225-5224
Contact Us