es.javocsoft.android.lib.toucan.client
Class ToucanClient

java.lang.Object
  extended by es.javocsoft.android.lib.toucan.client.ToucanClient

public class ToucanClient
extends Object

This is the Toucan client API library main class.

See http://toucan.javocsoft.es for more info.

Version:
1.0 $Rev: 808 $ $Author: admin $ $Date: 2015-11-20 13:42:09 +0100 (Fri, 20 Nov 2015) $
Author:
JavocSoft Team

Nested Class Summary
static class ToucanClient.TOUCAN_WORKER_TYPE
          The Toucan HTTP worker type.
 
Field Summary
static String CACHED_REQUEST_FILE_PREFIX
          All pending deliveries, when they can not be delivered, are store in cache files.
static String LOG_TAG
           
static String NOTIFICATION_MESSAGE_ID
          The message notification id key
static String NOTIFICATION_MESSAGE_REF
          The message notification reference key
static String NOTIFICATION_MESSAGE_TEXT
          The message content key
static String NOTIFICATION_MESSAGE_TS
          The message notification timestamp key
 
Method Summary
 void deviceRegistration(String notificationToken, int externalId, ResponseCallback callback)
          Registers the device with the specified GCM registration token for the application.
 void deviceRegistration(String notificationToken, int externalId, String installReferral, ResponseCallback callback)
          Registers the device with the specified GCM registration token for the application.
 void deviceRegistration(String notificationToken, ResponseCallback callback)
          Registers the device with the specified GCM registration token for the application.
 void deviceRegistration(String notificationToken, String installReferral, ResponseCallback callback)
          Registers the device with the specified GCM registration token for the application.
 void doAddTags(List<String> tags, ResponseCallback callback)
          Allows adding tags for the application/deviceId.
 void doDeviceUnregister(ResponseCallback callback)
          Un-registers a device from server.
 void doEnableRegisteredDevice(ResponseCallback callback)
          Enables a registered device.
 void doListTags(ResponseCallback callback)
          Gets the list of tags for the application and device Id.
 void doReadACK(android.os.Bundle notificationBundle, ResponseCallback callback)
          Informs to the API that a notification was read.
 void doReceivedACK(android.os.Bundle notificationBundle, ResponseCallback callback)
          Informs to the API that a notification was received.
 void doRemoveTags(List<String> tags, ResponseCallback callback)
          Removes the specified tags for the application and deviceId.
 void doResetTags(List<String> tags, ResponseCallback callback)
          Deletes current application/DeviceId tags setting the specified tags.
static ToucanClient getInstance(android.content.Context context, String apiToken, String appPublicKey)
          Gets the instance of the Toucan client.
 void informExternalId(int externalId, ResponseCallback callback)
          Informs to the API about the external id.
 void informInstallReferral(String installReferral, ResponseCallback callback)
          Informs to the API the installation referral.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_TAG

public static final String LOG_TAG
See Also:
Constant Field Values

CACHED_REQUEST_FILE_PREFIX

public static final String CACHED_REQUEST_FILE_PREFIX
All pending deliveries, when they can not be delivered, are store in cache files.

See Also:
Constant Field Values

NOTIFICATION_MESSAGE_TEXT

public static final String NOTIFICATION_MESSAGE_TEXT
The message content key

See Also:
Constant Field Values

NOTIFICATION_MESSAGE_REF

public static final String NOTIFICATION_MESSAGE_REF
The message notification reference key

See Also:
Constant Field Values

NOTIFICATION_MESSAGE_ID

public static final String NOTIFICATION_MESSAGE_ID
The message notification id key

See Also:
Constant Field Values

NOTIFICATION_MESSAGE_TS

public static final String NOTIFICATION_MESSAGE_TS
The message notification timestamp key

See Also:
Constant Field Values
Method Detail

getInstance

public static ToucanClient getInstance(android.content.Context context,
                                       String apiToken,
                                       String appPublicKey)
Gets the instance of the Toucan client.

Parameters:
context -
apiToken -
appPublicKey -
deviceNotificationToken -
Returns:

deviceRegistration

public void deviceRegistration(String notificationToken,
                               ResponseCallback callback)
Registers the device with the specified GCM registration token for the application.

Parameters:
notificationToken - The GCM notification token.
callback - A callback to run when operation finishes.

deviceRegistration

public void deviceRegistration(String notificationToken,
                               int externalId,
                               ResponseCallback callback)
Registers the device with the specified GCM registration token for the application. We set also an external id for back-end purposes.

Parameters:
notificationToken - The GCM notification token.
externalId - An external id that links GCM with some kind of internal back-end.
callback - A callback to run when operation finishes.

deviceRegistration

public void deviceRegistration(String notificationToken,
                               String installReferral,
                               ResponseCallback callback)
Registers the device with the specified GCM registration token for the application. When the installation URL has some referral info, we send this info to the server to be saved.

Parameters:
notificationToken - The GCM notification token.
installReferral - The installation referral data.
callback - A callback to run when operation finishes.

deviceRegistration

public void deviceRegistration(String notificationToken,
                               int externalId,
                               String installReferral,
                               ResponseCallback callback)
Registers the device with the specified GCM registration token for the application. We set also an external id for back-end purposes. When the installation URL has some referral info, we send this info to the server to be saved.

Parameters:
notificationToken - The GCM notification token.
externalId - An external id that links GCM with some kind of internal back-end.
installReferral - The installation referral data.
callback - A callback to run when operation finishes.

informInstallReferral

public void informInstallReferral(String installReferral,
                                  ResponseCallback callback)
Informs to the API the installation referral.

Parameters:
installReferral - The installation referral data.
callback - A callback to run when operation finishes.

informExternalId

public void informExternalId(int externalId,
                             ResponseCallback callback)
Informs to the API about the external id. This Id links device stored in notification API with an external CMS.

Parameters:
externalId - The external id.
callback - A callback to run when operation finishes.

doReceivedACK

public void doReceivedACK(android.os.Bundle notificationBundle,
                          ResponseCallback callback)
Informs to the API that a notification was received.

Parameters:
notificationBundle - Registers the device with the specified GCM registration token for the application.
callback - A callback to run when operation finishes.

doReadACK

public void doReadACK(android.os.Bundle notificationBundle,
                      ResponseCallback callback)
Informs to the API that a notification was read.

Parameters:
notificationBundle - Registers the device with the specified GCM registration token for the application.
callback - A callback to run when operation finishes.

doAddTags

public void doAddTags(List<String> tags,
                      ResponseCallback callback)
Allows adding tags for the application/deviceId.

Parameters:
tags - A list of tags.
callback - A callback to run when operation finishes.

doResetTags

public void doResetTags(List<String> tags,
                        ResponseCallback callback)
Deletes current application/DeviceId tags setting the specified tags.

Parameters:
tags - tags to add.
callback - A callback to run when operation finishes.

doRemoveTags

public void doRemoveTags(List<String> tags,
                         ResponseCallback callback)
Removes the specified tags for the application and deviceId.

Parameters:
tags - A list of tags to remove.
callback - A callback to run when operation finishes.

doListTags

public void doListTags(ResponseCallback callback)
Gets the list of tags for the application and device Id.

Parameters:
callback - A callback to run when operation finishes.

doDeviceUnregister

public void doDeviceUnregister(ResponseCallback callback)
Un-registers a device from server. Avoiding delivering notifications to it.

Parameters:
callback - A callback to run when operation finishes.

doEnableRegisteredDevice

public void doEnableRegisteredDevice(ResponseCallback callback)
Enables a registered device.

Parameters:
callback - A callback to run when operation finishes.


Copyright © 2015-2016 JavocSoft. All Rights Reserved.