Last Updated on : 2023-05-25 06:23:47
Returns the status of the push notifications feature. If this feature is disabled, device alerts, home messages, and notifications cannot be received.
API description
void getPushStatus(IThingResultCallback<PushStatusBean> callback);
Parameters
Parameter | Description |
---|---|
callback | The success or failure callback. |
Example
ThingHomeSdk.getPushInstance().getPushStatus(new IThingResultCallback<PushStatusBean>() {
@Override
public void onSuccess(PushStatusBean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
Enables or disables the push notifications feature. If this feature is disabled, device alerts, home messages, and notifications cannot be received.
API description
void setPushStatus(boolean isOpen, IThingDataCallback<Boolean> callback);
Parameters
Parameter | Description |
---|---|
isOpen | Specifies whether to enable this feature. |
callback | The success or failure callback. |
Example
ThingHomeSdk.getPushInstance().setPushStatus(open, new IThingDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void getPushStatusByType(PushType type, IThingDataCallback<Boolean> callback);
Parameters
Parameter | Description |
---|---|
type | The type of message. Valid values:
|
callback | The success or failure callback. |
Example
ThingHomeSdk.getPushInstance().getPushStatusByType(type, new IThingDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void setPushStatusByType(PushType type, isOpen, IThingDataCallback<Boolean> callback);
Parameters
Parameter | Description |
---|---|
type | The type of message. Valid values:
|
isOpen | Specifies whether to enable this feature. |
callback | The success or failure callback. |
Example
ThingHomeSdk.getPushInstance().setPushStatusByType(pushType, checked, new IThingDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void getDNDList(IThingDataCallback<ArrayList<DeviceAlarmNotDisturbVO>> listener);
Parameters
Parameter | Description |
---|---|
listener | The success or failure callback. |
Example
ThingHomeSdk.getMessageInstance().getDNDList(new IThingDataCallback<DeviceAlarmNotDisturbVO>() {
@Override
public void onSuccess(DeviceAlarmNotDisturbVO result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void getDNDDeviceList(IThingDataCallback<ArrayList<NodisturbDevicesBean>> listener);
Parameters
Parameter | Description |
---|---|
listener | The success or failure callback. |
Example
ThingHomeSdk.getMessageInstance().getDNDDeviceList(new IThingDataCallback<NodisturbDevicesBean>() {
@Override
public void onSuccess(NodisturbDevicesBean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void getDeviceDNDSetting(IThingDataCallback<Boolean> listener);
Parameters
Parameter | Description |
---|---|
listener | The success callback. The current Do Not Disturb (DND) status is returned. Valid values:
|
Example
ThingHomeSdk.getMessageInstance().getDeviceDNDSetting(new IThingDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void setDeviceDNDSetting(boolean open, IThingDataCallback<Boolean> listener);
Parameters
Parameter | Description |
---|---|
open | Specifies whether to enable this feature. |
listener | The success or failure callback. |
Example
ThingHomeSdk.getMessageInstance().setDeviceDNDSetting(open, new IThingDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void addDNDWithStartTime(String startTime, String endTime, String devIds, String loops, IThingDataCallback<Long> listener);
Parameters
Parameter | Description |
---|---|
startTime | The start time of the DND period. |
endTime | The end time of the DND period. |
devIds | The list of device IDs. |
loops | The weekly schedule. |
listener | The success or failure callback. |
Example
ThingHomeSdk.getMessageInstance().addDNDWithStartTime(startTime, endTime, devIds, loops, new IThingDataCallback<Long>() {
@Override
public void onSuccess(Long result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void removeDNDWithTimerId(long id, IThingDataCallback<Boolean> listener);
Parameters
Parameter | Description |
---|---|
id | The ID of the DND period to be removed. |
listener | The success or failure callback. |
Example
ThingHomeSdk.getMessageInstance().removeDNDWithTimerId(id, new IThingDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
API description
void modifyDNDWithTimerId(long nodisturbAlarmId, String mStartTime, String mEndTime, String devIds, String loops, IThingDataCallback<Boolean> listener);
Parameters
Parameter | Description |
---|---|
nodisturbAlarmId | The ID of the DND period to be modified. |
mStartTime | The start time of the DND period. |
mEndTime | The end time of the DND period. |
loops | The weekly schedule. |
listener | The success or failure callback. |
Example
ThingHomeSdk.getMessageInstance().modifyDNDWithTimerId(nodisturbAlarmId, mStartTime, mEndTime, devIds, loops, new IThingDataCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {}
@Override
public void onError(String errorCode, String errorMessage) {}
});
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback