Coder Social home page Coder Social logo

cocos2d-x / plugin-x Goto Github PK

View Code? Open in Web Editor NEW
71.0 23.0 92.0 83.42 MB

Plugin-x is the plugin repository for cocos2d-x, it also provides a unified API for plugins.

JavaScript 0.52% C++ 30.26% C 2.80% Lua 0.54% Java 13.01% Objective-C 49.63% Objective-C++ 3.14% Shell 0.02% Makefile 0.09%

plugin-x's Introduction

Plugin-x

Plugin-x provides an easy way for developers to integrate various third party SDKs across different platforms with cocos2d-x

Highlights

One unified API for all SDKs

  • Ads
  • Analytics
  • IAP
  • Social

##Getting Started

##Update

  • If you're looking for SDK integration solution for Chinese App Store, please consider using AnySDK

plugin-x's People

Contributors

darkdukey avatar giuslape avatar jotel avatar lihex avatar martell avatar minggo avatar nilium avatar ntotani avatar pandamicro avatar pyrasis avatar rolandoam avatar samuele3hu avatar samuele3hu2022 avatar thomasaw avatar walzer avatar wuzhiming avatar young40 avatar zilongshanren avatar zj831007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugin-x's Issues

Facebook share

when FB apps present sharing gives the following message
share: { "error_message" : "Failed to generate preview for user."}
share result ret: 1

how to fix?

Feature required: Modify default Facebook SDK version

Related Issue: cocos2d/cocos2d-console#173

ANDROID_VERSION_PATH = '/CUI/facebook-android-sdk/facebook/src/com/facebook/FacebookSdkVersion.java'
IOS_VERSION_PATH = '/CUI/facebook-ios-sdk/src/FacebookSDK.h'

For Android it looks like this:

final class FacebookSdkVersion {
    public static final String BUILD = "3.18.0/Cocos2d-x";
}

For iOS:

#define FB_IOS_SDK_VERSION_STRING @“3.18/Cocos2d-x"

what does "keyword" in androidManifest.xml do?

hi.
i see an element "keyword" in androidManifest.xml. but in modifyManifest.py only uses to checking activity

    # check config for application
    appCfgNode = sourceRoot.find('applicationCfg')
    if appCfgNode is not None and len(appCfgNode) > 0:
        appKeyWord = appCfgNode.get('keyword')

        if appKeyWord != None and len(appKeyWord) > 0:
            keyIndex = targetContent.find(appKeyWord)
            if -1 == keyIndex:
                bRet = True
                for node in list(appCfgNode):
                    root.find('application').append(node)

if I want to add a new sdk into plugin-x.what should I do.

Cocos2d-js V3 onRequestProductResult callback error

This is my code (i have found pluginx for cocos2d-js)

onRequestProductResult: function (ret, productInfo) {

    cc.log(ret);

    cc.log(productInfo);

    var msgStr = "";

    if (ret == plugin.ProtocolIAP.RequestProductCode.RequestFail) {

        msgStr = "request error";

        cc.log(msgStr);

    } else if (ret == plugin.ProtocolIAP.RequestProductCode.RequestSuccess) {

        console.log("Product Request Success");

        this.product = productInfo

        cc.log(productInfo);

    }

}

Console log is 449229635.775578 for productInfo … This is meaningless
I dont understan which i did wrong

How can i fix it?

IAP cannot callback.

plugin-x/protocols/platform/android/ProtocolIAP.cpp 41
if (pIAP != NULL)
{
pIAP->onPayResult((PayResultCode) ret, strMsg.c_str());
}
else
{
ProtocolIAP::ProtocolIAPCallback callback = pIAP->getCallback();
if(callback)
callback(ret, strMsg);
}
plugin-x/protocols/platform/ios/IAPWrapper.mm 42
if (iapPlugin) {
iapPlugin->onPayResult(cRet, chMsg);
}else if(callback){
std::string stdmsg(chMsg);
callback(cRet,stdmsg);
} else {
PluginUtilsIOS::outputLog("Can't find the C++ object of the IAP plugin");
}
There is a logic error, if you use the Lua, not the callback.

Bug in setDebugMode

There's a bug in PluginProtocol::setDebugMode which causes the first byte of an NSNumber* to be passed as a BOOL to setDebugMode.

