I am trying to get Ionic Push Notifications working in dev mode. I have the web-platform installed, got my GCM project number, done all the steps in the tutorial, added my code to $ionicPlatform.ready(function()
var push = new Ionic.Push({
"debug": true
});
push.register(function (token) {
console.log("Device token:", token.token);
});
But when it makes the push.register call I am getting an error saying 415 Unsupported Media Type
So I have now created a new project from scratch, made sure ionic and cordova were up to date. Followed the ionic push setup step by step…but I am still getting the 415 Unsupported Media Type error.
When I send a push notification from the ionic platform console it doesn’t come through on the app. I can see the activity on my GCM account but the app will not register and receive the notification.
415 (Unsupported Media Type) may be overcome by trying to configure CORS on the server (i.e. your app on Heroku) to whitelist your client domain, POST methods, and expose “Content-Type” and “Accept”, which are associated with media types.
Ionic Push (dev): error connecting development push service may be overcome by updating index.html and adding the following to the Content-Security-Policy meta tag connect-src self https://api.ionic.io/push/development https://api.ionic.io/push/tokens