Skip to content

Cocos2d-x JNI to connect your app to the Infantium SDK

License

Notifications You must be signed in to change notification settings

chescales/infantium-cocos2dx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

infantium-cocos2dx

Dependencies:

This project requires the EasyNDK project to run. You can find it here: EasyNDK repository

General info about the integration:

You can find more info about the integration process with Infantium in its developers webpage: Infantium Dev Center

Some info about how to integrate:

  1. Add to Activity:onCreate:

InfantiumManager.initModule(this);

  1. Add to Activity:onPause:

InfantiumManager.onPause();

  1. Add to Activity:onResume:

InfantiumManager.onResume();

  1. 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;
}
  1. Add rights to the manifest:

  2. In cocos2d-x AppDelegate:applicationDidFinishLaunching add:

InfantiumModule.init(apiUser, apiKey, contentAppUuid);

  1. Do not forget to add dependencies to project.properties & Android.mk.

  2. 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;
}

About

Cocos2d-x JNI to connect your app to the Infantium SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 67.3%
  • C++ 25.8%
  • Objective-C 6.9%