Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Conversation

divad12
Copy link
Member

@divad12 divad12 commented Apr 5, 2014

These are push notifications for class seat openings, similar to http://uw.coursealerts.ca/.

Uses Google Cloud Messaging (GCM) to deliver push notifications.

Here's the flow:

  1. Android app ask's GCM servers for a registration ID, which uniquely identifies an app-device pair.
  2. App user wants to be notified when a section becomes available. App sends data about the section as well as the app's registration ID via a POST request to /api/v1/alerts/course/gcm.
  3. After each of our hourly cron updates from OpenData, we check if any alerts has all its criteria matched, and if so, send off that alert via GCM. If successful, delete the alert entity.

Corresponding PR on Android app: UWFlow/flow-android#45

@divad12
Copy link
Member Author

divad12 commented Apr 23, 2014

So... now that we're all done (our ENTIRE UNDERGRAD omg)... anyone want to review this? @mduan @jswu @phleet 😝

The models are designed so that one can just write a subclass to implement #124.

@mduan
Copy link
Contributor

mduan commented Apr 23, 2014

Wasn't this a requirement for your architecture class that you had to demo? Or did you demo it locally?

@divad12
Copy link
Member Author

divad12 commented Apr 23, 2014

Haha, I demoed locally :P Had to anyway in order to simulate a full class opening up a spot.


@classmethod
def delete_expired(cls):
cls.objects(expiry_date__gt=datetime.datetime.now()).delete()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be expiry_date__lt rather than expiry_date__gt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wowwwwww.... oops! And yep, this even includes a poorly-written test to go along with it! 💩

@divad12
Copy link
Member Author

divad12 commented Apr 26, 2014

@mduan Alright, fixed the issue with the expiry date. Thanks so much for reviewing and catching that!!

Anything else?

@mduan
Copy link
Contributor

mduan commented Apr 26, 2014

Other than that, it LGTM.

divad12 added a commit that referenced this pull request Apr 27, 2014
Add support for push notifications to our Android app
@divad12 divad12 merged commit ee3c5f4 into master Apr 27, 2014
@divad12 divad12 deleted the david-push-notifications branch April 27, 2014 01:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants