Forum Discussion
Hedi_VR
5 years agoHonored Guest
How to keep Oculus IAP working when export Unity build in IL2CPP ?
Hi everyone!
If an expert know a solution to let Unity keep Oculus IAP when exporting in IL2CPP (not stripped), you will save the lives of so many people ! B)
But when I export with IL2CPP instead of Mono, the Oculus IAP doesn't work anymore at all.
To be clear, when I export the build in Mono, it is working perfeclty fine, so I don't understand what I'm missing with IL2CPP (stripping) with Oculus.VR ...
//======= Need a Hero who know the Solution =======//
Should we add a specific code in the script using the IAP ? Like a method UsedOnlyForAOTCodeGeneration() ? or using Namespace + [Preserve] ?
Is someone (or Oculus Team) know how to manage Unity export build in IL2CPP with Oculus IAP (Oculus.VR) ?
I can't find any documentation about this specific issue...
For information, the IAP request from Oculus.Platform.IAP Class (see below) is correctly coded :
IAP.LaunchCheckoutFlow(sku).OnComplete(LaunchCheckoutFlowCallback);
The purchase is not the problem at all (it is perfectly working when the build is exported in Mono).
The main issue is when we export in IL2CPP : then the Oculus IAP is not working anymore in the app.
Please can someone help ! T_T
If an expert know a solution to let Unity keep Oculus IAP when exporting in IL2CPP (not stripped), you will save the lives of so many people ! B)
//======= Description =======//
When I export my app Build with Unity in "Mono" and purchase in-app (while playing in Oculus GO), my script using Oculus IAP (In-App Purchase) works perfectly fine.But when I export with IL2CPP instead of Mono, the Oculus IAP doesn't work anymore at all.
//======= Issue =======//
It is surely due to IL2CPP code Stripping (optimization) but even when I tried to link/add Oculus.VR Assemblies (in Unity Asset/ root folder) the link.xml file to keep IAP reflections code working in my script, Unity is still stripping IAP when exporting in the build in IL2CPP (IAP is not working in the app). To be clear, when I export the build in Mono, it is working perfeclty fine, so I don't understand what I'm missing with IL2CPP (stripping) with Oculus.VR ...
//======= Current Unity "link.xml" file (Oculus.VR Assemblies well added ?) =======//
<linker>
<assembly fullname="netstandard" preserve="all"/>
<assembly fullname="Assembly-CSharp">
<namespace fullname="Oculus.Platform" preserve="all" />
<type fullname="Oculus.Platform.IAP" preserve="all" />
<type fullname="Oculus.Platform.Core" preserve="all" />
<type fullname="Oculus.Platform.CAPI" preserve="all" />
<type fullname="Oculus.Platform.Request" preserve="all" />
<type fullname="Oculus.Platform.Message" preserve="all" />
<namespace fullname="Oculus.Platform.Models" preserve="all" />
<type fullname="Oculus.Platform.Models.Purchase" preserve="all" />
<type fullname="Oculus.Platform.Models.PurchaseList" preserve="all" />
<type fullname="Oculus.Platform.Models.Error" preserve="all" />
</assembly>
<!-- Oculus VR -->
<!-- Oculus VR -->
<assembly fullname="Oculus.VR" preserve="all" />
<assembly fullname="Oculus.VR.Editor" preserve="all" />
<assembly fullname="Oculus.VR.Scripts.Editor" preserve="all" />
<assembly fullname="ovrplatform_standalone" preserve="all" />
<!-- ======= -->
</linker>//======= Need a Hero who know the Solution =======//
Should we add a specific code in the script using the IAP ? Like a method UsedOnlyForAOTCodeGeneration() ? or using Namespace + [Preserve] ?
I can't find any documentation about this specific issue...
For information, the IAP request from Oculus.Platform.IAP Class (see below) is correctly coded :
IAP.LaunchCheckoutFlow(sku).OnComplete(LaunchCheckoutFlowCallback);
The purchase is not the problem at all (it is perfectly working when the build is exported in Mono).
The main issue is when we export in IL2CPP : then the Oculus IAP is not working anymore in the app.
Please can someone help ! T_T
Replies have been turned off for this discussion
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago