Error building app with cordova-plugin-fcm in ionic 1 -
i building ionic app, push notification, have used cordova-plugin-fcm , other code in fcm.js
but after installing plugin cordova-plugin-fcm cant build android app anymore,
error coming in ionic build android command
could not resolve dependencies configuration ':_debugapkcopy'. not find com.google.firebase:firebase-core:11.2.0. required project not find com.google.firebase:firebase-messeging:11.2.0. required project
fcm.js
angular.module("home") .factory("fcm", function (apiservice, userdata, $state, $rootscope) { function initfcm() { if (typeof (fcmplugin) !== "undefined") { fcmplugin.gettoken(function (token) { apiservice.addfcmtoken({ tokenid: token, loginid: userdata.login.login_id, }).then(function () { service.receivepush(); }) }, function (error) { alert(error); }); fcmplugin.ontokenrefresh(function (token) { apiservice.addfcmtoken({ tokenid: token, loginid: userdata.login.login_id, }).then(function () { service.receivepush(); }) }); } else { //alert( 'admob plugin not ready' ); } } var service = { initfcm: initfcm, receivepush: function () { fcmplugin.onnotification(function (data) { if (data.wastapped === false || data.wastapped == undefined) { //notification received in foreground. maybe user needs notified. if (data.event == "1") $rootscope.$broadcast("new-post", data); if (data.event == "4") $rootscope.$broadcast("update-vote", data); if (data.event == "2") $rootscope.$broadcast("update-like", data); if (data.event == "3") $rootscope.$broadcast("update-comment", data); if (data.event == "5") $rootscope.$broadcast("comment-like", data); } else { //notification received on device tray , tapped user. $state.go("single-post", { companyid: data.company_id, postid: data.post_id }); } }); }, subscribe: function (topic) { fcmplugin.subscribetotopic(topic); }, unsubscribe: function (topic) { fcmplugin.unsubscribetotopic(topic); } } return service; }) ionic info output -
cordova cli: 6.5.0 ionic cli version: 2.2.3 ionic app lib version: 2.2.1 ios-deploy version: not installed ios-sim version: not installed os: windows 7 node version: v8.1.4 xcode version: not installed if remove cordova-plugin-fcm app working without error
Comments
Post a Comment