LeancloudPushDemo icon indicating copy to clipboard operation
LeancloudPushDemo copied to clipboard

java.lang.RuntimeException: Cannot convert argument of type class com.avos.avoscloud.AVException

Open youngjuning opened this issue 6 years ago • 1 comments

更新 PushModule 文件的 saveInstaillation 方法,添加 try carch 避免这个 bug

try {
      AVInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
        public void done(AVException e) {
          if (e == null) {
            // 保存成功
            String installationId = AVInstallation.getCurrentInstallation().getObjectId();
            resultCallback.invoke(installationId);
          } else {
            resultCallback.invoke(null, e);
          }
        }
      });
    } catch (Exception e) {
      resultCallback.invoke(null, e);
    }

youngjuning avatar Jul 27 '19 01:07 youngjuning

resultCallback.invoke(null, e); 会抛错

youngjuning avatar Mar 05 '20 09:03 youngjuning