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.
c ++ visual-studio-2015 uwp unity3d il2cpp
Sammyg
source share