All Classes Functions Variables Typedefs Friends Pages
List of all members
Glympse::IGlympse Struct Referenceabstract

The main Glympse API interface. More...

#include <IGlympse.h>

Inheritance diagram for Glympse::IGlympse:
Inheritance graph
[legend]

Public Member Functions

Life Cycle

Methods to manipulate platform state.

virtual GEventSink confirmAccount (const GString &type, const GPrimitive &profile)=0
 Sends confirmation code required to login with account of GC::LINKED_ACCOUNT_TYPE_PHONE of GC::LINKED_ACCOUNT_TYPE_EMAIL type. More...
 
virtual bool login (const GPrimitive &profile)=0
 Provides the Glympse platform with an account profile and some metadata that can be used to recover a user account. More...
 
virtual bool logout ()=0
 Clears the existing user account in the Glympse platform if one exists. More...
 
virtual void start ()=0
 This starts the entire Glympse system. More...
 
virtual void stop ()=0
 This stops the entire Glympse system. More...
 
virtual bool isFirstLaunch ()=0
 This method determines whether or not this platform instance considers this to be first-launch instantiation. More...
 
virtual bool isStarted ()=0
 
virtual int32 setActive (bool active)=0
 Use this method to notify Glympse API when the application is going to the background or returns to the foreground. More...
 
virtual bool isActive ()=0
 Gets platform state. More...
 
virtual GString getAccessToken ()=0
 Exposes Glympse access token that library uses to authorize its requests to Glympse servers. More...
 
Configuration

Various tools to customize platform behavior.

virtual void setHandler (const GHandler &handler)=0
 Allows to override concurrency layer. More...
 
virtual GHandler getHandler ()=0
 Gets current concurrency layer. More...
 
virtual int32 canDeviceSendSms ()=0
 Determines if the device can send SMS messages on its own. More...
 
virtual void setSmsSendMode (int32 smsSendMode)=0
 Configures the Glympse API to send SMS invites from the device's SMS number or from the Glympse server SMS provider. More...
 
virtual int32 getSmsSendMode ()=0
 Queries the Glympse API for the current SMS send mode. More...
 
virtual void enableSmsScraping (bool enable)=0
 Enables or disables automatic SMS scraping. More...
 
virtual bool isSmsScrapingEnabled ()=0
 Check if automatic SMS scraping is enabled.
 
virtual void setEtaMode (int32 etaMode)=0
 Allows to override default ETA mode. More...
 
virtual int32 getEtaMode ()=0
 Queries the Glympse API for the current directions mode. More...
 
virtual void setRestoreHistory (bool restore)=0
 Specifies, whether expired tickets previously sent by the user should be retrieved from server, when platform is started. More...
 
virtual bool isHistoryRestored ()=0
 
virtual void setHistoryLookback (int64 interval)=0
 Sets interval of time that controls how far back in time to look for user's tickets. More...
 
virtual int64 getHistoryLookback ()=0
 Checks how far back in time serer should look when building a history list (accessible through IHistoryManager::getTickets()). More...
 
virtual void allowSiblingTickets (bool allow)=0
 Enables sibling tickets. More...
 
virtual bool areSiblingTicketsAllowed ()=0
 Checks whether sibling tickets are allowed.
 
virtual void enableInviteViewersTracking (bool enable)=0
 Enables tracking of invite viewers. More...
 
virtual bool isInviteViewersTrackingEnabled ()=0
 Checks to see if invite viewers tracking is enabled. More...
 
virtual bool hasUserAccount ()=0
 Checks to see if Glympse user account is already created (or imoprted). More...
 
virtual void setBrand (const GString &brand)=0
 Brand is subcategory of API key, which is used for additional customization of outgoing invites (both invite messages and viewer experience). More...
 
virtual GString getBrand ()=0
 Gets currently set brand or NULL, if brand is not set.
 
virtual void enableApplicationsManager (bool enable)=0
 Enables functionality exposed by IApplicationManager. More...
 
virtual bool isApplicationsManagerEnabled ()=0
 Checks if application manager is enabled.
 
virtual GString getBaseUrl ()=0
 Returns raw base URL without any suffixes.
 
virtual GString getApiKey ()=0
 Returns currently used API key.
 
virtual GString getPrefix ()=0
 Returns currently used prefix.
 
Child Components

Glympse API object model is exposed to host applications through several components hidden behind faccade object (GGlympse).

virtual GConfig getConfig ()=0
 Gets platform configurator. More...
 
virtual GUserManager getUserManager ()=0
 Gets the user list. More...
 
virtual GHistoryManager getHistoryManager ()=0
 Gets your sent ticket list ("Glympse history"). More...
 
virtual GGroupManager getGroupManager ()=0
 Gets the group list. More...
 
virtual GNetworkManager getNetworkManager ()=0
 Gets the network manager. More...
 
virtual GLocationManager getLocationManager ()=0
 Gets the location manager. More...
 
virtual GBatteryManager getBatteryManager ()=0
 Gets the battery manager. More...
 
virtual GLinkedAccountsManager getLinkedAccountsManager ()=0
 Gets the linked accounts manager. More...
 
