{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic-cloud-issues/issues/175","repository_url":"https://api.github.com/repos/driftyco/ionic-cloud-issues","labels_url":"https://api.github.com/repos/driftyco/ionic-cloud-issues/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic-cloud-issues/issues/175/comments","events_url":"https://api.github.com/repos/driftyco/ionic-cloud-issues/issues/175/events","html_url":"https://github.com/driftyco/ionic-cloud-issues/issues/175","id":175099819,"number":175,"title":"Ionic Insights: Could not send insights","user":{"login":"Yomag84","id":7047105,"avatar_url":"https://avatars.githubusercontent.com/u/7047105?v=3","gravatar_id":"","url":"https://api.github.com/users/Yomag84","html_url":"https://github.com/Yomag84","followers_url":"https://api.github.com/users/Yomag84/followers","following_url":"https://api.github.com/users/Yomag84/following{/other_user}","gists_url":"https://api.github.com/users/Yomag84/gists{/gist_id}","starred_url":"https://api.github.com/users/Yomag84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yomag84/subscriptions","organizations_url":"https://api.github.com/users/Yomag84/orgs","repos_url":"https://api.github.com/users/Yomag84/repos","events_url":"https://api.github.com/users/Yomag84/events{/privacy}","received_events_url":"https://api.github.com/users/Yomag84/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-05T16:09:44Z","updated_at":"2016-09-11T12:49:05Z","closed_at":null,"body":"Going through the steps outline here http://docs.ionic.io/services/push/ and http://docs.ionic.io/setup.html\r\n\r\n\r\n**Module**\r\n`app =angular.module('starter.controllers', ['ionic', 'ionic.cloud']);`\r\n\r\n**Controller**\r\n\r\n```\r\napp.controller('AppCtrl', function($scope,$ionicAuth, $ionicUser, $ionicPush){\r\ndocument.addEventListener('deviceready', function() {\r\n        $ionicPush.register();/*.then(function(t) {\r\n            console.log('Token saved:', t.token);\r\n                return $ionicPush.saveToken(t);\r\n        }).then(function(t) {\r\n                console.log('Token saved:', t.token);\r\n        });*/\r\n      });\r\n      \r\n      $scope.$on('cloud:push:register', function(event, data) {\r\n              var msg = data.message;\r\n              alert(msg.title + ': ' + msg.text);\r\n      });\r\n...\r\n})\r\n```\r\n\r\n**CODE**\r\n` app.config(function($ionicCloudProvider) {\r\n\r\n     document.addEventListener('deviceready', function() {\r\n\r\n     $ionicCloudProvider.init({\r\n        \"core\": {\r\n          \"app_id\": \"IONIC_APP_ID\"\r\n        },\r\n        \"push\": {\r\n          \"sender_id\": \"GCM_PROJ_NUM\",\r\n          \"pluginConfig\": {\r\n            \"ios\": {\r\n              \"badge\": true,\r\n              \"sound\": true\r\n            },\r\n            \"android\": {\r\n              \"iconColor\": \"#343434\"\r\n            }\r\n          }\r\n        }\r\n      });\r\n\r\n    });\r\n\r\n  })`\r\n\r\n\r\n**Response:**\r\n```\r\nPOST https://api.ionic.io/insights 422 (UNPROCESSABLE ENTITY) api.ionic.io/insights:1\r\nIonic Insights: Could not send insights. \r\nError {original: null, response: l, status: 422} (index):28\r\nOPTIONS https://api.ionic.io/insights  ionic.cloud.min.js:2\r\nIonic Insights: Could not send insights. Error {crossDomain: true, status: undefined, method: \"POST\", url: \"https://api.ionic.io/insights\"} (index):28\r\nOPTIONS https://api.ionic.io/insights  ionic.cloud.min.js:2\r\nIonic Insights: Could not send insights. Error {crossDomain: true, status: undefined, method: \"POST\", url: \"https://api.ionic.io/insights\"}\r\n```"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic-cloud-issues/issues/comments/246178577","html_url":"https://github.com/driftyco/ionic-cloud-issues/issues/175#issuecomment-246178577","issue_url":"https://api.github.com/repos/driftyco/ionic-cloud-issues/issues/175","id":246178577,"user":{"login":"Yomag84","id":7047105,"avatar_url":"https://avatars.githubusercontent.com/u/7047105?v=3","gravatar_id":"","url":"https://api.github.com/users/Yomag84","html_url":"https://github.com/Yomag84","followers_url":"https://api.github.com/users/Yomag84/followers","following_url":"https://api.github.com/users/Yomag84/following{/other_user}","gists_url":"https://api.github.com/users/Yomag84/gists{/gist_id}","starred_url":"https://api.github.com/users/Yomag84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yomag84/subscriptions","organizations_url":"https://api.github.com/users/Yomag84/orgs","repos_url":"https://api.github.com/users/Yomag84/repos","events_url":"https://api.github.com/users/Yomag84/events{/privacy}","received_events_url":"https://api.github.com/users/Yomag84/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T12:49:05Z","updated_at":"2016-09-11T12:49:05Z","body":"Thanks. its an oversight."}}
{"actor":{"display_login":"Yomag84"}}