Package com.kii.cloud.storage
Class JPushInstallation
- java.lang.Object
-
- com.kii.cloud.storage.KiiPushInstallation
-
- com.kii.cloud.storage.JPushInstallation
-
public class JPushInstallation extends KiiPushInstallation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.kii.cloud.storage.KiiPushInstallation
KiiPushInstallation.PushBackend
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
install(java.lang.String registrationId)
Register the id issued by JPush to the Kii cloud for current logged in user.int
install(java.lang.String registrationId, KiiPushCallBack callback)
Asynchronous call forinstall(String)
.void
uninstall(java.lang.String registrationId)
Uninstall the push by the id(issued by JPush) that is used for installation.int
uninstall(java.lang.String registrationId, KiiPushCallBack callback)
Asynchronous call foruninstall(String)
.
-
-
-
Method Detail
-
install
@WorkerThread public void install(@NonNull java.lang.String registrationId) throws java.io.IOException, BadRequestException, UnauthorizedException, ForbiddenException, ConflictException, NotFoundException, UndefinedException
Register the id issued by JPush 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.- Specified by:
install
in classKiiPushInstallation
- Parameters:
registrationId
- Id that denotes the application in the particular device is registered to receive JPush 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(@NonNull java.lang.String registrationId, @Nullable KiiPushCallBack callback)
Asynchronous call forinstall(String)
. A background task will be initiated to execute the task.- Specified by:
install
in classKiiPushInstallation
- Parameters:
registrationId
- JPush registration id for the app in the particular device.callback
- Notifies event.- Returns:
- unique ID which is used to identify this async Task.
-
uninstall
@WorkerThread public 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 JPush) that is used for installation.
NOTE: This api access to server. Should not be executed in UI/Main thread.- Specified by:
uninstall
in classKiiPushInstallation
- Parameters:
registrationId
- JPush 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(@NonNull java.lang.String registrationId, @Nullable KiiPushCallBack callback)
Asynchronous call foruninstall(String)
. A background task will be initiated to execute the task.- Specified by:
uninstall
in classKiiPushInstallation
- Parameters:
regId
- JPush issued Id that is used when install the push.callBack
- Notifies event.- Returns:
- unique ID which is used to identify this async Task.
-
-