virtual GPairingManager getPairingManager ()=0
 Gets the pairing manager. More...
 
virtual GApplicationsManager getApplicationsManager ()=0
 Gets the applications manager. More...
 
virtual GHandoffManager getHandoffManager ()=0
 Gets the handoff manager. More...
 
virtual GDirectionsManager getDirectionsManager ()=0
 Gets the directions manager. More...
 
virtual GSmsProvider getSmsProvider ()=0
 Provides access to SMS auto-send functionality.
 
virtual GTriggersManager getTriggersManager ()=0
 Gets the triggers manager. More...
 
virtual GPlaceSearchEngine getPlaceSearchEngine ()=0
 Gets the place search engine. More...
 
virtual GFavoritesManager getFavoritesManager ()=0
 Gets favorites manager. More...
 
virtual GCardManager getCardManager ()=0
 Gets card manager. More...
 
virtual GPoiManager getPoiManager ()=0
 Gets POI manager. More...
 
Invites Handling

Tools for handling incoming ticket invites.

virtual GString cleanupInviteCode (const GString &code)=0
 Returns internal representation of valid invite code. More...
 
virtual bool compareInviteCodes (const GString &code1, const GString &code2)=0
 Compares two invite codes and returns true if they are semantically identical after normalizing and cleaning them. More...
 
virtual GEventSink decodeInvite (const GString &code, int32 mode)=0
 The method is provided for compatibility with old API versions. More...
 
virtual GEventSink decodeInvite (const GString &code, int32 mode, const GInvite &invite)=0
 Decodes Glympse invite received via Email or SMS. More...
 
virtual bool openUrl (const GString &message, int32 mode, const GInvite &invite)=0
 The method is provided for convenience. More...
 
virtual GArray< GString >::ptr extractInviteCodes (const GString &message)=0
 Parses the message looking for Glympse URIs and extracts invite codes. More...
 
virtual int32 getInviteAspect (const GString &code)=0
 Determines invite aspect (type of object hidden behind the invite code). More...
 
virtual GImage createInviteSnapshot (const GString &invite, const GPrimitive &parameters, const GPrimitive &style)=0
 Creates snapshot image of a ticket invite. More...
 
Tickets Section

Basic tools for operating with incoming and outgoing tickets and requests.

virtual GTicket viewTicket (const GUserTicket &userTicket)=0
 This method should be used to continue watching ticket, which has already been decoded via decodeInvite() method. More...
 
virtual bool sendTicket (const GTicket &ticket)=0
 Creates and sends a Glympse. More...
 
virtual void requestTicket (const GTicket &ticket)=0
 Creates and sends Glympse request. More...
 
Helpers

Miscellaneous helper utilities.

virtual void verify ()=0
 This method verifies the Glympse environment as it is currently configured and throws an exception if errors are encountered. More...
 
virtual int64 getTime ()=0
 Gets the epoch time (milliseconds since 1/1/1970) of the corrected system time ("Glympse time"). More...
 
virtual GString getApiVersion ()=0
 Gets version of the library in the format: "{MAJOR}.{MINOR}.{BUILD}". More...
 
virtual GString getApiVersionFull ()=0
 Gets version of the library in the format: "{MAJOR}.{MINOR}.{BUILD}.{BUGFIX} {STATUS}.{ITER}". More...
 
Debug Tools

These tools are provided for debugging purposes only and should never be invoked from production code.

virtual void showDebugView ()=0
 This method presents object model explorer on top of application UI.
 
virtual void overrideLoggingLevels (int32 fileLevel, int32 debugLevel)=0
 Glympse API supports few levels of log detalization. More...
 
virtual GString getLogFile ()=0
 Returns full name and path to the log file which is currently in use. More...
 
virtual GArray< GEventSink >::ptr findSinks (const GEventListener &listener)=0
 Returns the list of all sinks to which specified listener is subscribed.
 
PUSH Tools
virtual void registerDeviceToken (const GString &deviceToken)=0
 Associates device PUSH handle with Glympse user account. More...
 
virtual void registerDeviceToken (const GString &tokenType, const GString &deviceToken)=0
 Associates device PUSH handle with a given device. More...
 
virtual void unregisterDeviceToken ()=0
 Clears PUSH handle associated with Glympse user account.
 
virtual void unregisterDeviceToken (const GString &tokenType)=0
 Clears PUSH handle associated with a given device.
 
virtual bool hasValidDeviceToken ()=0
 Checks to see if platform still has valid device token. More...
 
virtual bool hasValidDeviceToken (const GString &tokenType)=0
 Checks to see if platform still has valid device token. More...
 
virtual void handleRemoteNotification (const GString &payload)=0
 Sends PUSH notification "payload" to Client API for processing. More...
 
virtual void handleRemoteNotification (const GString &payload, const GString &context)=0
 Sends PUSH notification "payload" to Client API for processing. More...
 
virtual void enablePushEchoing (bool enable)=0
 Glympse server sends "echo" PUSH message to the device every time when ticket gets created. More...
 
virtual bool isPushEchoingEbabled ()=0
 Tells whether PUSH echoing is currently enabled.
 
