Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "Push.appCollection" is empty #24

Closed
doubletaketech opened this issue Jan 10, 2015 · 40 comments
Closed

The "Push.appCollection" is empty #24

doubletaketech opened this issue Jan 10, 2015 · 40 comments

Comments

@doubletaketech
Copy link

What does this mean?

Push: Send message "test" via query {}
Push: Sent message "test" to 0 ios apps 0 android apps
Push, GUIDE: The "Push.appCollection" is empty - No clients have registred on the server yet...
Push: Send message "test" via query {}
Push: Sent message "test" to 0 ios apps 0 android apps
Push, GUIDE: The "Push.appCollection" is empty - No clients have registred on the server yet...
Push: Send message "test" via query {}
Push: Sent message "test" to 0 ios apps 0 android apps
Push, GUIDE: The "Push.appCollection" is empty - No clients have registred on the server yet...
@doubletaketech
Copy link
Author

I followed the instructions here
https://github.com/raix/push/blob/master/docs/BASIC.md
But I don't see anything about how to register a client.

How does a client get added to Push.appCollection?

Thanks,
Don

@doubletaketech
Copy link
Author

I resolved this issue. Meteor/Xcode assigns a wildcard BundleID when you use meteor run ios-device. I replaced this with my explicit bundleID and the notifications worked.

Just need to test it in my Modulus.io environment.

Thanks raix. Love handling push entirely in Meteor. Very nice!

@raix
Copy link
Collaborator

raix commented Jan 11, 2015

Super, does the docs need update

@doubletaketech
Copy link
Author

It would be good to do. But, I'm new to GitHub. How do I edit the page? I'd like to try.

Don

@sirpy
Copy link
Contributor

sirpy commented Jan 16, 2015

i think this requires explanation in the docs.
i'm getting the same message when trying to use notifications without any android/ios devices. (only chrome browser)

@lukemadera
Copy link

+1 - @raix updating the docs and/or adding an explicit function to call to register a device would be incredibly useful. This seems to be a common problem and is one I'm running in to - I currently can not get any push notifications because I apparently have no clients yet I have no idea how to add a client.

@ModrichBadr
Copy link

+1 please add this in doc

@raix raix mentioned this issue Mar 17, 2015
6 tasks
@raix
Copy link
Collaborator

raix commented Mar 17, 2015

@doubletaketech If you are up to it I'd take pr's - Currently the main README.md is used + /docs/*.md

@lukemadera I'm not sure if we need a manual way of adding clients - I would be much nicer if it just works.

I've added an issue for tracking documentation improvements at #44 :)

@lukemadera
Copy link

Thanks @raix - it started working for us so everything is good for us now; not sure what changed / why it wasn't working before.

@raix
Copy link
Collaborator

raix commented Mar 18, 2015

@lukemadera - super - it's often something with certificates/firewalls/setting the --mobile-server flag etc. It's a bit tricky still - Why I initially thought about writing a small book about it - but can't beat free docs - hopefully this package will help making things more unified and stable.

@dennisharrison
Copy link
Collaborator

@torayeff
Copy link

Hello, I am also receiving this error when testing with android device (emulator and real device). What can be the problem?

Push.appCollection.find().fetch() gives TypeError: Cannot read property 'find' of undefinedmessage: "Cannot read property 'find' of undefined"stack: (...)get stack: function () { [native code] }arguments: nullcaller: nulllength: 0name: ""prototype: StackTraceGetter__proto__: function Empty() {}<function scope>set stack: function () { [native code] }arguments: nullcaller: nulllength: 1name: ""prototype: StackTraceSetter__proto__: function Empty() {}<function scope>__proto__: ErrorVM412:2 (anonymous function)VM408:762 InjectedScript._evaluateOnVM408:695 InjectedScript._evaluateAndWrapVM408:609 InjectedScript.evaluate

@leechenghan
Copy link

So how do you add a client?

@torayeff
Copy link

torayeff commented Jun 6, 2015

@leechenghan

  1. Ensure that config.push.json is in application's root folder. I had the same kind of problem (I had placed config.push.json in /server, after moving it to root folder the problem has gone).
  2. If 1 does not solve your problem, try restarting network (disconnect from shared network and reconnect or restart computer :) ).

@timmakken
Copy link

timmakken commented May 4, 2016

So , ive read every post around on the web concerning this problem but i cannot seem to figure it out.
how do i make sure that clients get added to push.appCollection?

Ive tried everything i could find.

Added

Push.debug = true;

Push.allow({
    send: function(userId, notification) {
        return true; // Allow all users to send
    }
});

to the server and then added

Push.addListener('token', function(token) {
    alert(JSON.stringify(token));
}); 

to the client ( but never shows for some reason ).

ran locally with meteor run android-device --mobile-server 192.168.1.12:3000 and even tried it on the production version of my app.

config.push.json is located in the root dir of the app. can someone point out what im missing here?
Im running ubuntu and trying it on my android device so no Xcode project ids or any of that stuff.

Im struggeling with this problem for a few days now and im getting desperate here

@chrise86
Copy link

Did you manage to resolve your issue @timmakken ? I'm also struggling with this :(

@timmakken
Copy link

timmakken commented May 12, 2016

@chrise86 yes , turns out that you are missing the cordova packages itself. Go checkout the example app and check the cordova packages file. You will need those in order to fix it.

@chrise86
Copy link

Thanks @timmakken I found another issue that pointed this out, so added the following which fixed for me:

'cordova-plugin-device': '1.1.1',

@ethanteague
Copy link

This did not work for me.

@sahanDissanayake
Copy link

sahanDissanayake commented May 24, 2016

@ethanteague
try the following, might work
inside the .meteor/cordova-plugins file paste the following

@ethanteague
Copy link

Ty, @sahanDissanayake - I found another solution that got this working for me. I installed meteorhacks, and then node-apn. After doing so, push for ios worked. @raix, seems like a lot of people have been having a tough time getting push notifications to work (especially for ios), and the solutions they are finding don't seem to have one particular fix. I'm guessing there is a dependency missing somewhere in the fray that is getting added via an additional package while users are trying various solutions to fix. It would probably be worthwhile to investigate this further.

@sahanDissanayake
Copy link

yeah man. well done you got it somehow.. I had to play around for atleast 14 hours all up..

But super happy that its working now

@raix
Copy link
Collaborator

raix commented May 25, 2016

Theres a 3.0.3-rc.4 out - if you want to give it a spin

@beepy
Copy link

beepy commented May 26, 2016

@raix, I'm having the same trouble (no errors, but when I try a test push I only see Push, GUIDE: The "Push.appCollection" is empty - No clients have registred on the server yet...).

When trying to use 3.0.3-rc.4, the build fails and I get this:

Push: "config.push.json" is deprecating - use the Push.Configure api instead
Push: "config.push.json" is deprecating - use the Push.Configure api instead
Push: "config.push.json" is deprecating - use the Push.Configure api instead
=> Errors executing Cordova commands:                                              

   While adding plugin [email protected] to Cordova project:              
   Cordova error: Variable(s) missing (use: --variable SENDER_ID=value).           
   (If the error message contains suggestions for a fix, note that this may not apply to the Meteor
   integration. You can try running again with the --verbose option to help diagnose the issue.)

@raix
Copy link
Collaborator

raix commented May 26, 2016

In the deprecate json config branch theres updated readme about config

@beepy
Copy link

beepy commented May 26, 2016

Thanks so much for the response! We were able to get 3.0.3-rc.5 to build but we had to add

App.configurePlugin('phonegap-plugin-push', {
    SENDER_ID: 12341234
});

to mobile-config.js. We have not yet experimented with the Android side of notifications.

To anyone else experiencing this, after getting this version to build, I was finally seeing the server attempting to send messages, e.g.

Push: Sent message "hello" to 1 ios apps 0 android apps
Got error code 8 for token 03d7…

My (new) problem turned out to be the provisioning profile. The extremely helpful micro walkthrough, states:

Still in xCode make your way over to Build Settings and select the view of ALL and scroll down to code signing and select the proper Provisioning Profile here (should be the same as your <bundle_id> from earlier):

And has a small screenshot of a relevant profile being selected, but doesn't actually talk about generating that profile specifically for your app. I was using an existing wildcard profile. After I created a new profile just for this app, selected it in Xcode, and rebuilt the app, I was able to send myself notifications per the walkthrough.

@creitz
Copy link
Contributor

creitz commented May 29, 2016

@beepy What is the SENDER_ID in your example?

@beepy
Copy link

beepy commented May 29, 2016

We used a dummy value, just as indicated, since we are not yet attempting Android notifications.

@creitz
Copy link
Contributor

creitz commented May 29, 2016

Ahh, I misread it. I thought you meant using that is what fixed not pushing notifications to iOS, which I'm currently struggling with.

@lytstephen
Copy link

lytstephen commented May 30, 2016

@sahanDissanayake your solution worked for me, thank you!

I had been struggling for a few days, then put it away for a couple weeks .... glad to have come back to this thread and found and working solution suggested!!

@ankibalyan
Copy link

@raix How will I register a client If I'm using Native IOS/Android, I'm not able to get notification from meteor server. Do I need to add some method to pass the token from my native client app to server to register the device?

@kaiyes
Copy link

kaiyes commented Jan 28, 2017

trying for couple of hours to get this up and running. For IOS, tried all most all the settings here. But still get the same 0 ios apps error. Finally seeing some people got success adding the cordova-plugin-device package I tried to add that. But got this error. I'm on [email protected]. The error says it needs cordova 6.4.0 but at the cordova meteor is using is 6.3.1 ?

screen shot 2017-01-28 at 14 56 00

@kaiyes
Copy link

kaiyes commented Jan 28, 2017

Updating to the latest meteor Build 1.4.2.3 takes this error away. however, I am yet to find any solution to this. Will update this as I go along.

@carpmike
Copy link

carpmike commented Feb 13, 2017

I ran into this issue as well. When I ran on my iPhone using meteor run ios-device --mobile-server https://your-url-here.example.com (substitute your server url) in the Xcode logs for the device I saw that Push wasn't registering successfully. I just had to enable push notifications in Xcode (under Capabilities) and then it worked.

FYI I followed these instructions to get things working for iOS.

@kaiyes
Copy link

kaiyes commented Feb 16, 2017

Been looking for this thread to say that I solved it just the next day after posting it. The package still works. But issue lies in first-time-mistakes of pem file generations . Yes @carpmike I looked at the same medium post to get it sorted

@raix
Copy link
Collaborator

raix commented Feb 16, 2017

@carpmike do we need to update the guides we have in this repo? or link to the article at medium

@kaiyes
Copy link

kaiyes commented Feb 17, 2017

@raix Well, there are some info that can be a bit more detailed. For example, it is said in the guide that raix push notification doesn't work in development and one has to deploy it somewhere first. While this is not the case at all, it works well in dev environment. There are other issues but I guess I will have to write up a whole new article to elaborate on all of them.

Also, they newest cordova can be added by upgrading to the newest beta release of meteor by meteor update --release 1.4.3-beta.3. phonegap-plugin-push packages latest version requires latest cordova version. Currently I am using a lower version of phonegap-plugin-push. But the latest version enables android badge I think. The discussion on updating cordova with meteor is here meteor/meteor#8155 (comment)

@carpmike
Copy link

@raix the medium article was helpful. It would probably be valuable to link to it, but it is only for iOS.

I do think you should update the iOS instructions to include turning push notifications on in Xcode before building the app.

@raix
Copy link
Collaborator

raix commented Feb 17, 2017

@carpmike thanks - I've added some notes in the documentation and created a link to the medium article.

@awgust-taylor
Copy link

Greetings @raix can you tell me why my build process is failing?
I don't know about the other guys who are having issues but "use strict"; fixed my testing on development.
But now I am trying to make a build and it keeps failing, I have been looking everywhere for an answer to no avail, do you have any idea why not working?
Thanks in advance

Errors prevented bundling:
While loading plugin configuration from package raix:push:
vm.js:24:10: Block-scoped declarations (let, const, function, class) not yet
supported outside strict mode
at Object.exports.createScript (vm.js:24:10)
at /tools/fs/files.js:1161:34
at Function.time (/tools/tool-env/profile.js:305:10)
at Object.files.runJavaScript (/tools/fs/files.js:1099:18)
at /tools/isobuild/bundler.js:1936:15
at Array.forEach (native)
at Function..each..forEach
...........

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests