Skip to main content
Version: 5.7.0

SendTemplatedPushNotificationToGroup

Sends a notification to a "group" of user based on a brainCloud portal configured notification template. Includes JSON defining the substitution params to use with the template.

The format of the parameterized string is based on the MessageFormat java class.

A typical parameterized string could be "Hello {1}, welcome to the {0} game."".

The substitution values are passed via a JSON structure as follows:

{ "1" : "George Smith", "0" : "Poker Pirates" }

Note that the key of the JSON object is the substitution variable number and the value is the substitution value.

The resulting string would be "Hello George Smith, welcome to the Poker Pirates game.".

ServiceOperation
pushNotificationSEND_TEMPLATED_TO_GROUP

Method Parameters

ParameterDescription
groupIdTarget group ID
notificationTemplateIdId of the notification template
substitutionJsonJSON defining the substitution params to use with the template

Usage

http://localhost:3000
string groupId = "group1";
int notificationTemplateId = 1;
string substitutionsJson = "{\"0\":\"value0\",\"1\":\"value1\"}";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.PushNotificationService.SendTemplatedPushNotificationToGroup(groupId, notificationTemplateId, substitutionsJson, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": null
}