How to load IOSIAP in plugin-X?

I’m trying to use iosiap that is added recently in plugin-x.

What I did with x-code is below.

  1. added PluginProtocol ios project as sub-project.
  2. added PluginIAP ios project as sub-project.
  3. added libPluginProtocol.a, libPluginIAP.a to Link binary with libraries in Build Phases.
  4. tried load by _inAppPurchase = dynamic_cast<ProtocolIAP*>(PluginManager::getInstance()->loadPlugin("PluginIAP"));
  5. compiled successfully

But when run on device, _inAppPurchase is null.
Did i miss something or use wrong plugin name?

I’m want to use iosiap and googleplayiap plugin in my game

in iOS when i try loading the plugin
void WrapperClass::loadPluginIAP()
{
std::string pluginName;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
pluginName = “IAPIOS”;
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
pluginName = “IAPGooglePlay”;
#endif

_pluginIAP=dynamic_cast<cocos2d::plugin::ProtocolIAP*> (cocos2d::plugin::PluginManager::getInstance()->loadPlugin(pluginName.c_str()));

}
i get the following message:
Plugin-x: Unable to load class ‘IAPIOS’. Did you add the -ObjC linker flag?

and in android
i modified the config.sh file in plugin/tools

#define plugins array
export ALL_PLUGINS=(“flurry” “umeng”
“alipay” “nd91” “IAPGooglePlay”
“admob”
“twitter” “weibo”
“qh360” “uc”)

but the published folder for IAPGooglePlay was empty

has any one got the IAP plugins working ?

@Daryl

try to use “googleplay” (folder name) instead of “IAPGooglePlay”.

thanks for your answer it worked but now there is only a for manifest file in the googleplay published folder

@Daryl
Because source code for IAPGooglePlay has some errors to compile.
You can see error messages while compiling.
Try just remove all other plugins but googleplay in config.sh and compile it.
See what console says.