项目作者: pjongy

项目描述 :
High reliability(ensures message sending task) installable "Large volume push" send service using APNs, FCM like 'Braze'
高级语言: Python
项目地址: git://github.com/pjongy/jraze.git
创建时间: 2020-07-24T09:39:04Z
项目社区:https://github.com/pjongy/jraze

开源协议:MIT License

下载











Installable push sending service which can control push targets

with their properties by notification’s conditions.








API specification

API specification document

Quick start (on local)

Pre-requisites

  • docker >= 19.03.8
  • docker-compose >= 1.25.5
  • python >= 3.7
  1. ------- Select FCM API version
  2. | $ export PUSH_WORKER__FCM__LEGACY__SERVER_KEY={..fcm server key..}
  3. | $ export PUSH_WORKER__FCM__CLIENT=legacy
  4. -------
  5. | $ export PUSH_WORKER__FCM__V1__KEY_FILE_NAME={..fcm service account key path..}
  6. | $ export PUSH_WORKER__FCM__V1__PROJECT_ID={..fcm project id..}
  7. | $ export PUSH_WORKER__FCM__CLIENT=v1
  8. -------
  9. ------- Select APNs authorization method
  10. | $ export PUSH_WORKER__APNS__P8_CERT__FILE_NAME={..apple apns p8 file path..}
  11. | $ export PUSH_WORKER__APNS__P8_CERT__KEY_ID={..apple apns key_id..}
  12. | $ export PUSH_WORKER__APNS__P8_CERT__TEAM_ID={..apple team_id..}
  13. | $ export PUSH_WORKER__APNS__P8_CERT__TOPIC={..apple product bundle id..}
  14. | $ export PUSH_WORKER__APNS__CERT_TYPE=p8
  15. -------
  16. | $ export PUSH_WORKER__APNS__PEM_CERT__FILE_NAME={..apple apns pem file path..}
  17. | $ export PUSH_WORKER__APNS__CERT_TYPE=pem
  18. -------
  19. $ docker-compose -f local-docker-compose.yml up -d

Project structure

  1. /
  2. /apiserver
  3. /worker
  4. /messaging
  5. /apns
  6. /fcm
  7. /notification

- API server

  • Endpoint for client can attach through REST API
  • Take roles about register device/notification
  • Also it shows device’s event for notification
  • Publish job for ‘Notification worker’

- Notification worker

  • Find devices comfort notification’s condition and publish job for ‘Push worker’
  • Client for update notifications’ sent result

- Messaging worker

  • Client for send push message to each send platform like: FCM, APNs
  • Publish job back for ‘Notification worker’ to update notification sent result (success / failed)

Sequence

  1. _________________________
  2. v _____ | _____
  3. [API server] --(____()----> [Notification worker] ----(____()---> [Messaging(APNS) worker] ---+
  4. ^ +--(____()---> [Messaging(FCM) worker] ----+
  5. | ______ |
  6. +-----------------(_____()-----------------------------------------+

Scale out-able instance

  • APIServer
  • NotificationWorker
  • MessagingWorker(FCM/APNS)

Trouble shooting

FCM

  • FCM worker can’t send notification with 403

    1. {"code": 403, "message": "The caller does not have permission", "status": "PERMISSION_DENIED"}}

    You should set permission “cloudmessaging.messages.create”

APNs

  • Extract PEM file from *.p12
    1. openssl pkcs12 -in {P12 FILE} -out {EXPORTED PEM FILE} -nodes -clcerts