Trigger Reference of GS2-Inbox Script

Reference for event triggers that call extended scripts, as defined in GS2-Inbox

receiveMessage

Event trigger to call GS2-Script before a message is received.

Request

TypeDescription
namespaceNamespaceNamespace
messageMessageMessage

Result

TypeRequireDefaultLimitationDescription
permitboolAllow messages to be received
overrideMetadatastring~ 4096 charsMetadata after overwriting

Implementation Example

namespace = args.namespace
message = args.message

result = {
  permit=permit,
  overrideMetadata=overrideMetadata
}

receiveMessageDone

GS2-Script called after a message is received.

Request

TypeDescription
namespaceNamespaceNamespace
messageMessageMessage

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
message = args.message

result = {
}

readMessage

Event trigger to call GS2-Script before a message is opened.

Request

TypeDescription
namespaceNamespaceNamespace
messageMessageMessage

Result

TypeRequireDefaultLimitationDescription
permitboolAllow messages to be opened

Implementation Example

namespace = args.namespace
message = args.message

result = {
  permit=permit
}

readMessageDone

GS2-Script called after a message is opened.

Request

TypeDescription
namespaceNamespaceNamespace
messageMessageMessage

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
message = args.message

result = {
}

deleteMessage

Event trigger to call GS2-Script before a message is deleted.

Request

TypeDescription
namespaceNamespaceNamespace
messageMessageMessage

Result

TypeRequireDefaultLimitationDescription
permitboolAllow message deletion

Implementation Example

namespace = args.namespace
message = args.message

result = {
  permit=permit
}

deleteMessageDone

GS2-Script called after a message is deleted.

Request

TypeDescription
namespaceNamespaceNamespace
messageMessageMessage

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
message = args.message

result = {
}