Call goes like this:

  1. js_pluginx_protocols_PluginProtocol_setDebugMode passes a JSBool to PluginProtocol::setDebugMode.
  2. PluginProtocol::setDebugMode creates an NSNumber and passes it to PluginUtilsIOS::callOCFunctionWithName_oneParam.
  3. PluginUtilsIOS::callOCFunctionWithName_oneParam takes the NSNumber as an id and passes it to InterfaceXXX via performSelector.
  4. InterfaceXXX, for example InterfaceAnalytics takes and truncates the id argument to BOOL.

Therefore, there is no reliable way to set debug mode to true or false. Most likely it will always be true because a pointer cast to a boolean is almost always non-zero.

Plugin-x iOS IAP Feedback, please give me responses

i'm using plugin-x iOS IAP , and this is my Feedback

  1. There's no implementation of configDeveloperInfo function, i have implemented it like this:
-(void) configDeveloperInfo: (NSMutableDictionary*) cpInfo{

    [self requestProducts :[cpInfo objectForKey:@"iapKey" ]];

}
  1. i can't call the restore function and there's no callback for it.
  2. Handling errors is not enough (no internet connection, IAP restriction,..)
  3. if my iPad was not connected, after trying to buy an item, if I connect it to the internet, plugin-x does not initialize the variable _paying to false, so we can't purchase items after this (until relaunching the app)
  4. i think that, there's mistake here :
typedef enum 
{
    kPaySuccess = 0,
    kPayFail,
    kPayCancel,
    kPayTimeOut,
} PayResultCode;


typedef enum {
    PaymentTransactionStatePurchased = 0,
    PaymentTransactionStateFailed,
    PaymentTransactionStateRestored,
    PaymentTransactionStateTimeout,
} IAPResult;

Why the third element isn't the same ?
Thanks for this great work. and i hope that you will consider my Feedback as soon as possible.

Update instructions how to compile/run samples and also how to integrate individual plugins

Current instructions don't work for cocos 3.7.
At least, this is my attempt:

Compile & publish plugins

unzip ../cocos2d-x-3.7.zip
cd cocos2d-x-3.7/
./setup.py
source ~/.bash_profile
cd plugin/tools/
./setup.py
./android-build.py all

# produces this error
OSError: [Errno 2] No such file or directory: '/pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/tools/../publish/plugins'

# fixed by creating the expected folder manualy
mkdir ../publish
mkdir ../publish/plugins

# run it again
./android-build.py all

# produces these warnings at the begging 

The Selected NDK toolchain version was 4.8 !
Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml    
Android NDK: WARNING:/pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/tools/../..//plugin/protocols/proj.android/jni/Android.mk:PluginProtocolStatic: LOCAL_LDLIBS is always ignored for static libraries    

# but finishes OK

