voltmx.iMessageExtensions Namespace
The voltmx.iMessageExtensions Namespace enables you to add support for iMessage app extensions in your iOS app. With iMessage app extensions, users can send content text, stickers, and media files to each other. For more information about what iMessage app extensions are and what you can use them for, please see the Apple developer documentation.
With the voltmx.iMessageExtensions namespace, your iOS apps can leverage the power of the iMessage app to add interactive conversations and file sharing to your app's functionality.
You add an iMessage extension to your app in the same way that you add any other type of iOS app extension. For more details, refer App Extension for iOS.
Before your iMessage extension can be used, your app must set the callback functions that provide the iMessage extension with its functionality. It does this by invoking the voltmx..iMessageExtension.setExtensionsCallbacks function.
Properties
The voltmx.iMessageExtensions Namespace provides the following properties.
voltmx.iMessageExtensions.view
Holds the current extension view.
Syntax
voltmx.shareExtensions.view
Example
//Sample code
var myView = voltmx.iMessageExtensions.view;
myView.addSubView(button);
Type
UIView
Read/Write
Read only.
Platform Availability
iOS.
Functions
The voltmx.iMessageExtensions namespace provides the following function.
voltmx.iMessageExtensions.setExtensionsCallbacks
Sets an iMessage extension functionality with various states as callback events.
Syntax
voltmx.iMessageExtensions.setExtensionsCallbacks(callbacks)
Input Parameters
callbacks
Contains an object with key-value pairs where the key specifies the extension state and the value is a callback function. The following are the possible keys.
Key Description didBecomeActiveWithConversation The extension is about to present the UI. didCancelSendingMessageConversation The user deleted the message without sending it. didReceiveMessageCconversation A message has arrived that was generated by another instance of this extension on a remote device. didStartSendingMessageConversation The user tapped the Send button. didTransitionToPresentationStyle The extension has just transitioned to a new presentation style. loadView Loads a view that the controller manages. viewDidAppear A view was just displayed. viewDidDisappear A view just removed from the view hierarchy. viewDidLoad The the view controller has loaded its view hierarchy into memory. viewWillAppear A view is about to be displayed. viewWillDisappear A view is about to be removed from the view hierarchy. willResignActiveWithConversation The extension is about to change from the active to inactive state. willTransitionToPresentationStyle The extension is about to transition to a new presentation style.
Example: didBecomeActiveWithConversation
function didBecomeActiveWithConversation() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"didBecomeActiveWithConversation": didBecomeActiveWithConversation
});
Example: didCancelSendingMessageConversation
function didCancelSendingMessageConversation() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"didCancelSendingMessageConversation": didCancelSendingMessageConversation
});
Example: didReceiveMessageCconversation
function didReceiveMessageConversation() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"didReceiveMessageConversation": didReceiveMessageConversation
});
Example: didStartSendingMessageConversation
function didStartSendingMessageConversation() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"didStartSendingMessageConversation": didStartSendingMessageConversation
});
Example: didTransitionToPresentationStyle
function didTransitionToPresentationStyle() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"didTransitionToPresentationStyle": didTransitionToPresentationStyle
});
Example: loadView
function loadView() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"loadView": loadView
});
Example: viewDidAppear
function viewDidAppear() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"viewDidAppear": viewDidAppear
});
Example: viewWillAppear
function viewWillAppear() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"viewWillAppear": viewWillAppear
});
Example: viewDidDisappear
function viewDidDisappear() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"viewDidDisappear": viewDidDisappear
});
Example: viewWillDisappear
function viewWillDisappear() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"viewWillDisappear": viewWillDisappear
});
Example: willResignActiveWithConversation
function willResignActiveWithConversation()
{
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks ({"willResignActiveWithConversation": willResignActiveWithConversation});
function willResignActiveWithConversation() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"willResignActiveWithConversation": willResignActiveWithConversation
});
Example: willTransitionToPresentationStyle
function willTransitionToPresentationStyle() {
// Native Function API code
}
voltmx.iMessageExtensions.setExtensionsCallbacks({
"willTransitionToPresentationStyle": willTransitionToPresentationStyle
});
Return Values
None.
Platform Availability
iOS.only