title: Type Error Object not a function when adding SMS plugin Ionic
body: <p>Trying to use the </p>
  
  <blockquote>
    <p>cordova-sms-plugin</p>
  </blockquote>
  
  <p>to add sms functionality in to the app.
  I have done the installation as mentioned in the docs ->
  <a href="https://ionicframework.com/docs/native/sms/" rel="nofollow noreferrer">https://ionicframework.com/docs/native/sms/</a></p>
  
  <p>I add the line</p>
  
  <pre><code>import { SMS } from '@ionic-native/sms';
  </code></pre>
  
  <p>But when I add</p>
  
  <pre><code>public sms: SMS
  </code></pre>
  
  <p>in to the constructor arguments it throws in the below error in the JS console and the page stops working.</p>
  
  <blockquote>
    <p>core.js:12501 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function
    TypeError: Object(...) is not a function
        at index.js:93
        at Module../node_modules/@ionic-native/sms/index.js (index.js:142)
        at <strong>webpack_require</strong> (bootstrap:83)
        at Module../src/app/pages/sendtext/sendtext.page.ts (pages-sendtext-sendtext-module.js:92)
        at <strong>webpack_require</strong> (bootstrap:83)
        at Module../src/app/pages/sendtext/sendtext.module.ts (pages-sendtext-sendtext-module.js:18)
        at <strong>webpack_require</strong> (bootstrap:83)
        at $_lazy_route_resource lazy namespace object:32
        at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
        at Object.onInvoke (core.js:14060)
        at resolvePromise (zone.js:814)
        at resolvePromise (zone.js:771)
        at zone.js:873
        at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
        at Object.onInvokeTask (core.js:14051)
        at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
        at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
        at drainMicroTaskQueue (zone.js:595)</p>
  </blockquote>
  
  <p>This is just a basic ionic installation with the only plugin added being the SMS plugin.
  Any help is appreciated.</p>
  
  <p>Below is my dependencies section in the package.json file.</p>
  
  <blockquote>
    <p>"dependencies": {
        "@angular/common": "~7.0.0",
        "@angular/core": "~7.0.0",
        "@angular/forms": "~7.0.0",
        "@angular/http": "~7.0.0",
        "@angular/platform-browser": "~7.0.0",
        "@angular/platform-browser-dynamic": "~7.0.0",
        "@angular/router": "~7.0.0",
        "@ionic-native/core": "5.0.0-beta.21",
        "@ionic-native/sms": "^4.18.0",
        "@ionic-native/splash-screen": "5.0.0-beta.21",
        "@ionic-native/status-bar": "5.0.0-beta.21",
        "@ionic/angular": "4.0.0-beta.16",
        "cordova-android": "7.1.4",
        "cordova-ios": "4.5.5",
        "cordova-plugin-device": "^2.0.2",
        "cordova-plugin-ionic-keyboard": "^2.1.3",
        "cordova-plugin-ionic-webview": "^2.2.5",
        "cordova-plugin-splashscreen": "^5.0.2",
        "cordova-plugin-statusbar": "^2.4.2",
        "cordova-plugin-whitelist": "^1.3.3",
        "cordova-sms-plugin": "0.1.13",
        "core-js": "^2.5.4",
        "rxjs": "~6.3.3",
        "zone.js": "~0.8.26"
      },</p>
  </blockquote>