Constants.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. namespace App\Libs\Push\HuaWei\Admin;
  3. class Constants
  4. {
  5. /**
  6. * push_msg
  7. */
  8. const WEBPUSH_URGENCY_VERY_LOW = "very-low";
  9. const WEBPUSH_URGENCY_LOW = "low";
  10. const WEBPUSH_URGENCY_NORMAL = "normal";
  11. const WEBPUSH_URGENCY_HIGH = "high";
  12. /*
  13. * Notification Type
  14. */
  15. const PUSHMSG_NOTIFICATION_MSG_TYPE = 1;
  16. const PUSHMSG_PASS_THROUGHT_MSG_TYPE = 2;
  17. const PUSHMSG_TOPIC_MSG_TYPE = 3;
  18. const PUSHMSG_CONDITION_MSG_TYPE = 4;
  19. const PUSHMSG_FASTAPP_MSG_TYPE = 5;
  20. const APN_MSG_TYPE = 6;
  21. const WEB_PUSH_MSG_TYPE = 7;
  22. const TOPIC_SUBSCRIBE_MSG_TYPE = 8;
  23. const TOPIC_UNSUBSCRIBE_MSG_TYPE = 9;
  24. const TOPIC_SUBSCRIBE_QUERY_MSG_TYPE = 10;
  25. /**
  26. * log
  27. */
  28. const HW_PUSH_LOG_PUSH_MSG_MODULE = "PushMsg";
  29. const HW_PUSH_LOG_TOPIC_SUBSCRIBE_MODULE = "TopicSubsScribe";
  30. const HW_PUSH_LOG_TOPIC_UNSUBSCRIBE_MODULE = "TopicUnSubsScribe";
  31. const HW_PUSH_LOG_DEBUG_LEVEL = 4;
  32. const HW_PUSH_LOG_INFO_LEVEL = 3;
  33. const HW_PUSH_LOG_WARN_LEVEL = 2;
  34. const HW_PUSH_LOG_ERROR_LEVEL = 1;
  35. const HW_PUSH_LOG_FILE_NAME = 'push.log';
  36. const URL_PATTERN = "/^https.*/";
  37. const VIBRATE_PATTERN = "/[0-9]+|[0-9]+[sS]|[0-9]+[.][0-9]{1,9}|[0-9]+[.][0-9]{1,9}[sS]/";
  38. const COLOR_PATTERN = "/^#[0-9a-fA-F]{6}$/";
  39. const TTL_PATTERN = "/\\d+|\\d+[sS]|\\d+.\\d{1,9}|\\d+.\\d{1,9}[sS]/";
  40. const APN_AUTHORIZATION_PATTERN = "/^bearer*/";
  41. const APN_ID_PATTERN = "/[0-9a-z]{8}(-[0-9a-z]{4}){3}-[0-9a-z]{12}/";
  42. }
  43. class Visibility {
  44. const VISIBILITY_UNSPECIFIED= "VISIBILITY_UNSPECIFIED";
  45. const PRIVATE_STR="PRIVATE";
  46. const PUBLIC_STR="PUBLIC";
  47. const SECRET_STR="SECRET";
  48. }
  49. class NotificationPriority {
  50. const NOTIFICATION_PRIORITY_LOW = 'LOW';
  51. const NOTIFICATION_PRIORITY_NORMAL = 'NORMAL';
  52. const NOTIFICATION_PRIORITY_HIGH = 'HIGH';
  53. }
  54. class AndroidConfigDeliveryPriority{
  55. const PRIORITY_HIGH = 'HIGH';
  56. const PRIORITY_NORMAL = 'NORMAL';
  57. }
  58. class ApnConstant{
  59. //APN PRIORITY
  60. const ANP_PRIORITY_SEND_IMMEDIATELY = "10";
  61. const ANP_PRIORITY_SEND_BY_GROUP = "5";
  62. //APN TARGET USER
  63. const APN_TARGET_USER_TEST_USER = 1;
  64. const APN_TARGET_USER_FORMAL_USER = 2;
  65. const APN_TARGET_USER_VOIP_USER = 3;
  66. }