[armeabi] Install        : libcocos2dcpp.so => libs/armeabi/libcocos2dcpp.so
make: Leaving directory `/pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android'

./publish.sh 

# finishes OK

Compile Samples

cd plugin/samples/HelloPlugins/proj.android/
./build_native.py
android update project -p . -t 17
android update project -p /pp/dev-cpp/libs/c/cocos2d-x-3.7/cocos/platform/android/java/ -t 17 
ant debug install

Results in errors

[javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:28: error: package org.cocos2dx.plugin does not exist
    [javac] import org.cocos2dx.plugin.PluginWrapper;
    [javac]                           ^
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:29: error: package org.cocos2dx.plugin does not exist
    [javac] import org.cocos2dx.plugin.FacebookWrapper;
    [javac]                           ^
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:41: error: cannot find symbol
    [javac]         PluginWrapper.init(this);
    [javac]         ^
    [javac]   symbol:   variable PluginWrapper
    [javac]   location: class AppActivity
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:42: error: cannot find symbol
    [javac]         PluginWrapper.setGLSurfaceView(glSurfaceView);
    [javac]         ^
    [javac]   symbol:   variable PluginWrapper
    [javac]   location: class AppActivity
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:43: error: cannot find symbol
    [javac]         FacebookWrapper.onCreate(this);
    [javac]         ^
    [javac]   symbol:   variable FacebookWrapper
    [javac]   location: class AppActivity
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:50: error: cannot find symbol
    [javac]         PluginWrapper.onResume();
    [javac]         ^
    [javac]   symbol:   variable PluginWrapper
    [javac]   location: class AppActivity
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:56: error: cannot find symbol
    [javac]         PluginWrapper.onPause();
    [javac]         ^
    [javac]   symbol:   variable PluginWrapper
    [javac]   location: class AppActivity
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:62: error: cannot find symbol
    [javac]         PluginWrapper.onDestroy();
    [javac]         ^
    [javac]   symbol:   variable PluginWrapper
    [javac]   location: class AppActivity
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:67: error: cannot find symbol
    [javac]         if(!PluginWrapper.onActivityResult(requestCode, resultCode, data))
    [javac]             ^
    [javac]   symbol:   variable PluginWrapper
    [javac]   location: class AppActivity
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:71: error: cannot find symbol
    [javac]         FacebookWrapper.onAcitivityResult(requestCode, resultCode, data);
    [javac]         ^
    [javac]   symbol:   variable FacebookWrapper
    [javac]   location: class AppActivity
    [javac] /pp/dev-cpp/libs/c/cocos2d-x-3.7/plugin/samples/HelloPlugins/proj.android/src/org/cocos2dx/HelloPlugins/AppActivity.java:77: error: cannot find symbol
    [javac]         FacebookWrapper.onSaveInstanceState(outState);
    [javac]         ^
    [javac]   symbol:   variable FacebookWrapper
    [javac]   location: class AppActivity
    [javac] 11 errors

Please take a moment and give us at least a hint. Current SDKBOX is not yet in good shape and these plugins are still in demand. Thanks a lot!

Error in publish.sh script for plugin-x

Hi!

Another Issue for plugin-x from me ^^
Using: Windows 8.1 x64 with cygwin
After ./publish.sh I need to paste the directories for android sdk ndk and ant.

After the script is creating the plugins for everything it shows this error:

./toolsForPublish/publishPlugin.sh: Zeile 73: /cygdrive/c/cocos/tools/ant/ant: No such file or directory
./toolsForPublish/publishPlugin.sh: Zeile 74: /cygdrive/c/cocos/tools/ant/ant: No such file or directory

It adds /ant to the path I set for ant-files. That's wrong?
And how can I reset the ant-path?

libPluginProtocol cannot build for android on OSX

I cannot build libPluginProtocol on develop branch.
I tried that 'tools/toolsForPublish/publishPlugin.sh' ant plugin-publish task add -v option and run tools/publish.sh then I got such back trace

     [echo] Resolving Build Target for libPluginProtocol...

BUILD FAILED
/opt/android-sdk/tools/ant/build.xml:542: Unable to resolve project target 'android-7'
    at com.android.ant.GetTargetTask.execute(GetTargetTask.java:162)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 0 seconds
cp: /Users/yalab/project/oke-ya/zeron/cocos2d/plugin/protocols/proj.android/bin/*.jar: No such file or directory

Thanks.

meet a bug in PluginProtocol::callStringFuncWithParam

I meet a bug when use PluginProtocol::callStringFuncWithParam in C++ code . Returns the value of the last few garbled. Functions calls in java is return String and no parameter. Especially when the return value is all number, and no matter the length of string is long or short.

Full screen ads with AdMob - Android

I read in the code:
case ADMOB_TYPE_FULLSCREEN:
LogD("Now not support full screen view in Admob");

Just to ask, why it's not supported? Some limitation or it was just not developed?

Because if possible, I'll try to develop this feature.

Wrong callback code in IAPWrapper.mm (for iOS) and in ProtocolIAP.cpp (for Android)

Current callback code in onPayResult:withRet:withMsg method is next:

...
if (iapPlugin) {
        iapPlugin->onPayResult(cRet, chMsg);
}else if(callback){
        std::string stdmsg(chMsg);
        callback(cRet,stdmsg);
} else {
        PluginUtilsIOS::outputLog("Can't find the C++ object of the IAP plugin");
}
...

So, if plugin was successfully instantiated callback(cRet,stdmsg); will be newer called.
I think, code should be equivalent to other plugins, where all works properly:

...
if (iapPlugin) {
        PayResultListener *listener = iapPlugin->getResultListener();
        if(listener) {
            iapPlugin->onPayResult(cRet, chMsg);
        }
        else if(callback) {
            std::string stdmsg(chMsg);
            callback(cRet,stdmsg);
        }
}
else {
        PluginUtilsIOS::outputLog("Can't find the C++ object of the IAP plugin");
}
...

The same problem on Android - in file ProtocolIAP.cpp

Compiling failed: luabindings/manual/lua_pluginx_manual_callback.cpp

Failed when compiling Android

jni/../../../cocos2d-x/plugin/luabindings/manual/lua_pluginx_manual_callback.cpp: In function 'int lua_pluginx_protocols_FacebookAgent_login(lua_State*)':
jni/../../../cocos2d-x/plugin/luabindings/manual/lua_pluginx_manual_callback.cpp:778:66: error: 'tolua_err' was not declared in this scope
             if (!toluafix_isfunction(tolua_S,2,"LUA_FUNCTION",0,&tolua_err))
                                                                  ^
jni/../../../cocos2d-x/plugin/luabindings/manual/lua_pluginx_manual_callback.cpp:800:66: error: 'tolua_err' was not declared in this scope
             if (!toluafix_isfunction(tolua_S,3,"LUA_FUNCTION",0,&tolua_err))
                                                                  ^

uiHelper null

When i call FacebookWrapper.track, there is an exception null point: uiHelper null

Error when calling function with BOOL result on iOS

There are bugs in PluginUtilsIOS::callOCBoolFunctionWithName_oneParam and PluginUtilsIOS::callOCBoolFunctionWithName functions.

Instead of:

BOOL* pRet = (BOOL*)callRetFunction...(...);
if (nil != pRet) {
ret = pRet;
}

There should be:

NSNumber* pRet = (NSNumber*)callRetFunction...(...);
if (nil != pRet) {
ret = [pRet boolValue];
}

iOSIAPAgent redundant?

I don't get why iOSIAPAgent exists. It looks like it is an earlier FacebookAgent (there is already one of those).

Plus, it doesn't compile since it has two identical constructor definitions and std:string is improperly namespaced.

callOCBoolFunctionWithName crash

"bool ProtocolUser::isLogined()"中:
PluginUtilsIOS::callOCBoolFunctionWithName(this, "isLogined");

“id PluginUtilsIOS::callRetFunction(PluginProtocol* pPlugin, const char* funcName)”中
ret = [pOCObj performSelector:selector];

isLogined返回的是一个BOOL
直接拿一个id接受,然后再返回,再强转成一个NSNumber*会蹦掉,而且内存也会有问题

Questions locationg of jar of android plugin(library project)

ADT is automatically load libs located jar and usually it's located.
(not need .classpath add)
but plugin library project located jar is folder of sdk.

It is in error if you run in ADT that it is this state.

i understand you add class path using in cocos2d/plugin/tools/android/build_common.xml on ant build steps.

And to correct the situation of strange here We Will it difficult?

Android's Facebook ShareFacebook bug

on function
private void WebRequestDialog(JSONObject info)
...

requestDialogBuilder.setOnCompleteListener(new OnCompleteListener(){
@OverRide
public void onComplete(Bundle values, FacebookException error) {
...
if(!"request".equals(key)){
buffer.append(""");
// ----- buffer.append(values.getString(it.next()));
buffer.append(values.getString(key));
buffer.append("",");
}

Smaple for iOS IAP

Hi,
i would like to use Plugin-X iOS IAP in my new game, but there's no sample for doing that, like google IAP
So please, if you could doing it, that can help me alot.
Thanks.

Callback is never call on login method in Android

I launch the TestFacebookUser sample for Android and when i click on "login" or "loginWithPermission", the login activity is display but after validate the Facebook connexion nothing is happen. The text never change, but when i close the application et I open it again, after clicking on "login", the Facebook Login Activity is not display. On Facebook Application page, i see my application and permissions asked. So Facebook save my application association.
Now, if I call "login", callback method is never call. If I call "IsLoggedIn", false is return. If i call another method (getToken, getUid) there is an error message like "User is not login".
I didn't change any line in the example, I just replace the appId with my own appId.
Thanks in advance,

Cedric

tutorial for plugin integration

HI, I appreciate the sample projects. But it would be nice a tutorial could be included to understand how to integrate the plugin.

thx.

Compile error in android project flurry and google IAP plugin

jni/../../Classes/Helper/WrapperClass.cpp:183: error: undefined reference to 'cocos2d::plugin::ProtocolAnalytics::logEvent(char const_, std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > >)'
jni/../../Classes/Helper/WrapperClass.cpp:191: error: undefined reference to 'cocos2d::plugin::ProtocolAnalytics::logEvent(char const
, std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > >_)'
jni/../../Classes/Helper/WrapperClass.cpp:204: error: undefined reference to 'cocos2d::plugin::ProtocolIAP::payForProduct(std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > >)'
jni/../../Classes/Helper/WrapperClass.cpp:284: error: undefined reference to 'cocos2d::plugin::ProtocolIAP::configDeveloperInfo(std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > >)'

i get the following errors after updating the plugin-x code I'm my project the flurry part works on iOS though

2 fails when publishing plugins on v3.3rc2

Hello,

When I run the publish script on the latest beta release (v3.3rc2), I see the following 2 fails in the output (protocal and iosiap):

[armeabi-v7a] StaticLibrary : libPluginProtocolStatic.a
[armeabi-v7a] Compile thumb : android_native_app_glue <= android_native_app_glue.c
[armeabi-v7a] StaticLibrary : libandroid_native_app_glue.a
make: Leaving directory '/cygdrive/d/Work/cocos2d-x/plugin/protocols/proj.android'

Native build action success.

/cygdrive/d/Work/cocos2d-x/plugin/tools /cygdrive/d/Work/cocos2d-x/plugin/tools

Now publish .

target dir is /cygdrive/d/Work/cocos2d-x/plugin/publish/plugins/.
android project dir is /cygdrive/d/Work/cocos2d-x/plugin/plugins/./proj.android

Publish plugin for android
./toolsForPublish/publishPlugin.sh: line 49: pushd: /cygdrive/d/Work/cocos2d-x/plugin/plugins/./proj.android: No such file or directory
Buildfile: build.xml does not exist!
Build failed
Buildfile: build.xml does not exist!
Build failed
cp: cannot stat `/cygdrive/d/Work/cocos2d-x/plugin/plugins/./proj.android/bin/*.jar': No such file or directory

/cygdrive/d/Work/cocos2d-x/plugin/tools

and

Now publish iosiap

target dir is /cygdrive/d/Work/cocos2d-x/plugin/publish/plugins/iosiap
android project dir is /cygdrive/d/Work/cocos2d-x/plugin/plugins/iosiap/proj.android

Publish plugin for android
./toolsForPublish/publishPlugin.sh: line 49: pushd: /cygdrive/d/Work/cocos2d-x/plugin/plugins/iosiap/proj.android: No such file or directory
Buildfile: build.xml does not exist!
Build failed
Buildfile: build.xml does not exist!
Build failed
cp: cannot stat `/cygdrive/d/Work/cocos2d-x/plugin/plugins/iosiap/proj.android/bin/*.jar': No such file or directory

/cygdrive/d/Work/cocos2d-x/plugin/tools

Version: cocos2d-x-3.3rc2
NDK: android-ndk-r10d-windows-x86_64
Windows 7

Kind regards,
Michael

Another way to merge AndroidManifest.xml?

Hi Guys,

I see you are merging AndroidManifest.xml use a python script which can not handle duplicate elements well. Meanwhile, Android has already implemented an ant task mergemanifest to merge AndroidManifests, do you guys want to try this way?

sample build.xml:

<?xml version="1.0" encoding="utf-8"?>
<project name="merge-manifest" default="merge" basedir=".">

    <!--
    <property name="appManifest" value="../../../proj.android/AndroidManifest.xml"/>
    <property name="outManifest" value="./AndroidManifest.xml" />
    <property name="plugin_publish_dir" value="" />
    -->

    <property file="local.properties"/>
    <!-- jar file from where the tasks are loaded -->
    <path id="android.antlibs">
        <pathelement path="${sdk.dir}/tools/lib/ant-tasks.jar" />
    </path>

    <!-- Custom tasks -->
    <taskdef resource="anttasks.properties" classpathref="android.antlibs" />


    <path id="plugin_manifest">
      <fileset dir="${plugin_publish_dir}">
          <include name="**/**/**/AndroidManifest.xml"/>
      </fileset>
    </path>

    <target name="merge">
      <mergemanifest
             appManifest="${appManifest}"
             outManifest="${outManifest}"
             enabled="true">
             <library refid="plugin_manifest" />
        </mergemanifest>
    </target>
