Developer Zone

ReachOut™ direct-to-desktop messaging service

From the online customer area you can create ReachOut™ messaging campaigns which are used to deliver messages or surveys directly to the desktop of users who are running your software. You may choose a specific target audience for your message by defining a set of delivery filters so that each message will be delivered only to those users who match the specified criteria (such as geographical region, edition, version, build, language, OS, license status, runtime duration, days since install, etc.)

When building a ReachOut™ campaign you can choose between 2 message delivery options.

  • Automated HTML popup messages (which is handled entirely by the Trackerbird library and requires absolutely NO coding.
  • Manually retrieving the message (plaintext or URL) through code by using the tbMessageCheck() or tbMessageCheckWithMessageType() functions.

Manual Message Retrieval

When you want full control on when and where in your application to display a ReachOut™ message to your users, you can define ReachOut™ messages of the type plain text or URL. Then from within your application you can call one of the below functions to check with the Trackerbird server whether there are any pending messages (of this type) waiting to be delivered.

You may choose to display plaintext messages anywhere in your application such as in a status bar or information box. For the URL type messages you can either open the URL in a browser or else render it in some HTML previewer embedded within your application.

The difference between tbMessageCheck() and tbMessageCheckWithMessageType() is that tbMessageCheck() uses takes an ‘empty’ messageType parameter and fills it with the type of message that is sent by the server, while in the case of tbMessageCheckWithMessageType(), the message type is specified by the developer, and the server would then only send messages of that type.

The message type can be one of the following constants:

* TB_MESSAGETYPE_ALL (0)
* TB_MESSAGETYPE_TEXT (1)
* TB_MESSAGETYPE_URL (2)
TBRESULT tbMessageCheck(wchar_t* message, int* messageType)

This function requests a manual ReachOut™ message from the server. This can be either a plain text message or a URL, depending on what messages are waiting on the server.

Parameters:
  • message (wchar_t*) – A wchar_t* string of length 256 (257 due to the NULL delimiter) that will be filled-in by the SDK with the message that is sent by the server.
  • messageType (int) – This value is filled by the SDK and contains the type of message that is received (can be either TB_MESSAGETYPE_TEXT or TB_MESSAGETYPE_URL)
Return type:

If 0 or greater, it contains the number of messages remaining on the server. Otherwise, one of the return status constants below:

* TB_FUNCTION_NOT_AVAIL (-1)
* TB_CONN_ERROR (-2)
* TB_AUTH_FAILURE (-3)
* TB_SERVER_ERROR (-4)
* TB_APP_CONFIG_NOT_LOADED (-7)

Code Example:

int message_type;
wchar_t* message=new wchar_t[257];
int messageRet = tbMessageCheck(message, &message_type);
if(messageRet > 0){
    wprintf(L"This is your message:----%s\n",message);
}
else{
    wprintf(L"No messages\n");
}
delete[] message;
TBRESULT tbMessageCheckWithMessageType(wchar_t* message, int messageTypeExpected)

This function requests a manual ReachOut™ message from the server while specifying the type of message that is needed. The message type needed is to be sent in the messageTypeExpected parameter, and can be one of the message type constants described above.

Parameters:
  • message (wchar_t*) – A wchar_t* string of length 256 (257 due to the NULL delimiter) that will be filled-in by the SDK with the message that is sent by the server.
  • messageTypeExpected (int) – This value is filled by the developer and should contain the type of message that is being requested. This must be one of the message types described above.
Return type:

If 0 or greater, it contains the number of messages of the requested type remaining on the server. Otherwise, one of the return status constants below:

* TB_FUNCTION_NOT_AVAIL (-1)
* TB_CONN_ERROR (-2)
* TB_AUTH_FAILURE (-3)
* TB_SERVER_ERROR (-4)
* TB_APP_CONFIG_NOT_LOADED (-7)

Code Example:

int message_type_expected = TB_MESSAGETYPE_TEXT;
wchar_t* message=new wchar_t[257];
int messageRet = tbMessageCheckWithMessageType(message, message_type_expected);
if(messageRet > 0){
    wprintf(L"This is your message:----%s\n",message);
}
else{
    wprintf(L"No messages\n");
}
delete[] message;