com.kii.cloud.storage
Class KiiPushInstallation

java.lang.Object
  extended by com.kii.cloud.storage.KiiPushInstallation

public class KiiPushInstallation
extends java.lang.Object


Method Summary
 void install(java.lang.String registrationId)
          Register the id issued by GCM to the Kii cloud for current logged in user.
 int install(java.lang.String registrationId, KiiPushCallBack callback)
          Asynchronous call for install(String).
 void uninstall(java.lang.String registrationId)
          Uninstall the push by the id(issued by GCM) that is used for installation.
 int uninstall(java.lang.String registrationId, KiiPushCallBack callback)
          Asynchronous call for uninstall(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

install

public void install(java.lang.String registrationId)
             throws java.io.IOException,
                    BadRequestException,
                    UnauthorizedException,
                    ForbiddenException,
                    ConflictException,
                    NotFoundException,
                    UndefinedException
Register the id issued by GCM to the Kii cloud for current logged in user. Upon registration, Kii cloud uses it to identify each device that has registered to receive messages for the application. Each time application install into a device, a new registration id is issued.
NOTE: This api access to server. Should not be executed in UI/Main thread.

Parameters:
registrationId - Id that denotes the application in the particular device is registered to receive GCM message.
Throws:
java.lang.IllegalArgumentException - If registrationId is null or empty.
java.lang.IllegalStateException - SDK has not initialized or No user logged in.
java.io.IOException - If network related error has happened.
UndefinedException
NotFoundException
ForbiddenException
ConflictException
BadRequestException
UnauthorizedException

install

public int install(java.lang.String registrationId,
                   KiiPushCallBack callback)
Asynchronous call for install(String). A background task will be initiated to execute the task.
NOTE: This method should be executed in UI thread.

Parameters:
registrationId - GCM registration id for the app in the particular device.
callback - Notifies event.
Returns:
unique ID which is used to identify this async Task.
Throws:
WrongThreadException - Thrown if this method is not executed in UI thread.

uninstall

public void uninstall(java.lang.String registrationId)
               throws java.io.IOException,
                      BadRequestException,
                      UnauthorizedException,
                      ForbiddenException,
                      ConflictException,
                      NotFoundException,
                      UndefinedException
Uninstall the push by the id(issued by GCM) that is used for installation.
NOTE: This api access to server. Should not be executed in UI/Main thread.

Parameters:
registrationId - GCM issued Id that is used when install the push.
Throws:
java.lang.IllegalArgumentException - If registrationId is null or empty.
java.lang.IllegalStateException - SDK has not initialized or No user logged in.
java.io.IOException - If network related error has happened.
UndefinedException
NotFoundException - No installation found for the provided registrationId.
ForbiddenException
ConflictException
BadRequestException
UnauthorizedException

uninstall

public int uninstall(java.lang.String registrationId,
                     KiiPushCallBack callback)
Asynchronous call for uninstall(String). A background task will be initiated to execute the task.
NOTE: This method should be executed in UI thread.

Parameters:
regId - GCM issued Id that is used when install the push.
callBack - Notifies event.
Returns:
unique ID which is used to identify this async Task.
Throws:
WrongThreadException - Thrown if this method is not executed in UI thread.