CW
Navigation
πŸ‡§πŸ‡· PT πŸ‡ΊπŸ‡Έ EN
Home About Stack Companies Blog
CONTACT
Back to Blog
20 May 2020 60 Views
Unity + UWP - How to open the Rate Now Screen

Unity + UWP - How to open the Rate Now Screen

"Unity Windows Store: Use #NETFX_CORE for Mono & #ENABLE_WINMD_SUPPORT for IL2CPP builds to open the store page. Code snippets included!"

There is a trick here, you need a different conditional define for Mono Builds and another for IL2CPP builds!

Mono Builds

#if NETFX_CORE string productID = Windows.ApplicationModel.Package.Current.Id.FamilyName; Application.OpenURL("ms-windows-store://pdp/?ProductId=" + productID); #endif

IL2CPP Builds

#if ENABLE_WINMD_SUPPORT string productID = Windows.ApplicationModel.Package.Current.Id.FamilyName; Application.OpenURL("ms-windows-store://pdp/?ProductId=" + productID); endif

The real trick is to use the #ENABLE_WINMD_SUPPORT conditional define for IL2CPP builds or #NETFX_CORE for Mono Builds.

References :

https://docs.unity3d.com/Manual/windowsstore-code-snippets.html

https://docs.microsoft.com/en-us/windows/uwp/gaming/missing-dot-net-apis-in-unity-and-uwp#feedback

Cezar Wagenheimer
Written By

Cezar Wagenheimer

Full Stack Developer & Game Creator. Specialized in building immersive digital experiences and advanced systems.

Connect:
Share this article

Comments

Be the first to comment!

Leave a comment