</project>

querySkuDetails() did not make load skuDetails when request skuList.size()%20 == 0

try to add plugix iapios in cocos2dx-lua,there are some problems

The first time I tried to complete such a code, please understand.
I use the sandbox test account, I think the result should be a JSON string,but I can't get it.

void ProtocolIAP::onPayResult(PayResultCode ret, const char* msg)
{
_paying = false;
if (_listener)
{
_listener->onPayResult(ret, msg, _curInfo);
}
else
{
PluginUtilsIOS::outputLog("Pay result listener of %s is null!", this->getPluginName());
}

_curInfo.clear();
PluginUtilsIOS::outputLog("Pay result of %s is : %d(%s)", this->getPluginName(), (int) ret, msg);

}
in this code ret is 0 to complete the purchase,and the _listener is null,cannot Lua callback function

If I want to get the JSON string pay for results, and will be the string callback to Lua, how should I do? Please help, thank you!

FB Plugin App Request (Android)

Redirect URL: fbconnect://success?request=1529986293921504&to%5B0%5D=379417542225453&to%5B1%5D=100003552134001

completion handler does not return the complete "to" field
{"request":"1529986293921504", "to":["100003552134001"]}

Issue with Android getUserId on first login.

auto facebook = cocos2d::plugin::FacebookAgent::getInstance();
std::string permissions = "public_profile,user_friends";
facebook->login(permissions, [=](int ret, std::string& msg){
CCLOG("type is %d, msg is %s", ret, msg.c_str());

    if (facebook->isLoggedIn()) {

        //Save access token
        auto accessToken = facebook->getAccessToken();

        //Save user id
        auto id = facebook->getUserID();
   }

}


ID here after first login comes to be empty.


Fix :

private class SessionStatusCallback implements Session.StatusCallback {
@OverRide
public void call(Session session, SessionState state, Exception exception) {
onSessionStateChange(session, state, exception);
if(false == isLoggedIn){
if(SessionState.OPENED == state){
isLoggedIn = true;
// UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_SUCCEED, getSessionMessage(session));
}else if(SessionState.CLOSED_LOGIN_FAILED == state /|| SessionState.CLOSED == state/){
UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_FAILED, getErrorMessage(exception, "login failed"));
}

        }
        else{
            if(SessionState.OPENED_TOKEN_UPDATED == state){
                UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_SUCCEED, getSessionMessage(session));
            }                   
            else if(SessionState.CLOSED == state || SessionState.CLOSED_LOGIN_FAILED == state){
                isLoggedIn = false;
                UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_FAILED, getErrorMessage(exception, "failed"));
            }                   
        }
    }
}

