Unity Wave SDK IAP

SOLVED
Highlighted
Taoma
Regular

Unity Wave SDK IAP

Hi,

 

I am porting existing app to Vive Focus using WaveSDK for Unity. I Am at the phase where I need to implement IAP (In-app purchases)

and I was wondering whether I should use Viveport SKD for it?

 

I already tried using it but I receive errors: Exception: JNI: Init'd AndroidJavaClass with null ptr! 

 

These lines are causing it:

 

Viveport.IAPurchase.IsReady(listener, "VIVEPORT_API_KEY");
Viveport.Api.Init(InitStatusHandler, "VIVEPORT_ID");

 

Any suggestions?

 

Vive Staff

Re: Unity Wave SDK IAP

Hi @Taoma
Please change the calling sequence as following:
1. Viveport.Api.Init(InitStatusHandler, "VIVEPORT_ID");
2.Viveport.IAPurchase.IsReady(listener, "VIVEPORT_API_KEY");
"Init" should be done first, then on "IInitStatusHandler" success call "IsReady"

 

Thank you

 

Cory.C

Taoma1
Visitor
Solution

Re: Unity Wave SDK IAP

@CoryCheng
Hi and thanks for suggestion. I already initialized DRM first and IAP second. The thing that worked for me was to add the following permission to AndroidManifest.xml: 

<uses-permission android:name="com.viveport.CHECK_LICENSE" />

Documentation: https://developer.viveport.com/documents/sdk/en/api_drm.html?highlight=drm#drm-for-android