Cocopod Users
$ edit Podfile
platform :ios, '6.0'
pod 'ABTestingVessel'
$ pod install
$open App.xcworkspace
Open your AppDelegate.m file import Vessel header using the command below.
#import <Vessel/Vessel.h>
To initilize Vessel Framework add the following line to application:didFinishLaunchingWithOptions function.
Vessel *sharedInstance = [Vessel sharedInstance];
[sharedInstance initializeWithAppSecret:@"YOUR_SECRET_KEY"];
Setup
Vessel requires Xcode v4.6 and above and Apple devices running iOS 6.0 or higher.
Unzip the downloaded file and drag the Vessel.framework folder into your Xcode project folder target.
Ensure the "Copy items to destination's group folder" checkbox is checked and "add to targets" is selected.
Add dependencies
Choose you project in Xcode
Select your App name under targets
Click the Build Phases tab
Expand Link Binary With Libraries as shown below
Click the plus (+) button on the lower left of the Link Binary With Libraries section.
Add the following frameworks:
$ phonegap local plugin add https://github.com/vesselio/PhoneGapPlugin.git
// To ensure if its added correctly execute following command
$phonegap local plugin list
[phonegap] com.vessel.abplugin
//Soon it will be available in official plugin directory.
After adding plugin open your main / index.html file and add
Attach Event listener on "deviceready" method as follows
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
// Now safe to use the PhoneGap API
// Initialize Vessel A/B testing platform. You can simply initialize it once.
var YOUR_SECRET_KEY = 'YOUR_APP_KEY';
vesselab.initialize(
function(){console.log("VesselSDK Init done.");},
function(error){ console.log("an error occurred:" + error); },
YOUR_SECRET_KEY
);
}
In case if you experience any problem while building your application for iOS platform then verify
Open the tiapp.xml and add the following entries.
<modules>
<!-- Other modules can be present here -->
<module platform="android" version="1.0">io.vessel</module>
<module platform="iphone" version="1.0">io.vessel</module>
</modules>
After adding module, VesselSDK should be initialized in app.js as follows.
var VesselSDK = require('io.vessel');
VesselSDK.initialize('<secret_key>');
In WMAppManifest.xml go to Capabilities tab. Make sure the following options are enabled:
ID_CAP_IDENTITY_DEVICE
ID_CAP_NETWORKING
ID_CAP_LOCATION
Add sdk initialization to App.xaml.cs:
using Vessel;
...
private void Application_Launching(object sender, LaunchingEventArgs e)
{
VesselSDK.initialize("secret_key");
}