Ionic native InAppPurchase is no where to be found?


#1

Hi there,

I’m currently trying to use InAppPurchase from Ionic native, but I keep getting hit with this error when I try to import from ionic native:

TypeScript error: /Users/petersenyszyn/Documents/ComplimentApp/app/pages/home/home.ts(4,46): Error TS2305: Module '"/Users/petersenyszyn/Documents/ComplimentApp/node_modules/ionic-native/dist/index"' has no exported member 'InAppPurchase'.

I had already installed it using ionic plugin add, so I’m really at loss as to what the issue could be. I did some digging around inside of of the directory node_modules/ionic-native/dist/plugins/ and InAppPurchases is not in there. I reinstalled and ionic beta twice, and nothing has fixed my problem.

If anyone has any idea what the issue is, I’d be grateful for any help.

Thanks


#2

Bump. Anyone have any idea?


#3

What version of ionic native is defined in your packages.json?


#4

Here is the entirety of my package.json:

{
  "dependencies": {
    "@angular/common": "2.0.0-rc.4",
    "@angular/compiler": "2.0.0-rc.4",
    "@angular/core": "2.0.0-rc.4",
    "@angular/platform-browser": "2.0.0-rc.4",
    "@angular/platform-browser-dynamic": "2.0.0-rc.4",
    "@angular/http": "2.0.0-rc.4",
    "@angular/forms": "0.2.0",
    "es6-shim": "^0.35.0",
    "ionic-angular": "2.0.0-beta.11",
    "ionic-native": "1.3.10",
    "ionicons": "3.0.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.6",
    "zone.js": "^0.6.12"
  },
  "devDependencies": {
    "del": "2.2.0",
    "gulp": "3.9.1",
    "gulp-watch": "4.3.5",
    "ionic-gulp-browserify-typescript": "2.0.0",
    "ionic-gulp-fonts-copy": "^1.0.0",
    "ionic-gulp-html-copy": "^1.0.0",
    "ionic-gulp-sass-build": "^1.0.0",
    "ionic-gulp-scripts-copy": "^2.0.0",
    "ionic-gulp-tslint": "^1.0.0",
    "tslint-ionic-rules": "^0.0.3",
    "run-sequence": "1.1.5"
  },
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [
    "ios",
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    }
  ],
  "name": "complimentapp",
  "description": "Smiler: An Ionic project"
}

#5

Change ionic-native": “1.3.10” to ionic-native": “^1.3.10” and run npm update in your project folder, and it should work:-) InAppPurchase was added in 1.3.18 IIRC.


#6

Perfect! Thanks a lot :slight_smile:


#7

Thanks a ton, solved my problem too.