Package com.kii.cloud.storage
Class KiiPushInstallation
- java.lang.Object
-
- com.kii.cloud.storage.KiiPushInstallation
-
- Direct Known Subclasses:
GCMPushInstallation
,JPushInstallation
public abstract class KiiPushInstallation extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KiiPushInstallation.PushBackend
Supported android back-ends.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
install(java.lang.String registrationId)
Register the id issued by GCM to the Kii cloud for current logged in user.abstract int
install(java.lang.String registrationId, KiiPushCallBack callback)
Asynchronous call forinstall(String)
.abstract void
uninstall(java.lang.String registrationId)
Uninstall the push by the id(issued by GCM) that is used for installation.abstract int
uninstall(java.lang.String registrationId, KiiPushCallBack callback)
Asynchronous call foruninstall(String)
.
-
-
-
Method Detail
-
install
public abstract void install(@NonNull 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 abstract int install(@NonNull java.lang.String registrationId, @Nullable KiiPushCallBack callback)
Asynchronous call forinstall(String)
. A background task will be initiated to execute the task.- 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.
-
uninstall
public abstract void uninstall(@NonNull 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 abstract int uninstall(@NonNull java.lang.String registrationId, @Nullable KiiPushCallBack callback)
Asynchronous call foruninstall(String)
. A background task will be initiated to execute the task.- Parameters:
registrationId
- GCM issued Id that is used when install the push.callback
- Notifies event.- Returns:
- unique ID which is used to identify this async Task.
-
-