This guide walks you through how to build a new iOS Mobile app that will enable in-app user-to-user chat between platforms.
Open Magnet Studio.
Click the Create App button in the navigation bar.
Enter a name for your app. Click Save to create your new app.
Download MagnetMax.plist
(from the Settings screen) and include in it in your new Xcode project.
Add the Magnet Message library to your Xcode project with CocoaPods. See the CocoaPods Get Started guide for more information.
Initialize the Magnet Message SDK.
Register yourself as a Magnet Message User.
Log in with the user created in the previous step, and initialize Magnet Message.
Get the current user after logging in.
Get Users. For example, to find users with known user names, use the code example below.
Create a chat channel with recipients. NOTE: In most cases the chat channel should be prviate. Only channel owners can invite people into the chat.
Register for a notification to receive the message and chat invitation. </a>
Once MMX has started, you can continue to implement your notification code as shown below:
Invite more users into the chat using the same invitation process used in the Private Discussion Group.
Get the chat history.
Get all chat recipients.
Set up disconnection handling. A user can be redirected to the login screen on disconnect with the code below.
We provide the capability to add a mechanism that notifies the app there is a pending incoming message to registerd users who are not currently online. This capability leverages the platform's push technology—in the case of iOS: APNS.
NOTE: Configuring APNS for your application is a prerequisite. Please see our detailed documentation on how to setup APNS for your application.
See how to send and receive Rich Messages in your app.