subscribe
Grants a realtime subscribe on the default-projection ref-channel (id) of a DataSync entity, user or channel. Same as subscribe(id, null).
Grants a realtime subscribe on the ref-channel of a DataSync entity, user or channel: a pub/sub read on refChannel (id for the default projection, __{projection}__{id} otherwise). Relationships and memberships have no ref-channel of their own: their events are published to both endpoint refs.
The projection here only selects the ref-channel name. It adds nothing to the token meta. That differs from projection(...) on entity/channel/user, which sets the REST read view in meta.pn-projections. To both read through and subscribe to a projection, grant the pair:
DataSyncGrant.channel("chat-1").get().projection("admin"); // REST reads through "admin"
DataSyncGrant.subscribe("chat-1", "admin"); // read on "__admin__chat-1"
Returns a plain ChannelGrant, because a DataSyncGrant has no read bit.
Parameters
null (or "default" / "__default__") for the default projection.
Throws
if projection is blank.