j3k0 / cordova-plugin-purchase

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

[iOS] Capacitor React project failed to install plugin #1268

Open sima94 opened 2 years ago

sima94 commented 2 years ago

Is it possible to use this plugin with Capacitor React project?

I'm getting error when I try to add plugin to my project:

[log] - About to initializeIonicApp ⚡️ [warn] - Native: tried calling InAppPurchase2.DEBUG, but the InAppPurchase2 plugin is not installed. ⚡️ [warn] - Install the InAppPurchase2 plugin: 'ionic cordova plugin add cordova-plugin-purchase' ⚡️ [warn] - Native: tried calling InAppPurchase2.verbosity, but the InAppPurchase2 plugin is not installed. ⚡️ [warn] - Install the InAppPurchase2 plugin: 'ionic cordova plugin add cordova-plugin-purchase' ⚡️ [warn] - Native: tried calling InAppPurchase2.NON_CONSUMABLE, but the InAppPurchase2 plugin is not installed. ⚡️ [warn] - Install the InAppPurchase2 plugin: 'ionic cordova plugin add cordova-plugin-purchase' ⚡️ [warn] - Native: tried calling InAppPurchase2.register, but the InAppPurchase2 plugin is not installed. ⚡️ [warn] - Install the InAppPurchase2 plugin: 'ionic cordova plugin add cordova-plugin-purchase' ⚡️ [warn] - Native: tried calling InAppPurchase2.when, but the InAppPurchase2 plugin is not installed. ⚡️ [warn] - Install the InAppPurchase2 plugin: 'ionic cordova plugin add cordova-plugin-purchase' ⚡️ [error] - Could not initialize in-app purchase ug.when("ticket_99c").updated is not a function. (In 'ug.when("ticket_99c").updated((function(A){A.owned?console.log("Product owned"):console.log("Product not owned")}))', 'ug.when("ticket_99c").updated' is undefined)

[ERROR] Ionic doesn't support using Cordova with @ionic/react projects.

    We encourage you to try ⚡️ Capacitor ⚡️ (https://ion.link/capacitor)

    If you want to add Cordova plugins to your Capacitor project, see these docs[1].

    [1]: https://capacitor.ionicframework.com/docs/cordova/using-cordova-plugins
j3k0 commented 2 years ago

No much experience in this, but I know some people use the plugin with Capacitor. Did you find a solution yet?

arindoneATK commented 2 years ago

I have this same issue, it almost seems like a race condition though

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.

simbrams commented 1 year ago

I am having the same issue, did you find a fix for this ? @sima94