phonegapbuildpushproject2's Introduction
This file was created by JetBrains PhpStorm 4.0.3 for binding GitHub repository
phonegapbuildpushproject2's People
Forkers
jbhalloran grandejenso vigoncas nisal ricardotominaga taemen01 shayla513 djibythiaw paolo975 xmalmorthen kanneganti mwvasco jeroenek manzullo raxityo eitankw teodora92 appdevteam2013 nahids svendazjer danielo83 nicolasar shenjinny breakfastcerealkillr tanguy972 s4sagar goatus galshay coldhell7 bharathi7 sajeeshe web1o1 sesengene amrutheshc rezashnia1234 kataliltd tiwel dreamweiver redenovotempo jival aimar-amin avijitcse mukeshnayal wasura4 wade1990phonegapbuildpushproject2's Issues
Push Notification : ecb function executes for first time only.
Hi,
I am trying to develop android app using PhoneGap and AngularJS. Push notifications are working good but the only problem is that the ecb function executes for the first time of the compilation. I have alert text inside ecb function. I got the push notifications on notification bar but on clicking them doesn't call ecb funciton, only app starts.
After i restart the app, although app is running , i got the notification in notification bar and ecb function is not working.
Please help me..
I have posted my sample code related to GCM: Push notification
.factory('GCM', ["$window", "$rootScope", function ($window, $rootScope){
function registerGCM(){
var pushNotification;
pushNotification = window.plugins.pushNotification;
pushNotification.register(
successHandler,
errorHandler, {
"senderID":"676655225205",
"ecb":"onNotificationGCM"
});
}
function successHandler(result){
//alert('result = ' + result);
}
function errorHandler(error){
alert(error);
}
$window.onNotificationGCM = function (e){
switch(e.event){
case 'registered':
if ( e.regid.length > 0 )
{
$rootScope.$broadcast('reg_key', e.regid);
}
break;
case 'message':
alert('ecb function is called');
break;
case 'error':
alert('GCM error = '+e.msg);
break;
default:
alert('An unknown GCM event has occurred');
break;
}
return true;
}
return{
register: function(){
return registerGCM();
}
};
}]);
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.