This project requires the EasyNDK project to run. You can find it here: EasyNDK repository
You can find more info about the integration process with Infantium in its developers webpage: Infantium Dev Center
- Add to Activity:onCreate:
InfantiumManager.initModule(this);
- Add to Activity:onPause:
InfantiumManager.onPause();
- Add to Activity:onResume:
InfantiumManager.onResume();
- Add to Activity new method:
public JSONObject infantium_easyNDK(JSONObject params) {
Log.v("infantium_easyNDK", "infantium_easyNDK called");
Log.v("infantium_easyNDK", "Passed params are : " + params.toString());
JSONObject retParams = InfantiumBridge.dispatchNDKCall(params);
try {
Log.v("infantium_easyNDK", "Returned Params params are : " + retParams.toString());
}
catch (NullPointerException e) {
Log.v("infantium_easyNDK", "returned null params");
}
return retParams;
}
-
Add rights to the manifest:
-
In cocos2d-x AppDelegate:applicationDidFinishLaunching add:
InfantiumModule.init(apiUser, apiKey, contentAppUuid);
-
Do not forget to add dependencies to project.properties & Android.mk.
-
Optionally for iOS stubs. Add method to RootViewController:
(NSObject *)infantium_easyNDK:(NSObject *)params {
NSLog(@"infantium_easyNDK call");
NSDictionary *parameters = (NSDictionary*) params;
NSLog(@"Passed params are : %@", parameters);
NSObject *retParams = [InfantiumBridge dispatchNDKCall:parameters];
NSLog(@"RetParams params are : %@", retParams);
return retParams;
}