Getting Started
1. Installation
For a fresh installation
- Download the WebEngageUnityiOS.unitypackage
- Import the downloaded unitypackage into your Unity project through
Assets
>Import Package
>Custom Package
.... - Replace the framework file at
Assets/Plugins/iOS/WebEngage.framework
with the latest WebEngage framework. Unzip the downloaded zip file to get the framework.
Updating the native WebEngage SDK within the Unity wrapper
Replace the framework file at Assets/Plugins/iOS/WebEngage.framework
with the latest WebEngage framework. Unzip the downloaded zip file to get the framework.
2. Initialization
- Add the following values in
/Assets/Editor/WebEngagePostProcessBuild.cs
file.
...
public class WebEngagePostProcessBuild
{
[PostProcessBuild]
public static void EditXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
{
if (buildTarget == BuildTarget.iOS)
{
// Add your WebEngage license code
string WEBENGAGE_LICENSE_CODE = "YOUR-WEBENGAGE-LICENSE-CODE";
// Set debug log level
string logLevel = "VERBOSE";
...
}
}
}
Make sure you replace YOUR_WEBENGAGE_LICENSE_CODE
with your WebEngage license code. As shown below, naviagte to the Account Setup section to find your license code.
- Initialize the WebEngage SDK in your
AppDelegate.m
class.
#import <WebEngage/WebEngage.h>
...
-(BOOL)application:(UIApplication*) application didFinishLaunchingWithOptions:(NSDictionary*) options
{
[[WebEngage sharedInstance] application:application didFinishLaunchingWithOptions:options];
...
}
If you are not already implementing AppDelegate.m
in your Unity app, then create a new file at /Assets/Plugins/iOS/OverrideAppDelegate.m
and copy the content below in that file.
#import "UnityAppController.h"
#import <WebEngage/WebEngage.h>
@interface OverrideAppDelegate : UnityAppController
@end
IMPL_APP_CONTROLLER_SUBCLASS(OverrideAppDelegate)
@implementation OverrideAppDelegate
-(BOOL)application:(UIApplication*) application didFinishLaunchingWithOptions:(NSDictionary*) options
{
[[WebEngage sharedInstance] application:application didFinishLaunchingWithOptions:options];
return [super application:application didFinishLaunchingWithOptions:options];
}
@end
Updated about 4 years ago
So, what's next?