Meteor-Community-Packages / raix-push

DEPRECATED: Push notifications for cordova (ios, android) browser (Chrome, Safari, Firefox)
https://atmospherejs.com/raix/push
MIT License
514 stars 197 forks source link

FCM - Device didn't receive the notifications #283

Closed buidanhquy closed 7 years ago

buidanhquy commented 7 years ago

//CLIENT

Push.Configure({
    android: {
        senderID: 868568106378,
        alert: true,
        badge: true,
        sound: true,
        vibrate: true,
        clearNotifications: true
  }
});

//SERVER

Push.Configure({
    gcm: {
        apiKey: 'AAAAyjqxhYo:APA91bH3Yj93jgVg51Vkww5e_jRCt9wq19Rvq-kD6k6hCKIw2EyXEl4zlfc9KG6GeLAGkg5dzpooruwmET3YevS3MODi1LKAV3SUvVwd6XwLSvmI_in3kHfaAiw57rMLf1cq2xaUh43H',
        projectNumber: 868568106378
    }
});
Meteor.methods({
    serverNotification: function() {
        Push.send({
            from: 'push',
            title: 'Hello',
            text: 'World',
            badge: 12,
            query: {}
        });
    }
});

Meteor list

autopublish                                            1.0.7  (For prototyping only) Publish the entire database to all...
blaze-html-templates                                   1.0.5* Compile HTML templates into reactive UI with Meteor Blaze
cordova:cordova-plugin-device                          1.1.3
cordova:de.appplant.cordova.plugin.local-notification  0.8.4
cordova:org.apache.cordova.dialogs                     1.2.1
cordova:org.apache.cordova.vibration                   2.1.1
cordova:phonegap-plugin-push                           1.5.2
ecmascript                                             0.6.1* Compiler plugin that supports ES2015+ in all .js files
es5-shim                                               4.6.15  Shims and polyfills to improve ECMAScript 5 support
http                                                   1.1.8* Make HTTP calls to remote servers
insecure                                               1.0.7  (For prototyping only) Allow all database writes from the...
jquery                                                 1.11.10  Manipulate the DOM using CSS selectors
meteor-base                                            1.0.4  Packages that every Meteor app needs
mobile-experience                                      1.0.4  Packages for a great mobile user experience
mongo                                                  1.1.14* Adaptor for using MongoDB and Minimongo over DDP
raix:push                                              3.0.2  Isomorphic Push notifications for APN and GCM
reactive-var                                           1.0.11  Reactive variable
shell-server                                           0.2.1* Server-side component of the `meteor shell` command.
standard-minifier-css                                  1.3.2* Standard css minifier used with Meteor apps by default.
standard-minifier-js                                   1.2.1* Standard javascript minifiers used with Meteor apps by de...
tracker                                                1.1.1* Dependency tracker to allow reactive callbacks

//COMMAND meteor run android-device --mobile-server 192.168.2.50:3000

//CONSOLE OUTPUT

I20170214-10:22:53.726(7)? Push: Got push token from app: { id: 'FdYPSY84aHWWogKoJ',
I20170214-10:22:53.727(7)?   token: { gcm: 'e4QnQnhANZg:APA91bGTAZGudROhSjhhM23mnbusFASLjx-pPbkqD9O_28VLVX-v2SP7TaM0eERfT2KalXfSC9X9BSfp9ae5xUKMUaaWFWBQLfa9C0nxWBbdDmzP8hwupYiob6UWV2xNtIPuqIhZwIYF' },
I20170214-10:22:53.731(7)?   appName: 'main',
I20170214-10:22:53.732(7)?   userId: null,
I20170214-10:22:53.733(7)?   metadata: {} }
I20170214-10:22:53.760(7)? Push: updated { _id: 'FdYPSY84aHWWogKoJ',
I20170214-10:22:53.762(7)?   token: { gcm: 'e4QnQnhANZg:APA91bGTAZGudROhSjhhM23mnbusFASLjx-pPbkqD9O_28VLVX-v2SP7TaM0eERfT2KalXfSC9X9BSfp9ae5xUKMUaaWFWBQLfa9C0nxWBbdDmzP8hwupYiob6UWV2xNtIPuqIhZwIYF' },
I20170214-10:22:53.763(7)?   appName: 'main',
I20170214-10:22:53.767(7)?   userId: null,
I20170214-10:22:53.768(7)?   enabled: true,
I20170214-10:22:53.769(7)?   createdAt: Mon Feb 13 2017 14:41:37 GMT+0700 (ICT),
I20170214-10:22:53.770(7)?   updatedAt: Tue Feb 14 2017 10:10:36 GMT+0700 (ICT) }