- Public Member Functions inherited from Glympse::IEventSink
virtual bool addListener (const GEventListener &eventListener)=0
 Registeres event listener on the sink. More...
 
virtual bool removeListener (const GEventListener &eventListener)=0
 Unsubscribes listener from events coming from this sink.
 
virtual GArray< GEventListener >
::ptr 
getListeners ()=0
 Provides access to the collection of current listeners. More...
 
virtual bool hasContext (int64 key)=0
 Checks, where user context identified by key is already associated with the object.
 
virtual void associateContext (int64 key, const GCommonObj &value)=0
 Associates specific context (user data) with the sink. More...
 
virtual GCommonObj getContext (int64 key)=0
 Returns context associated with the sink, or NULL, if it is not found.
 
virtual void clearContext (int64 key)=0
 Clears context identified by key argument.
 
virtual GEnumeration< GLong >::ptr getContextKeys ()=0
 Gets enumeration of all context keys associated with the sink.
 
virtual void deriveContext (const GEventSink &sink)=0
 Derives context from another sink object.
 
- Public Member Functions inherited from Glympse::IEventListener
virtual void eventsOccurred (const GGlympse &glympse, int32 listener, int32 events, const GCommonObj &obj)=0
 This method is invoked each time, when sink object notifies subscriber on an event. More...
 
- Public Member Functions inherited from Glympse::ICommon
virtual int32 retain ()=0
 Add a reference to our object in a COM-like way.
 
virtual int32 release ()=0
 Release a reference to our object in a COM-like way.
 
virtual int32 hold ()=0
 Add a reference to our object in a COM-like way.
 
virtual int32 unhold ()=0
 Release a reference to our object in a COM-like way.
 
virtual int32 hashCode ()=0
 Returns an integer hash code for this object.
 
virtual bool equals (const GCommonObj &o)=0
 Compares this instance with the specified object and indicates if they are equal. More...
 
virtual GString toString ()=0
 Returns a string containing a concise, human-readable description of this object. More...
 
virtual void attachObject (const GCommon &obj)=0
 Asociates arbitrary object with the instance.
 
virtual GCommon extractObject ()=0
 Extracts associated object or NULL if no association is established.
 

Additional Inherited Members

- Protected Member Functions inherited from Glympse::ICommon
virtual ~ICommon ()
 Destructor is protected to deny explicit object deallocation. More...
 

Detailed Description

The main Glympse API interface.

In the Glympse system, a "Glympse" is referred to as a "ticket". The terms Ticket and Glympse should be considered equivalent in this documentation.

Member Function Documentation

virtual void Glympse::IGlympse::allowSiblingTickets ( bool  allow)
pure virtual

Enables sibling tickets.

See Programming Guide for more details. Sibling tickets are not requested from server by default.

This method must be called before platform is started.

virtual int32 Glympse::IGlympse::canDeviceSendSms ( )
pure virtual

Determines if the device can send SMS messages on its own.

Returns
Returns on the following values:
  • GC::SMS_SEND_AUTO if the device can send an SMS message programmatically (iPhone running iOS 4.x - 5.x; Android).
  • GC::SMS_SEND_MANUAL if the device can send an SMS message via presenting standard UI (iPhone running iOS 6.0+).
  • GC::SMS_SEND_NOT_SUPPORTED if the device can not send an SMS message (iPad/iPod; any Android device without SIM (including phone without SIM or coverage)). In this case Glympse API will still attempt to send SMS from server, but there is no guarantee, that SMS is sent (some restrictions apply).
virtual GString Glympse::IGlympse::cleanupInviteCode ( const GString code)
pure virtual

Returns internal representation of valid invite code.

The method gets rid of dashes ('-') and other meaningless characters usually accompanying or being a part of invite codes.

Glympse API always stores and exposes cleaned up version of an invite code.

Parameters
codeInvite code to be cleaned up.
Returns
Cleaned up invite code or NULL if code does not refer to an invite code.
virtual bool Glympse::IGlympse::compareInviteCodes ( const GString code1,
const GString code2 
)
pure virtual

Compares two invite codes and returns true if they are semantically identical after normalizing and cleaning them.

Parameters
code1The first invite code to compare.
code2The second invite code to compare.
Returns
true, if the two invite codes are semantically equivalent; false otherwise.
virtual GEventSink Glympse::IGlympse::confirmAccount ( const GString type,
const GPrimitive profile 
)
pure virtual

Sends confirmation code required to login with account of GC::LINKED_ACCOUNT_TYPE_PHONE of GC::LINKED_ACCOUNT_TYPE_EMAIL type.

Upon success, a GE::CONFIRMATION_CODE_SENT event is fired on LISTENER_CONFIRMATION_CODE. Upon failure, a GE::CONFIRMATION_CODE_FAILED event is fired on LISTENER_CONFIRMATION_CODE.

Parameters
typeThe type of the account to be linked.
profileGPrimitive of CC::PRIMITIVE_TYPE_OBJECT type containing the profile name and associated metadata. Use GlympseFactory static profile factory methods for convenience.
Returns
Event sink of GC::LISTENER_CONFIRMATION_CODE type.
virtual GImage Glympse::IGlympse::createInviteSnapshot ( const GString invite,
const GPrimitive parameters,
const GPrimitive style 
)
pure virtual

