Error: Can't resolve all parameters for Push in node_modules/@ionic/cloud/dist/es5/push/push.d.ts: (?, ?)

Hi
I wand use Push plugin for send push notification in my app
but my code get this error
Error: Can’t resolve all parameters for Push in /node_modules/@ionic/cloud/dist/es5/push/push.d.ts: (?, ?).

my app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { HttpModule } from '@angular/http';
import { Sim } from '@ionic-native/sim';
import { IonicStorageModule } from '@ionic/storage';
import { MyApp } from './app.component';
import { SafePipe } from './pipe.component';
import { HomePage } from '../pages/home/home';
import { WebviewPage } from '../pages/webview/webview';
import { SMS } from '@ionic-native/sms';
import {  Push,  PushToken} from '@ionic/cloud-angular';
import { CloudSettings, CloudModule } from '@ionic/cloud-angular';
 const cloudSettings: CloudSettings ;
 cloudSetting= {
  'core': {
    'app_id': 'xxxxxxxxxxxxx',
  },
  'push': {
    'sender_id': 'xxxxxxxx',
    'pluginConfig': {
      'ios': {
        'badge': true,
        'sound': true
      },
      'android': {
        'iconColor': '#343434'
      }
    }
  }
};
@NgModule({
  declarations: [
    MyApp,
    HomePage,
    WebviewPage,
    SafePipe
  ],
  imports: [
    BrowserModule,
        HttpModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot(),
    CloudModule.forRoot(cloudSettings)
  ],
bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage
      ],
  providers: [
    StatusBar,
    SplashScreen,
    Sim,
    SMS,
    Push,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

my app.component.ts

import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import {  Push,  PushToken} from '@ionic/cloud-angular';

import { HomePage } from '../pages/home/home';
@Component({
  templateUrl: 'app.html',
    providers: [Push]
})
export class MyApp {
  rootPage:any = HomePage;

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,public push:Push) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();

      
  });
    this.push.register().then((t: PushToken) => {
    return this.push.saveToken(t);
    }).then((t: PushToken) => {
    console.log('Token saved:', t.token);
    });

       this.push.rx.notification()
       .subscribe((msg) => {
       alert(msg.title + ': ' + msg.text);
      });
}
}

and my package.json

{
    "name": "mysms",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "build:www": "rm -rf www && ionic-app-scripts build --prod",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.1.2",
        "@angular/compiler": "4.1.2",
        "@angular/compiler-cli": "4.1.2",
        "@angular/core": "4.1.2",
        "@angular/forms": "4.1.2",
        "@angular/http": "4.1.2",
        "@angular/platform-browser": "4.1.2",
        "@angular/platform-browser-dynamic": "4.1.2",
        "@ionic-native/core": "3.10.2",
        "@ionic-native/sim": "^3.12.1",
        "@ionic-native/sms": "^3.12.1",
        "@ionic-native/splash-screen": "3.10.2",
        "@ionic-native/status-bar": "3.10.2",
        "@ionic/cloud-angular": "^0.12.0",
        "@ionic/storage": "^2.0.1",
        "cordova-android": "^5.1.1",
        "cordova-plugin-console": "^1.0.5",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-sim": "^1.3.3",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.2",
        "cordova-plugin-whitelist": "^1.3.1",
        "cordova-sms-plugin": "^0.1.11",
        "ionic-angular": "3.3.0",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "rxjs": "5.1.1",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.11"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.3.7",
        "@ionic/cli-plugin-cordova": "1.3.0",
        "@ionic/cli-plugin-ionic-angular": "1.3.0",
        "typescript": "2.3.3"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-sim": {},
            "cordova-sms-plugin": {}
        },
        "platforms": [
            "android"
        ]
    }
}

my ionic version 3.3.0

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

Also post your ionic info output and package.json content please.

Hi i fixed this format :grin:

1 Like

I think you don’t need [quote=“alimahmoodvand, post:1, topic:95048”]
import { Push, PushToken} from ‘@ionic/cloud-angular’;
[/quote] in the app.module, only app.component.

How you fixed it?? could you please tell me. the same problem i am facing on…

I use onesignal . this is very better then push notification