constants.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. var Constants = {
  2. 'GCM_SEND_ENDPOINT' : 'fcm.googleapis.com',
  3. 'GCM_SEND_ENDPATH' : '/fcm/send',
  4. 'GCM_SEND_URI' : 'https://fcm.googleapis.com/fcm/send',
  5. 'BACKOFF_INITIAL_DELAY' : 1000,
  6. 'MAX_BACKOFF_DELAY' : 1024000 ,
  7. 'SOCKET_TIMEOUT' : 180000, //three minutes
  8. /** DEPRECATED **/
  9. 'TOKEN_MESSAGE_ID' : 'id',
  10. 'TOKEN_CANONICAL_REG_ID' : 'registration_id',
  11. 'TOKEN_ERROR' : 'Error',
  12. 'JSON_REGISTRATION_IDS' : 'registration_ids',
  13. 'JSON_PAYLOAD' : 'data',
  14. 'JSON_NOTIFICATION' : 'notification',
  15. 'JSON_SUCCESS' : 'success',
  16. 'JSON_FAILURE' : 'failure',
  17. 'JSON_CANONICAL_IDS' : 'canonical_ids',
  18. 'JSON_MULTICAST_ID' : 'multicast_id',
  19. 'JSON_RESULTS' : 'results',
  20. 'JSON_ERROR' : 'error',
  21. 'JSON_MESSAGE_ID' : 'message_id',
  22. 'UTF8' : 'UTF-8',
  23. //These errors could probably be structured more nicely, and could be used in the code.
  24. // -- maybe just as an Error abstraction?
  25. 'ERROR_QUOTA_EXCEEDED' : 'QuotaExceeded',
  26. 'ERROR_DEVICE_QUOTA_EXCEEDED' : 'DeviceQuotaExceeded',
  27. 'ERROR_MISSING_REGISTRATION' : 'MissingRegistration',
  28. 'ERROR_INVALID_REGISTRATION' : 'InvalidRegistration',
  29. 'ERROR_MISMATCH_SENDER_ID' : 'MismatchSenderId',
  30. 'ERROR_NOT_REGISTERED' : 'NotRegistered',
  31. 'ERROR_MESSAGE_TOO_BIG' : 'MessageTooBig',
  32. 'ERROR_MISSING_COLLAPSE_KEY' : 'MissingCollapseKey',
  33. 'ERROR_UNAVAILABLE' : 'Unavailable',
  34. 'ERROR_INTERNAL_SERVER_ERROR' : 'InternalServerError'
  35. /** END DEPRECATED **/
  36. };
  37. module.exports = Constants;