I suddently started getting these erors with IONIC SERVE. Not sure what change I made which caused this. Btw, notice that it says “Insights.normalizeDevicePlatform and Insights.markActive”. I though the insights product is not released yet, why is that trying to do stuff ??? Is this a bug?
Actually, the problem had to be solved in a different way. Just make sure that you’re a not injecting any of the cloud plugins on your main component. Apparently, they request information from other cordova plugins such as Device plugin, and those infos are only available after the platform ready is triggered. So make sure you inject the plugins anywhere else but your main component and only after the platform ready is triggered.
In that way, the implementation above does not solve the issue and you can follow the instructions provided by the http://docs.ionic.io/services/ docs.
@rafaelfuentes, It removes error but then it gives error push.register() is not a function.
& i am using push notification. i need it in main component so i can process it for all screens.
First, put all your Push logic into a service. At the service constructor, only call push methods after the platform.ready() resolves and only if platform is cordova. ex;
Add the service to your “providers”, at app.module.
Then, inside of your “rootPage”, just inject the service at your constructor and you’re good to go.
That works perfectly for me, no errors unless I try to use the push methods without the cordova platform available.
The same also works for other cloud plugins I’ve used so far, including auth and hot deployment.
Hope that helps and sorry for the long delay on the answer.