A database is required to use the X-PUSH reliability and notification services.
Oracle, MSSQL, PostgreSQL, Db2 and Tibero databases are supported by X-PUSH.
Message Storage Process
Reliability Message
A message is received from a provider.
The received message is stored in the T_MESSAGE table.
The received TOPIC information (TOPIC_TYPE, TOPIC_ID) and matching user are located in the T_TOPIC table.
The located user information and message are stored in the T_USER_MESSAGE table.
User information must exist in the T_TOPIC table.
If no user information exists in the T_TOPIC table, the provided message will not be saved in the T_USER_MESSAGE table.
Notification Message
A message is received from a provider.
The received message is stored in the T_MESSAGE table.
The received TOPIC information (TOPIC_TYPE, TOPIC_ID) and matching user are located in the T_TOPIC table.
The located user information and message are stored in the T_USER_MESSAGE table.
The user's online/offline status is verified.
In the case of online, the notification is not transmitted. In the case of offline, the USER_ID information is obtained from the T_MOBILE table, stored in the T_NOTIFICATION table, and the notification message is transmitted to the device.
User information must exist in the T_MOBILE table.
If no user information exists in the T_ MOBILE table, the provided message will not be saved in the T_NOTIFICATION table, and the notification message will not be transmitted.
Table Description
Five tables are required.
T_TOPIC
T_MESSAGE
T_USER_MESSAGE
T_MOBILE
T_NOTIFICATION
Database Table | Description |
---|---|
T_TOPIC | User’s topic information |
T_MESSAGE | Reliable message information |
T_USER_MESSAGE | User message status management |
T_MOBILE | User’s Device Token information |
T_NOTIFICATION | Mobile notification history management |
The database Character Set must be set to UTF-8.
The table schema is located in XPUSH_HOME/sample/sql/xpush-2.8.x.sql
T_TOPIC
This table contains user information.
Column | Description |
---|---|
PROJECT_ID | Project ID |
USER_ID | User ID. |
TOPIC_TYPE | Topic type. |
TOPIC_ID | Topic ID. |
REGISTER_DATE | User registration date and time. |
MODIFIED_DATE | Date and time of user information change |
ACTIVE | Active status. (Y/N) |
When adding users, one of the methods below is used.
An administrator manually adds users to the T_TOPIC table.
Direct input via query.
insert into T_TOPIC (PROJECT_ID,USER_ID, TOPIC_TYPE, TOPIC_ID, REGISTER_DATE, MODIFIED_DATE, ACTIVE) values ('PRO#1','test@test.com, 'NOTI', '1001', '20150102012345', '20150102012345', 'Y')
User direct input.
Users can be added directly via commands in Nexacro Studio.
userRegister must be set to "true" in the xpush_conf settings.
T_MESSAGE
This table stores reliability messages sent by a provider.
Column | Description |
---|---|
PROJECT_ID | Project ID |
MESSAGE_ID | Unique ID for a provided message. |
TOPIC_TYPE | Topic type for a provided message. |
TOPIC_ID | Topic ID for a provided message. |
MESSAGE_BODY | Provided message. |
REGISTER_DATE | Date and time of a provided message. |
EXPIRATION_DATE | Date and time of expiration of the supplied message |
T_USER_MESSAGE
This table stores reliability messages per user.
When a message is received from a provider, the T_TOPIC and T_MESSASGE are combined to create a T_USER_MESSAGE.
Column | Description |
---|---|
PROJECT_ID | Project ID |
USER_ID | User ID. |
MESSAGE_ID | Message ID |
MESSAGE_STATE | User reception status. 0: Not received 1: nexacro client receipt confirmed 2: User receipt confirmed |
CHECK_DATE | User reception date and time. |
T_MOBILE
This table contains mobile user information.
Column | Description |
---|---|
PROJECT_ID | Project ID |
BUNDLE_ID | ios: App identifier ID android: Firebase project sender ID |
USER_ID | User ID. |
DEVICE_TOKEN | Unique mobile device identification number. |
OS | Mobile device OS (iOS: 1, Android: 2) |
OS_VERSION | Mobile device OS version |
REGISTER | Mobile device notification usage status. (Y/N) |
ACTIVE | Active status. (Y/N) |
REGISTERED_DATE | Date and time of registration |
MODIFIED_DATE | Date and time of change |
T_NOTIFICATION
This table stores notification messages per user.
Column | Description |
---|---|
PROJECT_ID | Project ID |
BUNDLE_ID | ios: App identifier ID android: Firebase project sender ID |
MESSAGE_ID | Unique ID for a provided message. |
DEVICE_TOKEN | Unique mobile device identification number. |
TOPIC_TYPE | Topic type for a provided message. |
TOPIC_ID | Topic ID for a provided message. |
MESSAGE | Provided message. |
CHECK_DATE | Date and time of a provided message. |
RESULT | APNs and GCM transmission result. (Success: 2, Fail: 0) |
ERROR_CODE | APNS, GCM transmission response |
The ERROR_CODE table for T_NOTIFICATION is shown below.
Apns ERROR_CODE | |
---|---|
NoErrorsEncountered | No error occurred. Transmission successful |
ProcessingError | APNS internal processing error |
MissingDeviceToken | No Device Token in the message sent to APNS |
MissingTopic | No Topic in the message sent to APNS |
MissingPayload | No Payload in the message sent to APNS |
InvalidTokenSize | Device Token size is not 32 bytes |
InvalidTopicSize | Topic size error |
InvalidPayloadSize | Device Token is invalid |
Shutdown | APNS server shutdown |
Unknown | Unknown cause |
FCM ERROR_CODE | |
---|---|
NoErrorsEncountered | No error occurred. Transmission successful |
BadApiKey | Invalid API Key |
MissingRegistration | No Registration ID in the message sent to GCM |
InvalidRegistration | Incorrect Registration ID format |
MismatchSenderId | No Sender ID matching the Registration ID |
NotRegistered | Registration ID not registered in GCM |
MessageTooBig | Message size exceeds 4KB |
InvalidDataKey | FCM reserved words are used in the data key of the message |
InvalidTtl | Message's TTL is outside the range 0 to 22419200 (4 weeks) |
Unavailable | GCM server unavailable |
InternalServerError | GCM server internal error |
InvalidPackageName | Registration ID indicates an invalid package name |