Creates snapshot image of a ticket invite.

The method returns immediately. Returned image object can be used to subscribe on events and be notified, when snapshot image is ready (generated and downloaded from server).

It might take up to a few minutes to generate a snapshot, which in turn always happens on server side. Platform will not reissue any requests during next session, if being stopped while loading is in process.

Invite snapshots can only be created, when platform is started and is authenticated (GE::PLATFORM_LOGIN_SUCCEEDED has already been received during this session).

Parameters
inviteTicket invite code (e.g. "XXX-XXX").
parametersSet of required parameters of target image.
  • width: image width in pixels.
  • height: image height in pixels.
styleOptional styling profile to be applied to the snapshot.
Returns
Image object or NULL, if invite snapshot cannot be created at the moment.
virtual GEventSink Glympse::IGlympse::decodeInvite ( const GString code,
int32  mode 
)
pure virtual

The method is provided for compatibility with old API versions.

See decodeInvite(GString, int32, GInvite) for more details.

virtual GEventSink Glympse::IGlympse::decodeInvite ( const GString code,
int32  mode,
const GInvite invite 
)
pure virtual

Decodes Glympse invite received via Email or SMS.

Currently Glympse API supports three types of invites:

  • ticket invites;
  • invites to groups;
  • request invites.

Glympse invite URL has the following format: http://glympse.com/XXX-XXX A number of symbols before and after dash varies between 3 and 5.

Invite is decoded asynchronously (this operation requires round trip to server).

The method returns even sink object, which is used to notify caller on invalid invite code (GE::INVITE_INVALID_CODE).

Parameters
codeInvite code to be verified.
modeBitmask used to configure method behaviour (see GC::INVITE_MODE_* for more details).
inviteOptional invite object, which is propagated all the way down to GC::PLATFORM_INVITE_* events. The object is accessible through IUserTicket::getInvite() method.
Returns
Event sink used to notify caller on invalid invite code.
virtual void Glympse::IGlympse::enableApplicationsManager ( bool  enable)
pure virtual

Enables functionality exposed by IApplicationManager.

Application manager is disabled by default.

virtual void Glympse::IGlympse::enableInviteViewersTracking ( bool  enable)
pure virtual

Enables tracking of invite viewers.

It is disabled by default.

IInvite::getViewerUsers() and IInvite::getViewingUsers() are populated with users who ever viewed and users who are currently viewing that particular invite.

This method must be called before platform is started. The setting is not persisted across sessions.

virtual void Glympse::IGlympse::enablePushEchoing ( bool  enable)
pure virtual

Glympse server sends "echo" PUSH message to the device every time when ticket gets created.

Device is supposed to confirm that the message is received. The technique is used to verify whether device is capable of receiving notifications over PUSH. In some cases it is critical for server to know that PUSH mechanism is reliable enough to make product level decisions based on its availability. Specifically speaking server can set relatively low post rate (long interval between locaiton uploads) for the scenario when no one is viewing any of active tickets originated from the device.

Some applications might want to disable going into this "idle" mode even when no one is viewing. This method allows to toggle echoing logic to achieve desired behavior.

The method can be called at any time, but the change will only make affect upon sending the next ticket. It is recommended to call it before platform is started and do not toggle for the lifetime of the platform. The preference is not persisted by Glympse API.

Echoing is enabled by default.

Parameters
enableFlag indicating whether echoing needs to be enabled.
virtual void Glympse::IGlympse::enableSmsScraping ( bool  enable)
pure virtual

Enables or disables automatic SMS scraping.

SMS scraping is disabled by default.

This method must be called before platform is started.

This feature is only supported on Android and BB10.

Android: It is required to add the following permission to AndroidManifest.xml:

  • <uses-permission android:name="android.permission.RECEIVE_SMS" />

BB10: It is required to add the following permissions to bar-descriptor.xml:

  • access_sms_mms
  • access_pimdomain_messages
virtual GArray<GString>::ptr Glympse::IGlympse::extractInviteCodes ( const GString message)
pure virtual

Parses the message looking for Glympse URIs and extracts invite codes.

Invite codes returned by this method are formatted in the way Client API stores them internally. Dashes and other allowed punctuation are removed.

The method is thread-safe. It can be called from any application thread.

Note
It is absolutely required to pass all invites to main thread for decoding.
Parameters
messageMessage text containing Glympse URI. See openUrl() for more details on message format.
Returns
The list of invite codes extracted from the message or NULL if no invite codes were found.
virtual GString Glympse::IGlympse::getAccessToken ( )
pure virtual

Exposes Glympse access token that library uses to authorize its requests to Glympse servers.

The method can return NULL under certain circumstances. This effectively means that platform is in process of acquiring new token (assuming that it is up and running correctly). In this case new token can be queried upon receiving GE::PLATFORM_LOGIN_SUCCEEDED event.

Access token is short-lived. It is not supposed to be persisted on the application side or even cached in memory. Every time when host application needs to perform authenticated request to Glympse servers it is supposed to query the token using this method.

