public interface

OmletMessagingApi

mobisocial.omlib.api.OmletMessagingApi

Class Overview

APIs for sending messages and data to feeds. Access as messaging().

Summary

Public Methods
abstract boolean delete(long objectId, boolean localOnly)
Deletes an object from the OmletModel.Objects database with the given object id, optionally requesting the object be deleted from remote devices.
abstract SyncStateListener.SyncState getCurrentSyncState()
abstract void like(long objectId)
Adds a 'like' to the given object from the OmletModel.Objects database with the given object id.
abstract void onMessagingActivityPaused()
Deprecated in favor of disconnect()
abstract void onMessagingActivityResumed()
Deprecated in favor of connect()
abstract void registerDeliveryListener(MessageDeliveryListener listener)
Registers a callback for message delivery events for all outbound objects and their attachments.
abstract void registerSyncStateListener(SyncStateListener listener)
Registers a callback for all sync state event updates.
abstract void resetLikes(long objectId)
Resets the number of likes to zero for the given object.
abstract void send(Uri feedUri, Sendable obj, MessageDeliveryListener listener)

Sends an object to a feed with the provided feedUri.

abstract void send(Uri feedUri, Sendable obj)
Sends an object to a feed with the provided feedUri.
abstract void unregisterDeliveryListener(MessageDeliveryListener listener)
Removes a previously registered message delivery listener.
abstract void unregisterSyncStateListener(SyncStateListener listener)
Unregisters a previously registered sync listener.

Public Methods

public abstract boolean delete (long objectId, boolean localOnly)

Deletes an object from the OmletModel.Objects database with the given object id, optionally requesting the object be deleted from remote devices.

public abstract SyncStateListener.SyncState getCurrentSyncState ()

public abstract void like (long objectId)

Adds a 'like' to the given object from the OmletModel.Objects database with the given object id.

public abstract void onMessagingActivityPaused ()

Deprecated in favor of disconnect()

public abstract void onMessagingActivityResumed ()

Deprecated in favor of connect()

public abstract void registerDeliveryListener (MessageDeliveryListener listener)

Registers a callback for message delivery events for all outbound objects and their attachments.

Parameters
listener The callback to register.

public abstract void registerSyncStateListener (SyncStateListener listener)

Registers a callback for all sync state event updates. Will initially fire with current state and also fire with future updates, unless unregistered

public abstract void resetLikes (long objectId)

Resets the number of likes to zero for the given object.

public abstract void send (Uri feedUri, Sendable obj, MessageDeliveryListener listener)

Sends an object to a feed with the provided feedUri. See SendUtils to create a data object for sending.

Pass a MessageDeliveryListener to receive notifications for this object and its attachments. Alternatively, use registerDeliveryListener(MessageDeliveryListener) to receive notifications for all outbound objects and attachments.

Parameters
feedUri e.g. content://mobisocial.omlib.provider/feeds/xx
obj The data to send
listener An optional callback listener for delivery status updates

public abstract void send (Uri feedUri, Sendable obj)

Sends an object to a feed with the provided feedUri. See SendUtils to create a data object for sending.

Parameters
feedUri e.g. content://mobisocial.omlib.provider/feeds/xx
obj The data to send

public abstract void unregisterDeliveryListener (MessageDeliveryListener listener)

Removes a previously registered message delivery listener.

public abstract void unregisterSyncStateListener (SyncStateListener listener)

Unregisters a previously registered sync listener.