rex_firebase_simplemessage
Plugin, ACE table, Discussion thread
Dependence: rex_firebase_apiV3
Dependence: rex_firebase_apiV3
Introduction
Send/receive message to a channel.
Send/receive message to a channel.
Usage
Sample capx, sample capx-V3
Sample capx, sample capx-V3
Concept
Send message to an ID which enable the message updating. Messages will not be saved on server.
Send message to an ID which enable the message updating. Messages will not be saved on server.
User name and user ID
Call "Action:Set user" to set Sender ID (user ID) and Sender name (user name). These user information will be sent to with message.
Call "Action:Set user" to set Sender ID (user ID) and Sender name (user name). These user information will be sent to with message.
Send message
Call "Action:Send" to send message to a specific channel ID.
Set "Message type" to "String" in properties table to send string. Or set "Message type" to "JSON string" to send or receive JSON object by JSON string. It will pass a JSON object to firebase server.
Call "Action:Send" to send message to a specific channel ID.
Set "Message type" to "String" in properties table to send string. Or set "Message type" to "JSON string" to send or receive JSON object by JSON string. It will pass a JSON object to firebase server.
Receive message
Call "Action:Start" under "Update" category to start receiving message. Parameter "Receiver channel ID" could be userID to receive private message, or set to a public name like "room" to receive public message.
Once a message is received, "Condition:On receive" will be triggered, and get message by "Expression:LastMessage". Get sender user information by "Expression:LastSenderName", "Expression:LastSenderID".
Call "Action:Stop" under "Update" category to stop receiving message. "Condition:On receive" will not be triggered anymore.
Call "Action:Start" under "Update" category to start receiving message. Parameter "Receiver channel ID" could be userID to receive private message, or set to a public name like "room" to receive public message.
Once a message is received, "Condition:On receive" will be triggered, and get message by "Expression:LastMessage". Get sender user information by "Expression:LastSenderName", "Expression:LastSenderID".
Call "Action:Stop" under "Update" category to stop receiving message. "Condition:On receive" will not be triggered anymore.
Discard or pend offline message
Set "Offline message" to "Discard" to discard offline messages, i.e. receiver only could get messages after start receiving message ("Action:Start).
Or set "Offline message" to "Pend" to pend offline messages. Pended messages will be received and removed from server after start receiving message. It is only used for the channel which has single receiver, i.e. private message of a client.
Set "Offline message" to "Discard" to discard offline messages, i.e. receiver only could get messages after start receiving message ("Action:Start).
Or set "Offline message" to "Pend" to pend offline messages. Pended messages will be received and removed from server after start receiving message. It is only used for the channel which has single receiver, i.e. private message of a client.
Send function call
Sample capx
Designer could create a function call string by rex_fncallpkg plugin's "Expression:FnCallPkg" for sending. To run this function string, put this string in rex_fncallpkg plugin's "Action:Call function". In this mode, remember to set "Message type" to "JSON string".
It is a kind of RPC, since it could transfer message into function call directly,
Sample capx
Designer could create a function call string by rex_fncallpkg plugin's "Expression:FnCallPkg" for sending. To run this function string, put this string in rex_fncallpkg plugin's "Action:Call function". In this mode, remember to set "Message type" to "JSON string".
It is a kind of RPC, since it could transfer message into function call directly,
More example
Message board - set domain URL of firebase service and api key & javascript key of parse service (for rex_parse_message object) first.
Message board - set domain URL of firebase service and api key & javascript key of parse service (for rex_parse_message object) first.