private void onSessionStateChange(final Session session, SessionState state,
Exception exception) {
if (session != null && session.isOpened()) {
// make request to the /me API
Request.newMeRequest(session, new Request.GraphUserCallback() {
@OverRide
public void onCompleted(GraphUser user,
Response response) {
LogD("User here");
if (user != null) {
LogD("User here " + user.getId());
userIdStr = user.getId();
UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_SUCCEED, getSessionMessage(session));
}

            }
        }).executeAsync();
    }
}

how to add Countly SDK for Cocos2d-x plugin-x

I finished countly sdk for plug-x.But there is a problem to pull request.
In Plugin-x HelloPlugins project, having two analytics sdks support.However, they're separated by local language.

    if (LanguageType::CHINESE == langType)
    {
        pluginName = "AnalyticsUmeng";
        strAppKey = umengKey;
    }
    else
    {
        pluginName = "AnalyticsFlurry";
        strAppKey = flurryKey;
    }

Countly is an innovative, real-time, open source mobile analytics and push notifications platform. it's can develop by self-host on any language.

please let know , how to add countly sample code?so i can pull request?

Crash when calling unloadPlugin() - iOS

When calling,

PluginManager::getInstance()->unloadPlugin("PluginName");

app crash with EXC_BAD_ACCESS(code=EXC_I386_GPFLT).

This is stacktrace from when my app was crashing,

#0  0x000000010fc22dba in std::__1::less<cocos2d::plugin::PluginProtocol*>::operator()(cocos2d::plugin::PluginProtocol* const&, cocos2d::plugin::PluginProtocol* const&) const [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:63
#1  0x000000010fc22db6 in std::__1::__tree<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, std::__1::__map_value_compare<cocos2d::plugin::PluginProtocol*, std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, std::__1::less<cocos2d::plugin::PluginProtocol*>, true>, std::__1::allocator<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*> > >::value_comp() [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map:460
#2  0x000000010fc22da2 in std::__1::__tree_iterator<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, std::__1::__tree_node<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, void*>*, long> std::__1::__tree<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, std::__1::__map_value_compare<cocos2d::plugin::PluginProtocol*, std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, std::__1::less<cocos2d::plugin::PluginProtocol*>, true>, std::__1::allocator<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*> > >::__lower_bound<cocos2d::plugin::PluginProtocol*>(cocos2d::plugin::PluginProtocol* const&, std::__1::__tree_node<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, void*>*, std::__1::__tree_node<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, void*>*) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree:2102
#3  0x000000010fc22ab6 in std::__1::__tree_iterator<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, std::__1::__tree_node<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, void*>*, long> std::__1::__tree<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, std::__1::__map_value_compare<cocos2d::plugin::PluginProtocol*, std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*>, std::__1::less<cocos2d::plugin::PluginProtocol*>, true>, std::__1::allocator<std::__1::__value_type<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*> > >::find<cocos2d::plugin::PluginProtocol*>(cocos2d::plugin::PluginProtocol* const&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree:2028
#4  0x000000010fc1d9c1 in std::__1::map<cocos2d::plugin::PluginProtocol*, cocos2d::plugin::_PluginOCData*, std::__1::less<cocos2d::plugin::PluginProtocol*>, std::__1::allocator<std::__1::pair<cocos2d::plugin::PluginProtocol* const, cocos2d::plugin::_PluginOCData*> > >::find(cocos2d::plugin::PluginProtocol* const&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map:1081
#5  0x000000010fc1d9b5 in cocos2d::plugin::PluginUtilsIOS::erasePluginOCData(cocos2d::plugin::PluginProtocol*) at /Users/me/Downloads/cocos2d-x-3.3rc0/TAPPY/cocos2d/plugin/protocols/platform/ios/PluginUtilsIOS.mm:127
#6  0x000000010fc23c22 in cocos2d::plugin::ProtocolAnalytics::~ProtocolAnalytics() at /Users/me/Downloads/cocos2d-x-3.3rc0/TAPPY/cocos2d/plugin/protocols/platform/ios/ProtocolAnalytics.mm:36
#7  0x000000010fc23c75 in cocos2d::plugin::ProtocolAnalytics::~ProtocolAnalytics() at /Users/me/Downloads/cocos2d-x-3.3rc0/TAPPY/cocos2d/plugin/protocols/platform/ios/ProtocolAnalytics.mm:35
#8  0x000000010fc23c99 in cocos2d::plugin::ProtocolAnalytics::~ProtocolAnalytics() at /Users/me/Downloads/cocos2d-x-3.3rc0/TAPPY/cocos2d/plugin/protocols/platform/ios/ProtocolAnalytics.mm:35
#9  0x000000010fc18d94 in cocos2d::plugin::PluginManager::unloadPlugin(char const*) at /Users/me/Downloads/cocos2d-x-3.3rc0/TAPPY/cocos2d/plugin/protocols/PluginManager.cpp:99
#10 0x000000010fc0692e in AppDelegate::~AppDelegate() at /Users/me/Downloads/cocos2d-x-3.3rc0/TAPPY/Classes/AppDelegate.cpp:20

FYI, I am using this plugin https://developers.mobileapptracking.com/cocos2d-x-plugin/

Wiki Page for plugin-x sample

Hi!

I am looking to use plugin-x for admob. I am only interested in android :)

Reading the wiki page (http://github.com/cocos2d-x/plugin-x/wiki/Sample) these steps are necessary.

import plugin/samples/HelloPlugins
import libcocos2dx under cocos/platform/android/java
run build_native.py
run HelloPlugins in ADT/eclipse

Where should I import plugin/samples/HelloPlugins?

In a new ADT/Eclipse project? Please write the sample more clear, Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.