Returns
Glympse access token or NULL if platform is not started or not authenticated.
virtual GString Glympse::IGlympse::getApiVersion ( )
pure virtual

Gets version of the library in the format: "{MAJOR}.{MINOR}.{BUILD}".

MAJOR is major SDK version. MINOR is minor SDK version. BUILD is forever increasing SDK version number.

Example: "2.0.41"

virtual GString Glympse::IGlympse::getApiVersionFull ( )
pure virtual

Gets version of the library in the format: "{MAJOR}.{MINOR}.{BUILD}.{BUGFIX} {STATUS}.{ITER}".

BUGFIX is optional SDK bug fix iteration number. STATUS is optional development status (in-progress, beta, release, etc.). ITER is optional sprint number within STATUS phase.

Examples:

  • "2.0.40 Dev.2"
  • "2.0.41 Beta"
  • "2.0.41.1 Alpha"
  • "2.0.41.2 Release"
  • "2.1.42"
virtual GApplicationsManager Glympse::IGlympse::getApplicationsManager ( )
pure virtual

Gets the applications manager.

Returns
The applications manager object.
virtual GBatteryManager Glympse::IGlympse::getBatteryManager ( )
pure virtual

Gets the battery manager.

Returns
The battery manager object.
virtual GCardManager Glympse::IGlympse::getCardManager ( )
pure virtual

Gets card manager.

Returns
The Card manager object. Will return NULL if the glympse platform is not started or if cards have not been enabled in the glympse configuration.
virtual GConfig Glympse::IGlympse::getConfig ( )
pure virtual

Gets platform configurator.

Returns
The configurator object.
virtual GDirectionsManager Glympse::IGlympse::getDirectionsManager ( )
pure virtual

Gets the directions manager.

Returns
The directions manager object.
virtual int32 Glympse::IGlympse::getEtaMode ( )
pure virtual

Queries the Glympse API for the current directions mode.

See the setDirectiosMode method for more information.

Returns
The current ETA mode.
virtual GFavoritesManager Glympse::IGlympse::getFavoritesManager ( )
pure virtual

Gets favorites manager.

Returns
The Favorites manager object.
virtual GGroupManager Glympse::IGlympse::getGroupManager ( )
pure virtual

Gets the group list.

The group list contains a collection of all the Glympse groups that the client participates at.

Returns
The group list object.
virtual GHandler Glympse::IGlympse::getHandler ( )
pure virtual

Gets current concurrency layer.

Returns
Reference to current handler implementation.
virtual GHandoffManager Glympse::IGlympse::getHandoffManager ( )
pure virtual

Gets the handoff manager.

Returns
The handoff manager object.
virtual int64 Glympse::IGlympse::getHistoryLookback ( )
pure virtual

Checks how far back in time serer should look when building a history list (accessible through IHistoryManager::getTickets()).

Returns
Interval of time in milliseconds or GC::HISTORY_LOOKBACK_DEFAULT.
virtual GHistoryManager Glympse::IGlympse::getHistoryManager ( )
pure virtual

Gets your sent ticket list ("Glympse history").

The sent ticket list contains all the tickets you have created and sent. This includes tickets that are still active as well as one that have expired.

This list will initially be empty. Once Glympse has communicated with the server, the list will be populated to include the complete list of tickets you have sent.

To be notified when the list is first populated, you can register a IEventListener and capture the PLATFORM_SYNCED_WITH_SERVER event.

To be notified any time this list changes or a recipient in the list changes, you can register a IEventListener and capture the PLATFORM_TICKET_LIST_CHANGED event.

Returns
The sent ticket list object.
virtual int32 Glympse::IGlympse::getInviteAspect ( const GString code)
pure virtual

Determines invite aspect (type of object hidden behind the invite code).

See GC::INVITE_ASPECT_* for the list of supported aspects.

There are some cases, when invite aspect cannot be determined locally. Server round trip might be required to disambiguate.

The method is thread-safe. It can be called from any application thread.

Note
It is absolutely required to pass all invites to main thread for decoding.
The feature is only supported since API build in 2.0.40. Prior to 2.0.40 the method always returns GC::INVITE_ASPECT_UNDETERMINED.
Parameters
codeInvite code to be analyzed.
Returns
Detected invite aspect. See GC::INVITE_ASPECT_* for more details.
virtual GLinkedAccountsManager Glympse::IGlympse::getLinkedAccountsManager ( )
pure virtual

Gets the linked accounts manager.

Returns
The linked accounts manager object.
virtual GLocationManager Glympse::IGlympse::getLocationManager ( )
pure virtual

Gets the location manager.

Returns
The location manager object.
virtual GString Glympse::IGlympse::getLogFile ( )
pure virtual

Returns full name and path to the log file which is currently in use.

File name changes every time when API starts. File path usually remains the same during entire application session.

virtual GNetworkManager Glympse::IGlympse::getNetworkManager ( )
pure virtual

Gets the network manager.

Returns
The network manager object.
virtual GPairingManager Glympse::IGlympse::getPairingManager ( )
pure virtual

Gets the pairing manager.

