iOS

1. Installing SDK

1. Open the <PROJECT-NAME>.xcworkspace file.

2. Create a folder called frameworks under the ios folder.

3. Install the desired version of the framework from the link below and move the framework files to the frameworks folder in Xcode, checking Copy Items If Needed.

4. In the project settings, set all frameworks to Embed & Sign in Frameworks, Libraries, and Embedded Content.

2. Setting SDK

1. Import two below from the AppDelegate.h file.

AppDelegate.m
#import <IMQAMPMAgent/IMQAMPMAgent.h>
#import <IMQACrashAgent/IMQACrash.h>

2. In the AppDelegate.m file, add the code below to the top of - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions.

AppDelegate.m
NSString* PROJECT_KEY = @"<PROJECT_KEY>";

IMQACrashConfiguration* crashConfig = [[IMQACrashConfiguration alloc] initWithApiKey:PROJECT_KEY];
[IMQACrash startWithConfiguration:crashConfig];

IMQAConfig* mpmConfig = [[IMQAConfig alloc] init:PROJECT_KEY];
[[IMQAMpm sharedInstance] runWithConfig:mpmConfig];

3. If you see the log like below when running it after buildup, the installation is completed successfully.

3. Cordova Setup

1. Install WebView Agent at the top of your HTML. (Requires a build after installation)

2. In Xcode, locate the CordovaLib/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m file.

3. Import MPM SDK at the top in CDVWebViewEngine.m.

4. In - (void)pluginInitialize, find a part that modifies WKUserContentController and modify it.

5. Find and modify - (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message.

***Must be added to the very top of that function.***

Last updated