PubNub class Basic Features
PubNub library.
All methods on this instance accept two named parameters: keyset
and using
.
keyset
accepts an instance of Keyset,using
accepts a String name of a keyset that was defined usingpubnub.keysets.add
method.
Both of those parameters are used to obtain an instance of Keyset that will be used in subsequent operations.
Example: In case of method channel, all operations on a returned Channel instance will be executed with a keyset that was obtained when the channel method was called.
At the beginning, the method that you call will try to obtain the keyset in accordance to those rules:
keyset
parameter has the highest priority,- if
keyset
is null, it will try to obtain a keyset namedusing
, - if
using
is null, it will try to obtain the default keyset, - if default keyset is not defined, it will throw an error.
Constructors
Properties
- batch ↔ BatchDx
-
Contains methods that allow running batch operations on channels,
channel groups and other features.
latefinal
- channelGroups ↔ ChannelGroupDx
-
Contains methods that allow manipulating channel groups.
latefinal
- crypto ↔ ICryptoModule
-
Internal module responsible for cryptography.
getter/setter pairinherited
- files ↔ FileDx
-
Contains methods that allow managing files.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- keysets ↔ KeysetStore
-
Allows to have multiple Keyset associated with one instance.
getter/setter pairinherited
- networking ↔ INetworkingModule
-
Internal module responsible for networking.
getter/setter pairinherited
- objects ↔ ObjectsDx
-
Contains methods to manage channel and uuids metadata and their relationships.
latefinal
- parser ↔ IParserModule
-
Internal module responsible for parsing.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signals → Signals
-
Internal signals.
no setterinherited
- supervisor ↔ SupervisorModule
-
Internal module responsible for supervising.
getter/setter pairinherited
Methods
-
addMessageAction(
{required String type, required String value, required String channel, required Timetoken timetoken, Keyset? keyset, String? using}) → Future< AddMessageActionResult> -
This method adds a message action to a parent message.
inherited
-
addPushChannels(
String deviceId, PushGateway gateway, Set< String> channels, {String? topic, Environment? environment, Keyset? keyset, String? using}) → Future<AddPushChannelsResult> -
It registers device
deviceId
for push notifications fromchannels
So the devicedeviceId
will receive push notifications from those channels mentioned in listchannels
inherited -
announceHeartbeat(
{Keyset? keyset, String? using, Set< String> channels = const {}, Set<String> channelGroups = const {}, int? heartbeat}) → Future<HeartbeatResult> -
Anounce in
channels
andchannelGroups
that a device linked to the UUID in the keyset is alive.inherited -
announceLeave(
{Keyset? keyset, String? using, Set< String> channels = const {}, Set<String> channelGroups = const {}}) → Future<LeaveResult> -
Announce in
channels
andchannelGroups
that a device linked to the UUID in the keyset left.inherited -
channel(
String name, {Keyset? keyset, String? using}) → Channel - Returns a representation of a channel.
-
channelMetadata(
String channelId, {String? name, String? description, Map< String, dynamic> ? custom, Keyset? keyset, String? using}) → Future<ChannelMetadata> -
Creates
ChannelMetadata
and sets metadata for given channel in the database. -
deleteMessageAction(
String channel, {required Timetoken messageTimetoken, required Timetoken actionTimetoken, Keyset? keyset, String? using}) → Future< DeleteMessageActionResult> -
This method removes an existing message action (identified by
actionTimetoken
) from a parent message (identified bymessageTimetoken
) on achannel
.inherited -
device(
String deviceId, {Keyset? keyset, String? using}) → Device - Returns a new instance of Device (from Push Notification API).
-
fetchMessageActions(
String channel, {Timetoken? from, Timetoken? to, int? limit = 100, Keyset? keyset, String? using}) → Future< FetchMessageActionsResult> -
Returns all message actions of a given
channel
.inherited -
getState(
{Keyset? keyset, String? using, Set< String> channels = const {}, Set<String> channelGroups = const {}}) → Future<GetUserStateResult> -
inherited
-
getSubscribedChannelGroupsForUUID(
UUID uuid, {bool countPaused = true}) → Set< String> -
Returns a set of channel groups that
uuid
is currently subscribed to.inherited -
getSubscribedChannelsForUUID(
UUID uuid, {bool countPaused = true}) → Set< String> -
Returns a set of channels that
uuid
is currently subscribed to.inherited -
grant(
Set< String> authKeys, {int? ttl, Set<String> ? channels, Set<String> ? channelGroups, Set<String> ? uuids, bool? write, bool? read, bool? manage, bool? delete, bool? get, bool? update, bool? join, Keyset? keyset, String? using}) → Future<PamGrantResult> -
Use this method to modify permissions for provided
authKeys
.inherited -
grantToken(
TokenRequest tokenRequest) → Future< Token> -
inherited
-
hereNow(
{Keyset? keyset, String? using, Set< String> channels = const {}, Set<String> channelGroups = const {}, StateInfo? stateInfo}) → Future<HereNowResult> -
Gets the occupancy information from a list of
channels
and/orchannelGroups
.inherited -
listPushChannels(
String deviceId, PushGateway gateway, {String? topic, Environment? environment, String? start, int? count, Keyset? keyset, String? using}) → Future< ListPushChannelsResult> -
It returns list of all channels to which device
deviceId
is registered to receive push notifications.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseToken(
String token) → Token -
inherited
-
publish(
String channel, dynamic message, {Keyset? keyset, String? using, Map< String, dynamic> ? meta, bool? storeMessage, int? ttl, bool? fire, String? customMessageType}) → Future<PublishResult> -
Publishes
message
to achannel
.inherited -
reconnect(
) → void -
Breaks up pending connections and restarts them.
inherited
-
removeDevice(
String deviceId, PushGateway gateway, {String? topic, Environment? environment, Keyset? keyset, String? using}) → Future< RemoveDeviceResult> -
It is allowing for removal of all registered channels at once,
for a given device
deviceId
, without specifying all of the channels.inherited -
removePushChannels(
String deviceId, PushGateway gateway, Set< String> channels, {String? topic, Environment? environment, Keyset? keyset, String? using}) → Future<RemovePushChannelsResult> -
It removes registration of device
deviceId
fromchannels
So devicedeviceId
will not get push notifications fromchannels
inherited -
requestToken(
{int? ttl, Map< String, dynamic> ? meta, String? authorizedUUID, String? authorizedUserId, String? using, Keyset? keyset}) → TokenRequest -
Creates a TokenRequest that can be used to obtain a Token.
inherited
-
revokeToken(
String token, {String? using, Keyset? keyset}) → Future< PamRevokeTokenResult> -
inherited
-
setState(
dynamic state, {Keyset? keyset, String? using, Set< String> channels = const {}, Set<String> channelGroups = const {}}) → Future<SetUserStateResult> -
inherited
-
setToken(
String token, {String? using, Keyset? keyset}) → void -
inherited
-
signal(
String channel, dynamic message, {String? customMessageType, Keyset? keyset, String? using}) → Future< SignalResult> -
Publishes signal
message
to achannel
.inherited -
subscribe(
{Set< String> ? channels, Set<String> ? channelGroups, bool withPresence = false, Keyset? keyset, String? using, Timetoken? timetoken}) → Subscription -
Subscribes to
channels
andchannelGroups
.inherited -
subscription(
{Set< String> ? channels, Set<String> ? channelGroups, bool withPresence = false, Keyset? keyset, String? using, Timetoken? timetoken}) → Subscription -
Creates an inactive subscription to
channels
andchannelGroups
. Returns Subscription.inherited -
time(
) → Future< Timetoken> -
Get current timetoken value from the PubNub network.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribeAll(
) → Future< void> -
Cancels all existing subscriptions.
inherited
-
uuidMetadata(
{String? uuid, String? name, String? email, Map< String, dynamic> ? custom, String? externalId, String? profileUrl, Keyset? keyset, String? using}) → Future<UUIDMetadata> -
Creates
UUIDMetadata
and sets metadata for givenuuid
in the database.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited