IT/ionic
ionic push 사용할때 TypeError cannot call method 'on'of undefined 발생시
Everyharu
2016. 9. 15. 21:18
ionic push를 사용중에
try {
push.register(function(token) {
console.log("Device token:",token.token);
push.saveToken(token); // persist the token in the Ionic Platform
});
} catch(e) {
alert(e);
}
를 해 봤을 때
TypeError cannot call method 'on'of undefined
라는 에러메시지를 만날때가 있다.
gcm 번호가 빠져서 그렇다.
ionic config set gcm_key <your-gcm-project-number>
로 세팅해주자.