parse-community / parse-server-push-adapter

A push notification adapter for Parse Server
https://parseplatform.org
MIT License
88 stars 100 forks source link

Request for Baidu to be added along with APNS and GCM #120

Closed prostil closed 5 years ago

prostil commented 5 years ago

I am working for a Chinese company who are interested in using the open source parse-server for mobile back end. Everything works fine as expected, except for the push service.

Reason being, GCM/FCM are goolge services and google is banned in mainland China, the alternate solution for this is to use Baidu which is the google equivalent in China (There are other push services that can be used like pushy, igetUi, jpush and so on for consideration, but we want to use Baidu)

I propose to add Baidu to the existing list such that, if the push android is configured with Baidu then we use baidu_push npm module else it will default to GCM

With other parse-server config parameters we add androidPushServer, usage as follows

  1. If this key does not exist then default to GCM
  2. If this key exists and has value === "baidu" then baidu_push npm module will be used
  3. If the key exists and has any other value other than "baidu" default back to GCM unless support for that is added
mman commented 5 years ago

I believe the current architecture of parse-server makes it fairly easy to create a separate baidu push adapter and use that in your installations without necessarily making it part of official parse server. See https://github.com/parse-community/parse-server-push-adapter. @flovilmart will definitely comment here, but I believe it's the right way to go.

flovilmart commented 5 years ago

Yes, that’s part of the design, wether you extend the original push support from the outside as @mman mentions.

The implementation should take place in the push-adapter project, and not the server as the server is agnostic to the push delivery mechanism, it’s job is mererly to call a method on the push adapter with the extracted installation objects.