Im trying to add push notification to my ionic2 application. Searching on google i found this article:
-
I installed the plugin:
cordova plugin add phonegap-plugin-push --variable SENDER_ID={SENDER_ID} --save
-
Edit my app.component.ts adding:
import { Push, PushObject, PushOptions } from "@ionic-native/push";
- But when i call into my constructor:
constructor(public platform:Platform, public push:Push)
- Typescript returns:
Cannot find name ‘Push’
- And if i add the initPushNotification method with the same code that the article, example:
const options: PushOptions = {
android: {
senderID: "SENDER_ID"
},
ios: {
alert: "true",
badge: false,
sound: "true"
},
windows: {}
};
- Typescript returns:
Cannot find name ‘PushOptions’
It’s like typescript not recognize my import:
import { Push, PushObject, PushOptions } from "@ionic-native/push";
Any idea why? Most comments in the article said that works fine!
Thanks!