MiniAppMessageDelegate
public protocol MiniAppMessageDelegate : ChatMessageBridgeDelegate, MAAnalyticsDelegate, MiniAppShareContentDelegate, MiniAppUserInfoDelegate, UniversalBridgeDelegate
Public Protocol that will be used by the Mini App to communicate with the Native implementation
-
getUniqueId(completionHandler:
Default implementation) Interface that should be implemented to return alphanumeric string that uniquely identifies a device.
Default Implementation
Declaration
Swift
@available(*, deprecated, renamed: "getMessagingUniqueId(completionHandler:﹚") func getUniqueId(completionHandler: @escaping (Result<String?, MASDKError>) -> Void)
-
getMessagingUniqueId(completionHandler:
Default implementation) Interface that should be implemented to return alphanumeric string that uniquely identifies a device assembled as message unique id
Default Implementation
Declaration
Swift
func getMessagingUniqueId(completionHandler: @escaping (Result<String?, MASDKError>) -> Void)
-
getMauid(completionHandler:
Default implementation) Interface that should be implemented to return alphanumeric string that uniquely identifies a device assembled as mauid
Default Implementation
Declaration
Swift
func getMauid(completionHandler: @escaping (Result<String?, MASDKError>) -> Void)
-
requestDevicePermission(permissionType:
Default implementationcompletionHandler: ) Interface that should be implemented in the host app that handles the code to request any permission and the result (allowed/denied) should be returned.
Default Implementation
Declaration
Swift
func requestDevicePermission(permissionType: MiniAppDevicePermissionType, completionHandler: @escaping (Result<MASDKPermissionResponse, MASDKPermissionError>) -> Void)
-
requestCustomPermissions(permissions:
Default implementationminiAppTitle: completionHandler: ) Optional Interface that can be implemented in the host app to handle the Custom Permissions. SDK will open its default UI for prompting Custom Permissions request if this protocol interface is not overridden
Default Implementation
Declaration
Swift
func requestCustomPermissions(permissions: [MASDKCustomPermissionModel], miniAppTitle: String, completionHandler: @escaping (Result<[MASDKCustomPermissionModel], MASDKCustomPermissionError>) -> Void)
-
getEnvironmentInfo
Default implementationOptional Interface that can be implemented in the host app to retrieve MAHostEnvironmentInfo
Default Implementation
Declaration
Swift
var getEnvironmentInfo: (() -> (MAHostEnvironmentInfo))? { get }
-
downloadFile(fileName:
Default implementationurl: headers: completionHandler: ) Interface that is used to download files
Default Implementation
Declaration
Swift
func downloadFile(fileName: String, url: String, headers: DownloadHeaders, completionHandler: @escaping (Result<String, MASDKDownloadFileError>) -> Void)
-
closeMiniApp(withConfirmation:
Default implementationcompletionHandler: ) Interface to recieve the close command from the MiniApp
Default Implementation
Declaration
Swift
func closeMiniApp(withConfirmation: Bool, completionHandler: @escaping (Result<Bool, MiniAppJavaScriptError>) -> Void)
-
getHostAppThemeColors(completionHandler:
Default implementation) Interface to get the host app theme colors
Default Implementation
Declaration
Swift
func getHostAppThemeColors(completionHandler: @escaping (Result<HostAppThemeColors?, MiniAppJavaScriptError>) -> Void)
-
isDarkMode(completionHandler:
Default implementation) Interface to get if the Device is in Dark mode
Default Implementation
Declaration
Swift
func isDarkMode(completionHandler: @escaping (Result<Bool, MiniAppJavaScriptError>) -> Void)
-
sendJsonToHostApp(info:
Extension methodcompletionHandler: ) Declaration
Swift
func sendJsonToHostApp(info: String, completionHandler: @escaping (Result<MASDKProtocolResponse, UniversalBridgeError>) -> Void)
-
sendInfoToHostApp(info:
Extension methodcompletionHandler: ) Declaration
Swift
func sendInfoToHostApp(info: UniversalBridgeInfoParameters, completionHandler: @escaping (Result<MASDKProtocolResponse, UniversalBridgeError>) -> Void)
-
didReceiveMAAnalytics(analyticsInfo:
Extension methodcompletionHandler: ) Declaration
Swift
func didReceiveMAAnalytics(analyticsInfo: MAAnalyticsInfo, completionHandler: @escaping (Result<MASDKProtocolResponse, MAAnalyticsError>) -> Void)