Access Windows 10 features from the Unity IL2CPP project through the class library

I am trying to create a UWP class library that gives me access to native Windows 10 features like Windows.Security.Authentication.OnlineId. I would like to get the username and identifier from the device for use in the Unity UWP IL2CPP project. Currently, I can do this with Unity, created in the social class for ios, and there is code that Google wrote that makes it easy to work with the same class, but for Android games for Android.

I downloaded a sample from github ( https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/WebAccountManagement ), which demonstrates how to call the appropriate classes and functions in a UWP application and works well, but the samples, seem to be accessing classes from the class "Windows.Foundation.UniversalApiContract".

I cannot find a way to add this to the base UWP class library so that I can call the required classes such as Windows :: Security :: Credentials :: WebAccountProvider.

The best I managed to do was create a basic function in the class library that returns a small string string to check if this concept was deleted. : -

extern "C" __declspec(dllexport) wchar_t* __stdcall GetMyString() { wchar_t* myString = L"Guuuper"; auto resultBufferLength = wcslen(myString) + 1; wchar_t* result = static_cast<wchar_t*>(CoTaskMemAlloc(resultBufferLength * sizeof(wchar_t))); wcscpy_s(result, resultBufferLength, myString); return result; } 

My whole trip in an attempt to do this can be found here: - http://forum.unity3d.com/threads/returning-c-string-to-il2cpp-windows-store-project.395284/

I was able to successfully call this code from unity using the UWP assembly, but my main question is how would I like to add the appropriate links or how to create this class library to access the WebAccountProvider class?

Any help would be greatly appreciated

Update: I asked the MS team on my site about this problem, and they seem to be working on a solution.

+8
c ++ visual-studio-2015 uwp unity3d il2cpp
source share

No one has answered this question yet.

See related questions:

519
How to call a parent class function from a derived class function?
202
What is the difference between a shared project and a class library in Visual Studio 2015?
one
Can MS Band and Unity be used for offline build of Windows?
one
Unity cannot build a GRPC project for UWP using IL2CPP software
0
Is it possible to use js libraries from Chakra / ChakraCore, or am I limited to a single javascript line?
0
How to use pure C ++ code with IL2CPP to compile Unity in a Windows application?
0
Change script backend from IL2CPP to .NET Unity (for the latest version of Vuforia)
0
Failed to link iOS project with il2cpp and Unity
0
How to export a Unity project to Android using IL2CPP
0
Unity project now requires IL2CPP

All Articles