You can subscribe to in-game RubyPlay messages using postMessage API functionality.
Messages from the game are sent to the parent page. Each message has a standard structure and contains the following fields:
type: string;
sender: string;
lang: string;
data?: any;typeis a string with a specific structurerp.g2w.RedirectToLobbywhere:rpis an abbreviation of RubyPlayg2wis a direction for notification - from game to wrapperRedirectToLobbyis a message name
senderis a string with an ID code of the game from which the notification is being sentlangis a string with a language codedatafield is not mandatory and contains any additional data
Click here to see message examples...
Here are some examples:
{"type":"rp.g2w.payTableStatusUpdate","sender":"rp_34","lang":"en","data":{"isOpen":false}}
{"type":"rp.g2w.payTableStatusUpdate","sender":"rp_34","lang":"en","data":{"isOpen":true}}
{"type":"rp.g2w.gameRulesStatusUpdate","sender":"rp_25","lang":"da","data":{"isOpen":false}}
{"type":"rp.g2w.gameRulesStatusUpdate","sender":"rp_25","lang":"da","data":{"isOpen":true}}
{"type":"rp.g2w.paidRoundEnded","sender":"rp_76","lang":"en","data":{"win":0,"totalWin":0,"isBigWin":false}}
{"type":"rp.g2w.balanceUpdate","sender":"rp_34","lang":"en","data":{"balance":999620}}
{"type":"rp.g2w.paidRoundStarted","sender":"rp_54","lang":"es"}The full list of messages that the game can send:
For this functionality, the casino must use the postMessage API and adhere to the following fields:
type: string;
data?: any;typeis a string with a specific structurerp.w2g.refreshBalancewhere:rpis an abbreviation of RubyPlayw2gis a direction for notification - from wrapper to gamerefreshBalanceis a message name
datafield is not mandatory and contains any additional data
IMPORTANT: The entire message must be a JSON object. For example:
{"type":"rp.w2g.refreshBalance"}The list of messages that the wrapper can send to the game: