You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: serial_protocol.md
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -196,14 +196,17 @@ Used to stop listening to events at a given path. This must be the same path pro
196
196
#Messaging Protocol
197
197
198
198
##BEGIN_MSG
199
-
Called to start communicating with Firebase Cloud Messaging, it requires a server key.
199
+
Called to start communicating with Firebase Cloud Messaging, it requires a server key. You can also optionally supply any of the arguments listed on the MSG command to make them the defaults for this session. If you set them as defaults you don't need to specify them when calling MSG.
Called to start composing a message. It is followed by a list of named arguments, all of these arguments may be listed on BEGIN_MSG as well to set them as defaults for the session. Even if they are listed on BEGIN_MSG they can be overriden when calling MSG.
@@ -249,6 +252,22 @@ The message will expire after this amount of time in seconds. The default (and m
249
252
#####Examples
250
253
time_to_live=500
251
254
255
+
##Usage
256
+
MSG %Argument% %Argument% ...
257
+
###Response
258
+
+OK - Ready to specify rest of message.
259
+
-ERROR_MISSING_TARGET - You didn't specify either registration_ids or topic.
260
+
-ERROR_PARSING_ARGUMENTS - There was a syntax error in your arguments.
261
+
###Examples
262
+
>> MSG
263
+
<< +OK // Only works if you specified a default registration_ids or topic on BEGIN_MSG.
264
+
>> MSG
265
+
<< +ERROR_MISSING_TARGET // If you didn't specify a default registration_ids or topic on BEGIN_MSG.
<< +ERROR_PARSING_ARGUMENTS // There is a space in the list of registration ids.
270
+
252
271
##NOTIFICATION
253
272
Notification to display to the user, is made up of a title and a body. The title is specified on the first line and the first line ends with a count of bytes in the body. We will then read the next %Body_Byte_Count% bytes (after the line break) and interpret them as the body. If there is no body specify 0 for the byte count.