如何纠正“MulticastResult 类型的方法 getErrorCodeName() 未定义”错误?我使用了以下代码
MulticastResult result = sender.send(message, androidTargets, 1);
if (result.getResults() != null) {
int canonicalRegId = result.getCanonicalIds();
if (canonicalRegId != 0) {
// same device has more than on registration ID: update database
}
} else {
int error = result.getFailure();
System.out.println("Broadcast failure: " + error);
String error_code_name = result.getErrorCodeName(); //Error is Here
if (error_code_name.equals(Constants.ERROR_NOT_REGISTERED)) {
// application has been removed from device - unregister database or remove from database
}
}
提前致谢 !