Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49237

InAppPurchase2 seems useless without docs. Having issue with simple initialization

$
0
0

@snstarosciak wrote:

Hey everyone,

I’m trying to integrate the InAppPurchase2 plugin in my Ionic app and am having an awful time trying to do so. The docs are super incomplete and pretty much not useful at all and from the tidbits I’ve found on the forums, I still can’t get anything to work.

All I’m trying to do right now is see if the plugin will load in one of my components like this:

constructor(
    public navCtrl: NavController,
    public storage: Storage,
    public http: Http,
    public inAppPurchase2: InAppPurchase2,
    public platform: Platform,
    public viewCtrl: ViewController
  ) {
    platform.ready().then(() => {
      if(platform.is('ios')) {
        this.storeName = 'iTunes';
      } else if(platform.is('android')) {
        this.storeName = "Google Play";
      }

      this.inAppPurchase2.ready(() => {
        this.product = JSON.stringify('it worked');

      })
    });
  }

However, when I try to build my Android app, I get an error in my console:

[11:28:56]  typescript: src/pages/payment-subscription/payment-subscription.ts, line: 38
            Supplied parameters do not match any signature of call target.

      L38:   this.inAppPurchase2.ready(() => {
      L39:     this.product = JSON.stringify('it worked');

[11:28:56]  transpile failed

What am I doing wrong here? Should I just use InAppPurchase since the docs are more complete? You’d think this would be a common feature that people are adding to their Ionic apps.

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 49237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>