Windows phone 8.1 IAP's and ADS

Hello. How do I connect to the project Windows Phone 8.1 microsoft store IAP’s ? I use cocos 3.6. The project with no C# or XAML folders, only proj.win8.1-universal. My game compiling and working fine, but i have add shop and ADS in my game.

Really nobody knows?

Having same issue :frowning:
Someone have example how to connect IAP in WP8.1 with cocos2d-x 3.6+ ?

I’m going to work on this today too, and as soon as I figure out I will post back. But I’m stuck on another issue - I don’t know how to add the assets because when I run my game on windows phone I get a console message about the file not found (see my other post).

Regarding assets they should be picked by default from your default Resources folders if it is Cocos2d-x 3.6+ project, sometimes it doesn’t work so I’m copying files manually to:

proj.win8.1-universal/App.WindowsPhone/Assets/Resources

Also there can be issue that your files are not picked up by Visual Studio because of default supported file format, so you need to switch in file explorer to View all mode(not sure what was the correct name) and them select files which you want to include in project then right click and “include in project”, also make sure that checkbox checked that this file should be added to build :smile:

P.S WP8.1 supports only wav sounds.

The following post hopefully will have more information soon from @zhangxm or @stammen:

Thanks - that solved it. The problem was I copied to my Assets folder. When I put my assets in the resources folder everything worked. Working on ads now.

If you need connect c# code to c++, just create WINRT Component, put in all your c# code and link component to your c++ project. After that you can call c# methods from c++ like this:

libWinrtComponent::MyClass::Test();
libWinrtComponent::MyClass::Instance()->Test();

p.s.
Check this sample https://code.msdn.microsoft.com/windowsapps/Licensing-API-Sample-19712f1a/, there is c++ project with implemented IAP’s too.

@vasya123 does it make any sense to you why the C++/cx project structure was removed in about Cocos2d-x 3.5 and replaced with a pure C++ project? Were there problems with using a C++/cx project structure?

I need to brush up on my VS2013/2015 skills and try your suggestion. I’m an Xcode power user, but a VS rookie.

If you are talking about windows store, there are both projects win8.1-universal and win10 in cocos2d-x github repository, therein you could use c++/cx.
I don’t have any published windows store projects with cocos2d-x yet. But I have successfully ported c++ game, that was made with SDL2. It have same structure as cocos2d-x projects - main c++ project with game code and WinRT Component project for managed code.
So I don’t think that there will be any problems with using same approach here.