Skip to main content
Version: 5.7.0

SendRichPushNotificationWithParams

Sends a notification to a user based on a brainCloud portal configured notification template and 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_RICH

Method Parameters

ParameterDescription
toProfileIdThe profileId of the user to receive the notification
notificationTemplateIdId of the notification template
substitutionJsonJSON defining the substitution params to use with the template

Usage

http://localhost:3000
string toProfileId = "profile1";
int notificationTemplateId = 1;
string substitutionJson = "{\"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.SendRichPushNotificationWithParams(toProfileId, notificationTemplateId, substitutionJson, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": null
}