How do i add 'no ads' in-app purchase ?

I’m tired of getting 1 star reviews asking me to ‘remove ads’
I want to ad ‘no ads’ in app purchase.
Is there any good step by step guide ?
I found this

But IAP Buttons are no longer supported ?
I found scripted solution

But i keep getting ‘To add in-app products, you need to add the BILLING permission to your APK’ error in play console… what should i do ? Can i use IAP Button ?

@astanid Please check out this Sample IAP Project v2, it actually has a “no ads” product and the code is already written for you! Don’t use Codeless, use Scripted IAP, it’s easier Sample IAP Project

1 Like

Thank you. I used this code. Unity IAP - Unity Learn
Looks like it’s working (what is the best way to test it ?). I’ve uploaded it to internal testing and i get google play credit card window - but my game hss album orientation. When pay window pops out - game is rotated to portrait view. How can i avoid that ?

The purchase pop up is a system dialog so we have no control over that part. But you should be able to set your orientation to landscape in your code. This might help:

https://docs.unity3d.com/ScriptReference/Screen-orientation.html

Here how it looks. Screen is forced to be portrait. Is it possible to rotate back (and rotate system dialog) ?

7595878--942265--Clipboard06.jpg

I had provided the method to set screen orientation, were you able to use it? Please share your code. We have no control over the system dialog.

This is the code. Nope sadly, i can’t understand how to modify this code to rotate the screen back again
It’s pretty hard to test (i need to build apk and upload it into internal testing to see that system dialog)

7597870–942646–Purchaser.cs (12.3 KB)

Sorry, I don’t see the code where you are setting the orientation of your game, I had provided the documentation previously. I would recommend that you check in the Scripting forum for further information. I’m not familiar with the process personally, I suspect it would be set very early in your game, outside of any purchasing code. But as mentioned, the purchase pop up is from Google, and will be in Portrait mode. But you can switch your game from Portrait to Landscape before/after the after the popup if you need, with the screen orientation method mentioned.