|
| 1 | +package com.azure.reactnative.notificationhub; |
| 2 | + |
| 3 | +public final class ReactNativeConstants { |
| 4 | + // Notification |
| 5 | + public static final String AZURE_NOTIFICATION_HUB_NAME = "AzureNotificationHub"; |
| 6 | + public static final String NOTIF_REGISTER_AZURE_HUB_EVENT = "azureNotificationHubRegistered"; |
| 7 | + public static final String NOTIF_AZURE_HUB_REGISTRATION_ERROR_EVENT = "azureNotificationHubRegistrationError"; |
| 8 | + public static final String DEVICE_NOTIF_EVENT = "remoteNotificationReceived"; |
| 9 | + public static final String NOTIFICATION_CHANNEL_ID = "rn-push-notification-channel-id"; |
| 10 | + |
| 11 | + // Shared prefs used in NotificationHubUtil |
| 12 | + public static final String SHARED_PREFS_NAME = "com.azure.reactnative.notificationhub.NotificationHubUtil"; |
| 13 | + public static final String KEY_FOR_PREFS_REGISTRATIONID = "AzureNotificationHub_registrationID"; |
| 14 | + public static final String KEY_FOR_PREFS_CONNECTIONSTRING = "AzureNotificationHub_connectionString"; |
| 15 | + public static final String KEY_FOR_PREFS_HUBNAME = "AzureNotificationHub_hubName"; |
| 16 | + public static final String KEY_FOR_PREFS_FCMTOKEN = "AzureNotificationHub_FCMToken"; |
| 17 | + public static final String KEY_FOR_PREFS_TAGS = "AzureNotificationHub_Tags"; |
| 18 | + public static final String KEY_FOR_PREFS_SENDERID = "AzureNotificationHub_senderID"; |
| 19 | + public static final String KEY_FOR_PREFS_CHANNELIMPORTANCE = "AzureNotificationHub_channelImportance"; |
| 20 | + public static final String KEY_FOR_PREFS_CHANNELSHOWBADGE = "AzureNotificationHub_channelShowBadge"; |
| 21 | + public static final String KEY_FOR_PREFS_CHANNELENABLELIGHTS = "AzureNotificationHub_channelEnableLights"; |
| 22 | + public static final String KEY_FOR_PREFS_CHANNELENABLEVIBRATION = "AzureNotificationHub_channelEnableVibration"; |
| 23 | + |
| 24 | + // Remote notification payload |
| 25 | + public static final String KEY_REMOTE_NOTIFICATION_MESSAGE = "message"; |
| 26 | + public static final String KEY_REMOTE_NOTIFICATION_ID = "google.message_id"; |
| 27 | + public static final String KEY_REMOTE_NOTIFICATION_TITLE = "title"; |
| 28 | + public static final String KEY_REMOTE_NOTIFICATION_PRIORITY = "google.original_priority"; |
| 29 | + public static final String KEY_REMOTE_NOTIFICATION_TICKER = "ticker"; |
| 30 | + public static final String KEY_REMOTE_NOTIFICATION_AUTO_CANCEL = "autoCancel"; |
| 31 | + public static final String KEY_REMOTE_NOTIFICATION_GROUP = "group"; |
| 32 | + public static final String KEY_REMOTE_NOTIFICATION_LARGE_ICON = "largeIcon"; |
| 33 | + public static final String KEY_REMOTE_NOTIFICATION_SUB_TEXT = "subText"; |
| 34 | + public static final String KEY_REMOTE_NOTIFICATION_NUMBER = "number"; |
| 35 | + public static final String KEY_REMOTE_NOTIFICATION_SMALL_ICON = "smallIcon"; |
| 36 | + public static final String KEY_REMOTE_NOTIFICATION_BIG_TEXT = "bigText"; |
| 37 | + public static final String KEY_REMOTE_NOTIFICATION_PLAY_SOUND = "playSound"; |
| 38 | + public static final String KEY_REMOTE_NOTIFICATION_SOUND_NAME = "soundName"; |
| 39 | + public static final String KEY_REMOTE_NOTIFICATION_ONGOING = "ongoing"; |
| 40 | + public static final String KEY_REMOTE_NOTIFICATION_COLOR = "color"; |
| 41 | + public static final String KEY_REMOTE_NOTIFICATION_VIBRATE = "vibrate"; |
| 42 | + public static final String KEY_REMOTE_NOTIFICATION_VIBRATION = "vibration"; |
| 43 | + public static final String KEY_REMOTE_NOTIFICATION_FOREGROUND = "foreground"; |
| 44 | + public static final String KEY_REMOTE_NOTIFICATION_ACTIONS = "actions"; |
| 45 | + public static final String KEY_REMOTE_NOTIFICATION_ACTION = "action"; |
| 46 | + public static final String KEY_REMOTE_NOTIFICATION_TAG = "tag"; |
| 47 | + public static final String KEY_REMOTE_NOTIFICATION_USER_INTERACTION = "userInteraction"; |
| 48 | + public static final String KEY_REMOTE_NOTIFICATION_COLDSTART = "coldstart"; |
| 49 | + |
| 50 | + // Remote notification payload's priority |
| 51 | + public static final String REMOTE_NOTIFICATION_PRIORITY_MAX = "max"; |
| 52 | + public static final String REMOTE_NOTIFICATION_PRIORITY_HIGH = "high"; |
| 53 | + public static final String REMOTE_NOTIFICATION_PRIORITY_LOW = "low"; |
| 54 | + public static final String REMOTE_NOTIFICATION_PRIORITY_MIN = "min"; |
| 55 | + public static final String REMOTE_NOTIFICATION_PRIORITY_NORMAL = "normal"; |
| 56 | + |
| 57 | + // Intent payload |
| 58 | + public static final String KEY_INTENT_NOTIFICATION = "notification"; |
| 59 | + |
| 60 | + // Resources |
| 61 | + public static final String RESOURCE_DEF_TYPE_MIPMAP = "mipmap"; |
| 62 | + public static final String RESOURCE_DEF_TYPE_RAW = "raw"; |
| 63 | + public static final String RESOURCE_NAME_NOTIFICATION = "ic_notification"; |
| 64 | + public static final String RESOURCE_NAME_LAUNCHER = "ic_launcher"; |
| 65 | + |
| 66 | + // Errors |
| 67 | + public static final String ERROR_NO_ACTIVITY_CLASS = "No activity class found for the notification"; |
| 68 | + public static final String ERROR_NO_MESSAGE = "No message specified for the notification"; |
| 69 | + public static final String ERROR_NO_NOTIF_ID = "No notification ID specified for the notification"; |
| 70 | + public static final String ERROR_COVERT_ACTIONS = "Exception while converting actions to JSON object."; |
| 71 | + public static final String ERROR_GET_ACTIONS_ARRAY = "Exception while getting action from actionsArray."; |
| 72 | + public static final String ERROR_SEND_PUSH_NOTIFICATION = "failed to send push notification"; |
| 73 | + public static final String ERROR_ACTIVITY_CLASS_NOT_FOUND = "Activity class not found"; |
| 74 | + public static final String ERROR_INVALID_ARGUMENTS = "E_INVALID_ARGUMENTS"; |
| 75 | + public static final String ERROR_INVALID_CONNECTION_STRING = "Connection string cannot be null."; |
| 76 | + public static final String ERROR_INVALID_HUBNAME = "Hub name cannot be null."; |
| 77 | + public static final String ERROR_INVALID_SENDER_ID = "Sender ID cannot be null."; |
| 78 | + public static final String ERROR_PLAY_SERVICES = "E_PLAY_SERVICES"; |
| 79 | + public static final String ERROR_PLAY_SERVICES_DISABLED = "User must enable Google Play Services."; |
| 80 | + public static final String ERROR_PLAY_SERVICES_UNSUPPORTED = "This device is not supported by Google Play Services."; |
| 81 | + public static final String ERROR_NOTIFICATION_HUB = "E_NOTIFICATION_HUB"; |
| 82 | + public static final String ERROR_NOT_REGISTERED = "E_NOT_REGISTERED"; |
| 83 | + public static final String ERROR_NOT_REGISTERED_DESC = "No registration to Azure Notification Hub."; |
| 84 | + |
| 85 | + private ReactNativeConstants() { |
| 86 | + } |
| 87 | +} |
0 commit comments