oreporan / wePlayMin

WePlay - the social football managing app
0 stars 1 forks source link

Add android push notification #46

Open Yahavw opened 8 years ago

Yahavw commented 8 years ago

Google Cloud Messaging Overview: https://developers.google.com/cloud-messaging/gcm

Node.js Library: https://www.npmjs.com/package/node-gcm

Ionic setup: http://docs.ionic.io/docs/push-android-setup

Yahavw commented 8 years ago

GCM credentials : AIzaSyCjN6otSXVF0C0lGOy1UJBHpQGWhJV2j4o

Yahavw commented 8 years ago

registrationToken field was added to user schema. This field will hold the push token. The client will send an http request to PATH_USERS_UPDATEUSER_WITH_ID with the regisrationToken after finishing login.

oreporan commented 8 years ago

This can only be done after login? Cant do it during signup?

On Jan 30, 2016, 18:45 +0200, Yahavnotifications@github.com, wrote:

registrationToken field was added to user schema. This field will hold the push token. The client will send an http request to PATH_USERS_UPDATEUSER_WITH_ID with the regisrationToken after finishing login.

— Reply to this email directly orview it on GitHub(https://github.com/oreporan/wePlayMin/issues/46#issuecomment-177239944).

Yahavw commented 8 years ago

The user can change its device so we should update this field every login or sign up. I'm not sure that we want to make it a require field for login/signup right now

Yahavw commented 8 years ago

If user installed the application on more than 1 device, he should get the push to all of his devices no? So maybe I should make regisrationTokens an array?

oreporan commented 8 years ago

What happens if i log in to the app on your device?

On Jan 30, 2016, 19:28 +0200, Yahavnotifications@github.com, wrote:

If user installed the application on more than 1 device, he should get the push to all of his devices no? So maybe I should make regisrationTokens an array?

— Reply to this email directly orview it on GitHub(https://github.com/oreporan/wePlayMin/issues/46#issuecomment-177257539).

Yahavw commented 8 years ago

That mean that you loged out and then login. In logout we will do : push. unregister(); so sending a push to the previous user will do nothing. When other user will sign in again, it will create a new registerToken and will update his User in DB

2016-01-30 19:32 GMT+02:00 oreporan notifications@github.com:

What happens if i log in to the app on your device?

On Jan 30, 2016, 19:28 +0200, Yahavnotifications@github.com, wrote:

If user installed the application on more than 1 device, he should get the push to all of his devices no? So maybe I should make regisrationTokens an array?

— Reply to this email directly orview it on GitHub( https://github.com/oreporan/wePlayMin/issues/46#issuecomment-177257539).

— Reply to this email directly or view it on GitHub https://github.com/oreporan/wePlayMin/issues/46#issuecomment-177257779.

oreporan commented 8 years ago

By the way - make sure you are working in server branch when doing the server changes

oreporan commented 8 years ago

so that means we need to add a logout API? right now there is none

Yahavw commented 8 years ago

We don't need logout api in the server, the logout happen only in the client. we can remove the resgiterToken by when user logout. I think that we need to add "add/Remove RegisterTokenToUser" endpoint to the server.

2016-01-30 19:59 GMT+02:00 oreporan notifications@github.com:

so that means we need to add a logout API? right now there is none

— Reply to this email directly or view it on GitHub https://github.com/oreporan/wePlayMin/issues/46#issuecomment-177261718.

oreporan commented 8 years ago

So why not use login/logout ? Why more endpoints?

On Jan 30, 2016, 20:22 +0200, Yahavnotifications@github.com, wrote:

We don't need logout api in the server, the logout happen only in the client. we can remove the resgiterToken by when user logout. I think that we need to add "add/Remove RegisterTokenToUser" endpoint to the server.

2016-01-30 19:59 GMT+02:00 oreporannotifications@github.com:

so that means we need to add a logout API? right now there is none

— Reply to this email directly or view it on GitHub https://github.com/oreporan/wePlayMin/issues/46#issuecomment-177261718.

— Reply to this email directly orview it on GitHub(https://github.com/oreporan/wePlayMin/issues/46#issuecomment-177266527).