Returns
The pairing manager object.
virtual GPlaceSearchEngine Glympse::IGlympse::getPlaceSearchEngine ( )
pure virtual

Gets the place search engine.

Returns
The place search engine.
virtual GPoiManager Glympse::IGlympse::getPoiManager ( )
pure virtual

Gets POI manager.

Returns
The POI manager object. Will return NULL if the glympse platform is not started or if POIs have not been enabled in the glympse configuration.
virtual int32 Glympse::IGlympse::getSmsSendMode ( )
pure virtual

Queries the Glympse API for the current SMS send mode.

See the setSmsSendMode method for more information.

Returns
The current SMS send mode.
virtual int64 Glympse::IGlympse::getTime ( )
pure virtual

Gets the epoch time (milliseconds since 1/1/1970) of the corrected system time ("Glympse time").

All timestamps used throughout the Glympse system are server timestamps in UTC. These include ticket start and end times. The Glympse client API periodically synchronizes itself to the Glympse server time in order to maintain an accurate system time that is independent to the system time maintained by the operating system, which may be incorrect. Any time you need an accurate system time to use with other Glympse times (such as when computing time remaining on a ticket), you should call this method to obtain the current system time in UTC.

Returns
The current system time, corrected to be in sync with the Glympse server time.
virtual GTriggersManager Glympse::IGlympse::getTriggersManager ( )
pure virtual

Gets the triggers manager.

Returns
The triggers manager object.
virtual GUserManager Glympse::IGlympse::getUserManager ( )
pure virtual

Gets the user list.

The user list contains a collection of all the Glympse users that the client knows about. This includes yourself, plus any users that you are watching via calls you have made to the viewTicket() method.

This list will initially just contain a single user representing yourself. Once the Glympse API has communicated with the server, the list will be expanded to include the complete list of users you are currently watching.

To be notified when the list is first fully populated, you can register a IEventListener and capture the GE::PLATFORM_USER_ADDED event.

To be notified any time this list changes or a user in the list changes, you can register a IEventListener and capture the GE::PLATFORM_USER_LIST_CHANGED event.

Returns
The user list object.
virtual void Glympse::IGlympse::handleRemoteNotification ( const GString payload)
pure virtual

Sends PUSH notification "payload" to Client API for processing.

Parameters
payloadPUSH notification payload.
virtual void Glympse::IGlympse::handleRemoteNotification ( const GString payload,
const GString context 
)
pure virtual

Sends PUSH notification "payload" to Client API for processing.

Parameters
payloadPUSH notification payload.
contextArbitrary context to be associated with further callbacks.
virtual bool Glympse::IGlympse::hasUserAccount ( )
pure virtual

Checks to see if Glympse user account is already created (or imoprted).

Returns
true, if platform already has an account.
virtual bool Glympse::IGlympse::hasValidDeviceToken ( )
pure virtual

Checks to see if platform still has valid device token.

Host application needs to initiate PUSH registration and obtain new token from PUSH provider otherwise.

virtual bool Glympse::IGlympse::hasValidDeviceToken ( const GString tokenType)
pure virtual

Checks to see if platform still has valid device token.

Host application needs to initiate PUSH registration and obtain new token from PUSH provider otherwise.

virtual bool Glympse::IGlympse::isActive ( )
pure virtual

Gets platform state.

Returns
Boolean value indicating whether platform is in active (foreground) state now.
virtual bool Glympse::IGlympse::isFirstLaunch ( )
pure virtual

This method determines whether or not this platform instance considers this to be first-launch instantiation.

That is, if the platform instance is created in an uninitialized, pristine environment. This method is valid immediately after the platform is created and it's return value remains unchanged throughout the lifetime thereof.

Note
Due to the criteria used to detect this condition, all calls to IGlympse::logout() will cause the return value of this method to reset the next time a platform instance is instantiated.
Returns
true, if this platform instance was created in an uninitialized environment, false otherwise.
virtual bool Glympse::IGlympse::isHistoryRestored ( )
pure virtual
Returns
Indicates, whether history is restored from server, when platform is started.
virtual bool Glympse::IGlympse::isInviteViewersTrackingEnabled ( )
pure virtual

Checks to see if invite viewers tracking is enabled.

Returns
true if platform is tracking invite viewers.
virtual bool Glympse::IGlympse::isStarted ( )
pure virtual
Returns
true, if platform is started.
virtual bool Glympse::IGlympse::login ( const GPrimitive profile)
pure virtual

Provides the Glympse platform with an account profile and some metadata that can be used to recover a user account.

The account profile is propagated to the Glympse server for analysis, which usually involves validation using a 3rd-party service.

Note
The specified account profile is ignored if the platform already has a user account. If hasUserAccount() returns true, call logout() first to clear out the existing account.
This method must be called before the platform is started.
Parameters
profileGPrimitive of CC::PRIMITIVE_TYPE_OBJECT type containing the profile name and associated metadata. Use CoreFactory static profile factory methods for convenience.
Returns
true if the operation succeeded, false otherwise
virtual bool Glympse::IGlympse::logout ( )
pure virtual

Clears the existing user account in the Glympse platform if one exists.

