{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1185","repository_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1185/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1185/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1185/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/1185","id":174139902,"number":1185,"title":"PushNotification undefined (line 6225)","user":{"login":"benlooi","id":7150683,"avatar_url":"https://avatars.githubusercontent.com/u/7150683?v=3","gravatar_id":"","url":"https://api.github.com/users/benlooi","html_url":"https://github.com/benlooi","followers_url":"https://api.github.com/users/benlooi/followers","following_url":"https://api.github.com/users/benlooi/following{/other_user}","gists_url":"https://api.github.com/users/benlooi/gists{/gist_id}","starred_url":"https://api.github.com/users/benlooi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlooi/subscriptions","organizations_url":"https://api.github.com/users/benlooi/orgs","repos_url":"https://api.github.com/users/benlooi/repos","events_url":"https://api.github.com/users/benlooi/events{/privacy}","received_events_url":"https://api.github.com/users/benlooi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-30T22:17:55Z","updated_at":"2016-08-30T23:15:05Z","closed_at":null,"body":"### Expected Behaviour\r\nI am having problems with the plugin as it throws a white screen of death on my emulator when I inlcude PushNotification in my app. An error was reported that PushNotification is undefined on line 6225.\r\n### Actual Behaviour\r\nHere is line 6225 generated from my Android project folder ( I am using Ionic)\r\n\r\nangular.module('ngCordova.plugins.push_v5', [])\r\n  .factory('$cordovaPushV5',['$q', '$rootScope', '$timeout', function ($q, $rootScope, $timeout) {\r\n   /*global PushNotification*/\r\n\r\n    var push;\r\n    return {\r\n      initialize : function (options) {\r\n        var q = $q.defer();\r\n    //line 6225 //\r\n        push = PushNotification.init(options);\r\n        q.resolve(push);\r\n        return q.promise;\r\n      },\r\n\r\nSo I tried to change it following the previous old PushNotification with $windows.plugins.PushNotification but when I do cordova emulate android, it overwrites this can puts back push=PushNotification.init, which obviously is not declared as a dependency.\r\n### Reproduce Scenario (including but not limited to)\r\n\r\n#### Steps to Reproduce \r\n\r\n#### Platform and Version (eg. Android 5.0 or iOS 9.2.1)\r\n\r\n#### (Android) What device vendor (e.g. Samsung, HTC, Sony...)\r\n\r\n#### Cordova CLI version and cordova platform version\r\n\r\n    cordova --version     6.3.1                               # e.g. 6.0.0\r\n    cordova platform version android       5.2.2             # e.g. 4.1.1\r\n\r\n#### Plugin version\r\nPlugin version 1.8.1\r\n    cordova plugin version | grep phonegap-plugin-push   # e.g. 1.5.3\r\n\r\n#### Sample Push Data Payload\r\n\r\n#### Sample Code that illustrates the problem\r\n\r\n#### Logs taken while reproducing problem\r\n"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/comments/243611257","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/1185#issuecomment-243611257","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1185","id":243611257,"user":{"login":"benlooi","id":7150683,"avatar_url":"https://avatars.githubusercontent.com/u/7150683?v=3","gravatar_id":"","url":"https://api.github.com/users/benlooi","html_url":"https://github.com/benlooi","followers_url":"https://api.github.com/users/benlooi/followers","following_url":"https://api.github.com/users/benlooi/following{/other_user}","gists_url":"https://api.github.com/users/benlooi/gists{/gist_id}","starred_url":"https://api.github.com/users/benlooi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlooi/subscriptions","organizations_url":"https://api.github.com/users/benlooi/orgs","repos_url":"https://api.github.com/users/benlooi/repos","events_url":"https://api.github.com/users/benlooi/events{/privacy}","received_events_url":"https://api.github.com/users/benlooi/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T23:15:05Z","updated_at":"2016-08-30T23:15:05Z","body":"Update: further reading and understanding of problem is that PushNotification is supposed to have been defined in push.js.\r\nSo for some reason maybe push.js is not loaded."}}
{"actor":{"display_login":"benlooi"}}