j3k0 / cordova-plugin-purchase

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

Improve typings for getPurchases #1448

Closed Luro91 closed 9 months ago

Luro91 commented 10 months ago

Changes proposed in this pull request:


To test this pull request with cordova:

# 1: Uninstall the plugin (if already installed)
cordova plugin rm cordova-plugin-purchase

# 2: Install from github
cordova plugin add "https://github.com/platogo/cordova-plugin-purchase#google-getPurchases-typings"

Create the Android bridge and call the function:

const androidBridge = new CdvPurchase.GooglePlay.Bridge.Bridge()

// call androidBridge.buy

androidBridge.getPurchases((products) => {
      console.log('getPurchases', products)
    }, () => console.log('error'))
Luro91 commented 8 months ago

@j3k0 why did you undo the change in the release again? https://github.com/j3k0/cordova-plugin-purchase/commit/5ee54a1597d0c6d5fca5ccec0857e0282f866bdd#diff-aceb75e036b3925aba8a1ee3ff4124378a3fbc02db94b0c06dcab828e90eaf8cL4262

j3k0 commented 8 months ago

I didn't realize you made the changes to store.d.ts, it is a file generated by compiling the typescript files. Please resubmit the PR by changing only files in the src/ folder.