j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.3k stars 535 forks source link

[Android] not able to assign applicationUsername #1194

Open MarcelSchuermann opened 3 years ago

MarcelSchuermann commented 3 years ago

system info

Android
Cordova 10.0.0
Device: Galaxy Tab A7 (also other devices) // Android 10
Plugin Version: 10.5.3

Expected behavior

When applying applicationUsername the validation server (fovea) should save the user name (in iOS it works).

Observed behavior

The username is not available in the server events after a store.order() was made.

Steps to reproduce

var user_username = storage.getItem("username"); store.applicationUsername = () => user_username; If I console log the user_username variable, the username exists. But in the server event it does not exist.

Edit: I have a product of type "store.PAID_SUBSCRIPTION"

j3k0 commented 3 years ago

First, I recommend you change your code like so:

store.applicationUsername = () => storage.getItem("username")

This way, storage.getItem("username") is evaluated at the moment it's required (not at app startup), which is handy if the user logs in and out in the app for example.

Can you share some logs?

If you're using Fovea's service, best to send the details by email (and your app name), address here: https://billing.fovea.cc/contact-us/

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.