question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to send push for Android with Meteor 1.3.2.4

See original GitHub issue

Hi,

Sorry I left this as a comment on Issue #153 but this morning it occurs to me that in light of the different error situation, I should probably have created a separate issue. So I’m doing that here. Here was my comment:

Glad I found this thread as it seems to get me closer.

After running ‘meteor add cordova:cordova-plugin-device@1.1.1’, I get

I20160511-00:28:02.938(-7) (android:http://localhost:12488/706a87c28afe2f2833e09f1faae76451d1e9bdb6.js:179) Push.Token: I20160511-00:28:02.943(-7) (android:http://localhost:12488/706a87c28afe2f2833e09f1faae76451d1e9bdb6.js:223) Token: {"gcm":"APA91bECNHQBuGl1W0DdANTBcX3bafsxwABndUhKCl3KZGT0xWpoLOjL95GjdgkUGxPR-k9J7kFdncH3V7InSaIEOB6X6BQrJrQssM8ev5jTn7nSqidjazVMxJqvZfm033PaWO8b0LEl"} I20160511-00:28:02.944(-7) (android:http://localhost:12488/706a87c28afe2f2833e09f1faae76451d1e9bdb6.js:179) Got token: I20160511-00:28:16.770(-7) (android:http://localhost:12488/706a87c28afe2f2833e09f1faae76451d1e9bdb6.js:223) sending notification I20160511-00:28:18.696(-7) (android:http://localhost:12488/706a87c28afe2f2833e09f1faae76451d1e9bdb6.js:179) Push.Notification: I20160511-00:28:18.697(-7) (android:http://localhost:12488/706a87c28afe2f2833e09f1faae76451d1e9bdb6.js:179) Push.Message: Got message while app is open:

Now, I am still using some Meteor.startup() code from when I first successfully used raix:push, last July(!). I have this code from back then still:

`Meteor.startup(function () { console.log(‘inside notifications.js’); Push.allow({ send: function(userId, notification) { // Allow all users to send to everybody - For test only! return true; } });

Push.debug = true;

/* do something with push token*/ Push.addListener(‘token’, function(token) { console.log('Token: ’ + JSON.stringify(token)); });

Push.addListener(‘notification’, function(notification) { console.log('notification: ’ + JSON.stringify(notification)) });

Push.addListener(‘startup’, function(notification) { console.log('Routing Push: ’ + JSON.stringify(notification)); Router.go(‘warbleShow’, {_id: notification.payload.warbleId}); }); }); `

In light of the messages I mentioned in that first bit of output, I tried closing the application and sending the test notification from localhost:3000 (is that even supposed to work??), and I got:

I20160511-00:30:40.853(-7)? Push: Send message "Hello" via query {} I20160511-00:30:40.855(-7)? Push: Sent message "Hello" to 0 ios apps 0 android apps I20160511-00:30:40.857(-7)? Push, GUIDE: The "Push.appCollection" is empty - No clients have registred on the server yet...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
MaxShvcommented, Jun 30, 2016

+1

I20160630-11:29:50.679(-4)? Push: Sent message “test” to 0 ios apps 1 android apps I20160630-11:29:50.784(-4)? Unauthorized I20160630-11:29:50.787(-4)? ANDROID: Result of sender is null

2reactions
crazybaudcommented, Sep 18, 2016

Our install :

  • With Meteor 1.3.4.1
  • meteor add raix:push@3.0.3-rc.5
  • We don’t use anymore config.push.json file.

Client side :

// Configure our notification
Push.Configure({
    "gcm": {
        "projectNumber": "[12 digits]"
    },
    "bagde": true,
    "sound": true,
    "alert": true,
    "vibrate": true
});

Server side :

// Configure our notification
Push.debug = true;
Push.Configure({
  "apn": {
    "passphrase": "[yours]",
    "keyData": Assets.getText('apnDevKey.pem'),
    "certData": Assets.getText('apnDevCert.pem')
  },
  "gcm": {
    "apiKey": "[yours]",
    "projectNumber": "[same digits]"
  },
  "production": true
});

mobile-config.js :

App.configurePlugin('phonegap-plugin-push', {
    SENDER_ID: '[same digits]'
});

hope it helps 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Push notifications for Android - help - Meteor forums
With active debugging I see in my console that everything is fine, the notification is sent and received by the Android device, you...
Read more >
[Done]-Crosswalk error in my meteor app "XWalkAutofillClient
I have added cordova:cordova-plugin-crosswalk-webview 1.6.1 in my 1.3.2.4 meteor project. When i run my app in my android device, i have this error...
Read more >
Unanswered 'meteor' Questions - Page 36 - Stack Overflow
Hello I use meteor to transfer a react app. I need in a JSX file (/imports/test.jsx), to import a file cast.svg. But I...
Read more >
Source - GitHub
Meteor 1.3.2.4 contains no additional changes beyond the changes in 1.3.2.3. ... Fix `Error: Can't render headers after they are sent to the...
Read more >
export docker_buildkit=0 export compose_docker_cli_build=0
Error: Unable to build a docker hub image to push to AWS ... unable to prepare context: unable to evaluate symlinks in Dockerfile...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found