Push Notifications
This topic introduces the functionalities and implementation methods related to push notifications of 'Linkus SDK for Android'.
Configure push notification
/**
*
* @param mode:Push service platform; huawei, xiaomi, firebase,vivo,honor,oppo
* @param token:Authentication information of the push certificate
* @param requestCallback
* @return
*/
public void setPushInfo(String mode, String token, RequestCallback requestCallback)
//Example
YlsBaseManager.getInstance().setPushInfo("GETUI", clientid, new RequestCallback() {
// Configuration success callback
@Override
public void onSuccess(Object result) {
}
// Configuration failure callback
@Override
public void onFailed(int code) {
}
// Configuration exception callback
@Override
public void onException(Throwable exception) {
}
});
Handle push notifications
String data = new String(payload);
JSONObject jsonObject = null;
try {
jsonObject = new JSONObject(data);
} catch (JSONException e) {
e.printStackTrace();
}
YlsCallManager.getInstance().handlerPushMessage(context, jsonObject);