A new user account will be created during the next attempt to start the platform. To recover another user account, use login() to specify the profile of the account to recover before starting the platform again.

Note
This operation clears all user data (nickname, avatar, history, etc.).
This method must be called while the platform is stopped.
Returns
true if the operation succeeded, false otherwise
virtual bool Glympse::IGlympse::openUrl ( const GString message,
int32  mode,
const GInvite invite 
)
pure virtual

The method is provided for convenience.

For the most part it is intended to extract Glymose invite codes from free form messages containing Glympse URLs. Once invite code is extracted, further processing is delegated to IGlympse::decodeInvite.

It is highly recommended to use this method instead of parsing Glympse URLs manually. Glympse URL format can be changed in future. The API is always aware of all supported formats and variations.

The method is useful for applications doing their own SMS, Email scraping or providing custom transport mechanism for invites delivery.

Here are some examples of messages handled by this method:

  • "Click for a Glympse of my location: http://glympse.com/bot-002"
  • "Here is where I am http://glympse.com/bot-002 See you there!"
  • "http://glympse.com/bot-002"
Parameters
messageMessage text containing Glympse URI.
modeBitmask used to configure method behaviour (see GC::INVITE_MODE_* for more details).
inviteOptional argument that identifies source (person) of the message.
Returns
true, if message is not empty.
virtual void Glympse::IGlympse::overrideLoggingLevels ( int32  fileLevel,
int32  debugLevel 
)
pure virtual

Glympse API supports few levels of log detalization.

Levels are controlled by Glympse server, which allows to enable detailed logging for specific user to troubleshoot an issue. By default only critial errors are logged and uploaded to Glympse server for further analysis.

This method could be used by application to override logging levels for current Glympse API instance.

See CoreConstants for the list of supported levels.

Parameters
fileLevelLevel of details for logging to file.
debugLevelLevel of details for logging to console.
virtual void Glympse::IGlympse::registerDeviceToken ( const GString deviceToken)
pure virtual

Associates device PUSH handle with Glympse user account.

Parameters
deviceTokenPush handle provided by device.
virtual void Glympse::IGlympse::registerDeviceToken ( const GString tokenType,
const GString deviceToken 
)
pure virtual

Associates device PUSH handle with a given device.

Parameters
providerPush provider type.
deviceTokenPush handle provided by device.
virtual void Glympse::IGlympse::requestTicket ( const GTicket ticket)
pure virtual

Creates and sends Glympse request.

You must first create a ticket object via GlympseFactory::createTicket with one Invite. The invite should have an attached request ticket with optional duration, optional message, and optional destination. The attached request ticket should also contain at least one Invite descibing how the requested ticket should be delivered.

Request recipient will receive regular Glympse link and will be able to send a Glympse by opening the link in the Glympse application.

Parameters
ticketTicket object with default parameters prepopulated (duration, message, destination). Ticket object must contain single recipient identifying current user. @ return true if the input ticket was validated and scheduled.
virtual bool Glympse::IGlympse::sendTicket ( const GTicket ticket)
pure virtual

Creates and sends a Glympse.

You must first create a ticket object via GlympseFactory::createTicket with at least one recipient, optional duration, optional message, and optional destination. The sendTicket() will create the Glympse, and send a unique Glympse code to each of the recipients.

The ticket you pass to this method will be added to the IHistoryManager, which can be obtained by calling the getHistoryManager method.

The method always returns synchronously. Ticket creation as well as invite delivery is performed in the background. See GE::LISTENER_TICKET events for more details.

Platform will keep trying to send a ticket forever until it gets a chance to reach Glympse servers. It may take a while under poor data reception conditions. There is a way to limit amount of time during which platform performs retries. See IHistoryManager::enableCancellationTimer() and IHistoryManager::setCancellationTimeout() for more details.

Returns
true if ticket creation has been scheduled.
virtual int32 Glympse::IGlympse::setActive ( bool  active)
pure virtual

Use this method to notify Glympse API when the application is going to the background or returns to the foreground.

This method is backed by a reference count, so calls are expected to be reciprocal. When the reference count transitions from zero to one, the platform is activated; when the reference count transitions from one to zero, the platform is deactivated. Note, however, that platform deactivation is not synchronous nor immediate; it is delayed for a short time in order to prevent premature deactivation in cases where it will be reactivated quickly. In such cases, calls to reactivate the platform will cancel the deactivation and the platform will remain active.

Parameters
activetrue, if the application has moved to the foreground, false if it has moved to the background.
Returns
The active reference count. A reference count > zero means that the platform is [still] active. A reference count of zero means that the platform is, or will become, inactive.
virtual void Glympse::IGlympse::setBrand ( const GString brand)
pure virtual

Brand is subcategory of API key, which is used for additional customization of outgoing invites (both invite messages and viewer experience).

API consumers can leverage it as extra hierarchy level under API key to customize user experience.

The method overrides global property, which is applied to all outgoing invites. IInvite::setBrand can be used to modify the property for specific invite only. Moreover, if brand is already set for an invite, it will not be overridden by this global property.

The method is optional. By default invites derive configuration from API key.