I20170214-10:23:04.286(7)? Push: Send message "Hello" via query {}
I20170214-10:23:04.289(7)? send to token { gcm: 'e4QnQnhANZg:APA91bGTAZGudROhSjhhM23mnbusFASLjx-pPbkqD9O_28VLVX-v2SP7TaM0eERfT2KalXfSC9X9BSfp9ae5xUKMUaaWFWBQLfa9C0nxWBbdDmzP8hwupYiob6UWV2xNtIPuqIhZwIYF' }
I20170214-10:23:04.292(7)? sendGCM [ 'e4QnQnhANZg:APA91bGTAZGudROhSjhhM23mnbusFASLjx-pPbkqD9O_28VLVX-v2SP7TaM0eERfT2KalXfSC9X9BSfp9ae5xUKMUaaWFWBQLfa9C0nxWBbdDmzP8hwupYiob6UWV2xNtIPuqIhZwIYF' ] { _id: 'efojNPxteQs5gZWPN',
I20170214-10:23:04.293(7)?   createdAt: Tue Feb 14 2017 10:22:56 GMT+0700 (ICT),
I20170214-10:23:04.294(7)?   createdBy: '<SERVER>',
I20170214-10:23:04.295(7)?   from: 'push',
I20170214-10:23:04.296(7)?   title: 'Hello',
I20170214-10:23:04.296(7)?   text: 'World',
I20170214-10:23:04.300(7)?   badge: 12,
I20170214-10:23:04.301(7)?   gcm: {},
I20170214-10:23:04.302(7)?   query: {} }
I20170214-10:23:04.337(7)? Create GCM Sender using "AAAAyjqxhYo:APA91bH3Yj93jgVg51Vkww5e_jRCt9wq19Rvq-kD6k6hCKIw2EyXEl4zlfc9KG6GeLAGkg5dzpooruwmET3YevS3MODi1LKAV3SUvVwd6XwLSvmI_in3kHfaAiw57rMLf1cq2xaUh43H"
I20170214-10:23:04.338(7)? A:Send message to: e4QnQnhANZg:APA91bGTAZGudROhSjhhM23mnbusFASLjx-pPbkqD9O_28VLVX-v2SP7TaM0eERfT2KalXfSC9X9BSfp9ae5xUKMUaaWFWBQLfa9C0nxWBbdDmzP8hwupYiob6UWV2xNtIPuqIhZwIYF
I20170214-10:23:04.355(7)? Push: Sent message "Hello" to 0 ios apps 1 android apps
I20170214-10:23:04.361(7)? Push, GUIDE: The "Push.appCollection" - No APN clients have registred on the server yet...
I20170214-10:23:04.694(7)? ANDROID: Result of sender: {"multicast_id":9023125278960035000,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1487042585863072%6a5d720e0034af1a"}]}

Everything seems to work fine but my phone didn't receive any notifications. What am I doing wrong ? Please help.

buidanhquy commented 7 years ago

Sorry my bad. Just close app and everything is ok.

raix commented 7 years ago

@buidanhquy so it's working?

buidanhquy commented 7 years ago

Yes, working as expected.

paulailincai commented 7 years ago

Time to close this one?

rashmimhatre100 commented 5 years ago

Hey @buidanhquy are you also able to set badge on android? Thanks in advance.