How to integrate 3rd party SDKs in C# to Windows 10 app for cocos2d-x 3.7

Before Cocos2d-x 3.6 we had a C# (native) code for Windows applications. Now I guess we have windows8.1-universal and windows 10 projects that are not using C#, but using C++/CX - a new language from Microsoft. So how I am going to integrate 3rd party SDKs to my windows phone 10 app? Say I want to use Parse which gives only C# or VisualBasic SDKs for windows phone.

@zhangxm @nite @ricardo @slackmoehrle please tell how Cocos2d-x is planned to work with 3rd party SDKs that are not in SDKBOX yet.

@zhangxm @nite @ricardo @slackmoehrle
I think the issue is that there used to be a C++/CX type project (C# with a C++ lib extension) and now it is only a C++ project. This C++/CX project was called proj.wp8-xaml.

Without a C#/CX project, it doesn’t seem like it is possible to use any ad networks (include Microsofts), Microsoft IAP, or third party C# libraries.

I think the questions to ask are:

1) Why was the C++/CX (C# with a C++ lib extension) project removed in Cocos2d-x 3.7 instead of being upgraded for Win8.1 and Win10?

2) Can the C++/CX project be added back for windows 8.1 universal and Win10 to enable integrating C# libraries such as Admob, Flurry, Parse, Microsoft IAP, Microsoft Ads, etc.?

3) Is there an alternative way to add C# libraries and [C# <-> C++] code to the existing pure C++ Cocos2d-x windows projects?

There are other discussion about this same topic but no one has commented why there was the change to a pure C++ project.

Info about C++/CX: https://msdn.microsoft.com/en-us/library/hh699871.aspx

2 Likes

so I don’t know the answer here, but I will ask @zhangxm to read this thread and give us advice.

@slackmoehrle could you please explain why Cocos2d-x moved from C# to C++/CX for windows?

P.S. @zhangxm we really need your help, please.

I honestly don’t know what the reasoning is. I’d assume that there are benefits for doing so. We shall hear from @zhangxm

WP platform is managed by MS guys. I will ask them to take a look.

@zhangxm any update on this?

I think the key issues to resolve are:

  1. Why was the C++/CX (C# with a C++ lib extension) project removed in Cocos2d-x 3.7 instead of being upgraded for Win8.1 and Win10?

  2. Can the C++/CX project be added back for windows 8.1 universal and Win10 to enable integrating C# libraries such as Admob, Flurry, Parse, Microsoft IAP, Microsoft Ads, etc.?

  3. Is there an alternative way to add C# libraries and C# to C++ and C++ to C# bidirectional communication code to the existing pure C++ Cocos2d-x windows projects?

@Heyalda
I have already sent a mail to @stammen, hope he can take a look of these issues.

Hello, any news from MS guys?

These days I also want to integrate parse into Windows Phone app.
Anyone give us some explanations.

waiting for it to :slight_smile:

The same question, any new from MS guys?

Hi all, it is sad that they didn’t response it. I will remind them again.

It would be cool if Cocos2d-x supported adding third party SDK’s to the Windows Phone like it used to.
The c++/cx project type was an easy foundation to work off of to add C# libraries.
I think that was an important feature and it was easy to understand.

It’s too bad that no one knows why the C++/cx project was removed form Cocos2d-x and why it was not added as a feature to the 8.1 universal and the Win10 projects.
As a result of it being removed, I stopped supporting Windows Phone.

It seems like the only option to dig into Visual Studio and learn how to configure a project that supports C# and C++.

Hi Heyalda,

We dropped the C#/C++ version of cocos2d-x for Windows Phone when we added JavaScript support. The JavaScript engine uses SpiderMonkey which has a threading model that is incompatible with the C#/C++ framework. However, the support for C#/C++ is still there in cocos2d-x versions 3.5 and earlier.

We realize that this makes it more difficult to add third party SDKs. However, most of the SDKs that you listed have only Windows 8.0 support (AdMob, Flurry, Parse). The new C++ version does support Microsoft Ads and IAP. Microsoft has also released a Facebook SDK (on the Microsoft GitHub site) that works with Windows 8.1 and 10.0.

In order to work with Parse you will need to use their REST api.

We are aware that many of the 3rd party SDK’s have not been upgraded to C++ and Windows 8.1 and 10.0. Currently the best solution is to use cocos2d-x v3.5 or earlier.

Please let me know if you have any more questions.

Dale

Thanks for the response Dale.
Good to know that I didn’t go down that rabbit hole of trying to create a C++/cx project with Cocs2d-x 3.8.
I didn’t realize that Admob, Flurry, etc don’t support Windows 8.1.

Maybe I’ll look into MS Ads, MS IAP, and the Facebook SDK.
That could be a solid foundation for a game.

Can you recommend any tutorials or info about setting up MS Ads, MS IAP and the Facebook SDK with Cocos2d-x 3.8?

Thank you very much.
Can you recommend any tutorials or info about setting up MS Ads, MS IAP and the Facebook SDK with Cocos2d-x 3.8

Can cocos2dx support C++/CX project again ?

There are many libraries that only support C# dll solution but lack of C++ one. Some C++ libraries that can not built on windows phone arm (like boost…).

Good to see some updates !

The main problem is to make C# can call C++, about this ,we can use swig, http://www.swig.org,
it will create the C# class from C++ class, so you can call the C++ code in C#.

Thanks I got it but with C# runtime I can invoke C# methods from C++ and I don’t know how to do that with C++ runtime.