virtual void Glympse::IGlympse::setEtaMode ( int32  etaMode)
pure virtual

Allows to override default ETA mode.

ETA mode defines, who is responsible for ETA calculation (Glympse API or client application). By default Glympse API does not calculate ETA (it operates in GC::ETA_MODE_EXTERNAL mode).

Make sure that platform is not started yet, when making this call. Otherwise it does not make any effect.

Parameters
etaModeNew ETA mode. See GlympseConstants for details.
virtual void Glympse::IGlympse::setHandler ( const GHandler handler)
pure virtual

Allows to override concurrency layer.

Glympse API remains not thread safe in any case. By default it is only allowed to make calls to Glympse API methods on the thread, where it was instantiated. Moreover, this thread should be event-driven thread and should be based on system run loop. This should not be necessarily main UI thread, however.

Providing custom handler implementation allows to instantiate Glympse API on a thread with custom events processing mechanism.

It is only allowed to invoke this method, when platform is yet started. Handler is propagated through the hierarchy of API objects at startup.

Parameters
handlerCustom handler implementation.
virtual void Glympse::IGlympse::setHistoryLookback ( int64  interval)
pure virtual

Sets interval of time that controls how far back in time to look for user's tickets.

All tickets returned by server will have

  • TICKET_END_TIME >= ( NOW - INTERVAL )

Client platform relies on default interval hardcoded on server side, if lookback interval is not specified by host application. This essentially results into querying 30 days of user history.

The method must be invoked before platform is started. Property is not persisted across sessions.

Parameters
intervalInterval of time in milliseconds or GC::HISTORY_LOOKBACK_DEFAULT.
virtual void Glympse::IGlympse::setRestoreHistory ( bool  restore)
pure virtual

Specifies, whether expired tickets previously sent by the user should be retrieved from server, when platform is started.

Client API does not restores history by default. It only retrieves active tickets, when platform is restarted.

The method must be invoked before platform is started. Property is not persisted across sessions.

virtual void Glympse::IGlympse::setSmsSendMode ( int32  smsSendMode)
pure virtual

Configures the Glympse API to send SMS invites from the device's SMS number or from the Glympse server SMS provider.

The Glympse API will attempt to detect the best method for sending SMS invites. If the Glympse API believes the device can send SMS messages, it will send them from the device's SMS number. Otherwise, it will send them from the Glympse server SMS provider. See the canDeviceSendSms method for more information.

The default mode (GC::SMS_SEND_MODE_DEFAULT) will perform this detection. You may override this default behavior by setting the SMS send mode to GC::SMS_SEND_MODE_DEVICE or GC::SMS_SEND_MODE_SERVER to force all SMS invites to be sent from the device or the server.

virtual void Glympse::IGlympse::start ( )
pure virtual

This starts the entire Glympse system.

This includes starting the Glympse service (to support background location sharing), starting the location manager, loading persisted settings, and initiating communication with the Glympse server.

Note that certain properties can only be adjusted before platform is started. The following methods can only be called before platform is started:

However, the majority of IGlympse methods should not be invoked before startup. All underlying managers are not accessible before platform is initialized. It is also impossible to send/view/request tickets.

Glympse API performs authentication automatically upon successful startup. It also performs required synchronization with server upon successful authentication.

It is recommended you call the addListener() method before calling the start() method in order to capture startup events.

The counterpart to this method is the stop() method, which stops the Glympse system.

virtual void Glympse::IGlympse::stop ( )
pure virtual

This stops the entire Glympse system.

This includes stopping the Glympse service, the location manager, and shutting down communication with the Glympse server.

Glympse object cannot be reused after it is stopped. New instance of Glympse platform needs to be created every time when it is required to start platform.

It is highly recommended to create single instance of Glympse platform per application launch. This method should be called by host application when it is terminated by user or the OS.

Note
The method cannot be called from within IEventListener::eventsOccurred().
virtual void Glympse::IGlympse::verify ( )
pure virtual

This method verifies the Glympse environment as it is currently configured and throws an exception if errors are encountered.

The verification is dependent both on the configuration as it exists at the time the method is invoked, as well as the os environment on which the environment is running.

It is recommended that method is invoked after configuring the Glympse platform instance, but before starting it. Note also that this method is provided solely for convenience and neend't be called every time the platform is started. However, it is prudent to test it periodically and/or before shipping your Glympse-enabled application.

Exceptions
GlympseExceptionunder varying invalid conditions.
virtual GTicket Glympse::IGlympse::viewTicket ( const GUserTicket userTicket)
pure virtual

This method should be used to continue watching ticket, which has already been decoded via decodeInvite() method.

Object implementing IUserTicket interface is sent along with GE::PLATFORM_INVITE_TICKET event to platform subscribers.

Parameters
userTicketObject, which was sent along with GE::PLATFORM_INVITE_TICKET event to platform subscribers.
Returns
The method returns reference to ticket object. NULL value is returned any of the following cases:
  • IUserTicket object is malformed;
  • Ticket with such code is already registered on the system;
  • Ticket is sent by the same application instance (associated user is self user).

The documentation for this struct was generated from the following file: