jstockwin / Film-Night

0 stars 0 forks source link

Push API support? #21

Closed unpairedbracket closed 8 years ago

unpairedbracket commented 8 years ago

Support for the w3c Push API could be cool for notifying us of roll-call/start of voting/results availability. Currently has basic support in Chrome 42 and more complete support in Firefox 44 https://developer.mozilla.org/en/docs/Web/API/Push_API

unpairedbracket commented 8 years ago

I've got the first bit of work done on this. It's in the webpush branch at bdf467ff4e331b29b3e63b264dea6f3c0091390d - if someone else wants to do any testing that'd be great. Currently works on FF and should work on Chrome when the manifest has our project ID and we get a GCM key. I've used a php var for the GCM API key that @Tom-Johnston'll need to get from Google so we can store it in an above-root php file like the db details if need be - should we be doing that with the client id as well, or is it fine as it is?

Tom-Johnston commented 8 years ago

I have an API key.

jstockwin commented 8 years ago

I would suggest making it a variable in database.php.

I'll add it to the one on the pis tomorrow.

On Mon, 8 Feb 2016, 22:44 Tom Johnston notifications@github.com wrote:

I have an API key.

— Reply to this email directly or view it on GitHub https://github.com/jstockwin/Film-Night/issues/21#issuecomment-181604689 .

jstockwin commented 8 years ago

@unpairedbracket API keys etc are now in database.php, and so provided this is included will be available to you on the pis.

$push_api is the API key $push_id is the project ID $push_number is the project number.

I'll also private message you with these so you can use them in your local dev environment.

unpairedbracket commented 8 years ago

I seem to still be having issues with registering to receive pushes in Chrome... Maybe it's taking a while to enable GCM? I think the thing I saw had GCM for Chrome and GCM for Android APIs available, and we actually want the for android one - I probably should have mentioned that...

selection_132 ^that one

Tom-Johnston commented 8 years ago

An Android API key is for sending the requests from an app. It requires a package name and the apps SHA-1 signing fingerprint.

There are my options image

unpairedbracket commented 8 years ago

Oh, I guess they've updated that to make it less confusing. Web server then, I guess...

Tom-Johnston commented 8 years ago

That's what you should have.

Tom-Johnston commented 8 years ago

We have a zero quota? image

unpairedbracket commented 8 years ago

I think I might have figured out the issue

unpairedbracket commented 8 years ago

Should the project-id be pluralised?

Tom-Johnston commented 8 years ago

No.

unpairedbracket commented 8 years ago

That's strange, because it works if it is, and not if it's not...

unpairedbracket commented 8 years ago

Now works on Chrome and Firefox.