Skip to content

Scheduled push notifications #4105

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

Closed
marvelm opened this issue Aug 22, 2017 · 3 comments
Closed

Scheduled push notifications #4105

marvelm opened this issue Aug 22, 2017 · 3 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@marvelm
Copy link
Contributor

marvelm commented Aug 22, 2017

Context

I would like to do the following through the dashboard.

  1. Send push notifications at a specific local date and time.
  2. Send recurring notifications (daily, weekly, monthly).

Implementation

  1. The PushController already supports the push_time option and it creates a "scheduled" _PushStatus.

    The scheduling logic should remain separate from parse-server, and it will be the developer's job to create/pick an implementation. This separate program will search for "scheduled" _PushStatus objects and send to devices in timezones for which the pushTime matches the current time. In order to track the delivery/failure rate of notifications, two new fields need to be added to the _PushStatus: sentPerUTCOffset and failedPerUTCOffset.

    These new fields are fully backwards compatible and should not affect parse-server. The only necessary change is adding a field to the dashboard for the user to specify the send time.
    The new schema:

    _PushStatus: {
      // ...
      sentPerUTCOffset: {[key: number]: number},
      failedPerUTCOffset: {[key: number]: number}
    }
  2. For this feature, I would like to introduce a new internal class in Parse called _PushCampaign. The pusher will create a _PushStatus object every interval for each _PushCampaign.
    Here's how the schema would look:

    _PushCampaign: {
      state: "active" | "inactive",
      pushStatuses: _PushStatus[], // Pointers
    
      interval: "once" | "daily" | "weekly" | "monthly",
      sendTime: string, // hh:mm:ss
      dayOfWeek: ?number, // when interval = 'weekly',
      dayOfMonth: ?number, // when interval = 'monthly'
    }

    When designing this schema, I researched the available standards for representing repeated intervals and I found that ISO 8601 supports it. However, I couldn't find a mature implementation in javascript. If the situation changes in the future, we can easily deprecate interval, dayOfWeek, and dayOfMonth.

I've been working on a reference implementation of the pusher at @AmpMe/parse-server-scheduled-pusher.

I would appreciate any feedback on this strategy. Thank you for reading.

@flovilmart
Copy link
Contributor

@acinader @felipemobile you may wanna have a look there

@acinader
Copy link
Contributor

@marvelm if you're on AWS, you may want to take a look at: https://www.npmjs.com/package/parse-server-sqs-mq-adapter

Sounds like a nice, well thought out addition to me.

@stale
Copy link

stale bot commented Sep 18, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 18, 2018
@stale stale bot closed this as completed Sep 25, 2018
@mtrezza mtrezza added type:feature New feature or improvement of existing feature and removed type:improvement labels Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

4 participants