Cocos2dx v3.4 Windows Universal Apps Advertising

Hi, how can I integrate ads into my Cocos2dx v3.4 Windows Universal App? I have tried to use the pubCenter with no luck. I have also tried the adduplex sdk but there is nowhere to add the adcontrols?

Can someone outline some basic steps to integrate ads into a Windows Universal App?

Thanks.

1 Like

You can find the solution here:
Cocos2d-x WP8/8.1 ads integration

1 Like

Isn’t that for v2?

Is there anything for v3?
I am using 3.6v and its driving me crazy as i am not able to find any tuto for universal project.
Also Admob is not possible to add into win phone 8.1

I’ve tried adduplex and it works flawlessly. They have documentation how to integrate their sdk. You just can itegrate adduplex in c# (win phone 8.1 project) side. No need to write code in c++, unless you want to hide/show banner. Or you want to show interstitials.
Then look at my answer here:

Here’s how to do it with admob.
However I don’t recommend using admob. In my case using it caused strange bugs: disappearing textures (probably opengl context issue), game occasianally crashing.

In my games I use adduplex or adcontrol (from microsoft) with ad mediation (ms ads, admob), which can be configured via windows phone developer console.

Regards

1 Like

thanks for link but Admob is not supported for universal 8.1

there is still no support for this … I think no-one is looking at this. It is a pity but I do not know if I will publish my app for windows phone store.

If you want to monetize with Ads the only option is to use the old windows phone template (no universal app) and put the stuff in the C# code.

Hi,

i want to add Advertising to my First Windows Phone application (Cocos2Dx 3.6).
A lot of people seems to have difficulties to do that and all documentations i have found are incomplete or seems deprecated. But some people seems to succed. Is there any change for v3.6 ?

If i understand, i have to use microsoft.advertising.Mobile.UI.AdControl but i don’t know where to put it (OpenGLESPage.xaml ? where ? ) and how. (i am also a very beginner in XAML and Universal App, but i am only interested in Windows Phone for the time beeing)

Could you explain me how to do that step by step (for a beginner) ?

Thanks.

Use XAML project (c#). You can then right click project Add -> Connected service and there you can add ms ads or ms mediation (id’s on the dev panel). You can then go to MainPage.cs.xaml and just add one of these banners (ms ads or ms mediation).

Can you please elaborate on what you mean by use xaml project.

Are you saying there is a way to add XAML/C# to the proj.win8.1-universal project which currently is just C++?

Or create a new C++/cx project from scratch?

Cocos2d-x 2.x and earlier versions of 3.x used to use a C++/cx project. e.g. a C# XAML project with a C++ lib extension for the C++ code.

In the C++/cx project type that previously was the default for cocos2d-x, I have successfully integrated Admob and Flurry.

But I am uncertain what can be done with the Cocos2d-x 3.8 windows templates to add 3rd party c# or XAML libraries.

Any suggestions?

No, I mean use older cocos2d-x version where c# xaml project was present :slight_smile: Dunno how to do that with latest versions. However unless you use 3d (which I don’t know if is working fast enough on windows phone) you don’t really need latest cocos2d-x version.

Would be nice to figure out how to use C# libraries in the newer 8.1 and win10 projects.
Kind of sucks that this feature somehow was dropped.

Hopefully @stammen or someone else can shed some light on why the C++/cx project was abandoned in favor of a pure C++ windows universal project for 8.1.
A similar discussion about this topic can be found here: