We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
try { PushResult result = jpushClient.sendPush(payload); LOG.info("Got result - " + result); Thread.sleep(5000); // 请求结束后,调用 NettyHttpClient 中的 close 方法,否则进程不会退出。 jpushClient.close(); } catch(InterruptedException e) { e.printStackTrace(); }
jpushClient.close()应该放在finally方法体内或者实现AutoCloseable接口,这种示例代码严重误导人,正确写法:
JPushClient jpushClient =null; try { jpushClient = new JPushClient(MASTER_SECRET, APP_KEY); PushPayload payload = PushPayload.alertAll(alert); PushResult result = jpushClient.sendPush(payload); this.output("Get result :" + result); Thread.sleep(5000); } catch (Exception e) { Log.... } finally { try { jpushClient.close(); } catch (Exception e) { Log.... } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
示例代码
正确写法
jpushClient.close()应该放在finally方法体内或者实现AutoCloseable接口,这种示例代码严重误导人,正确写法:
The text was updated successfully, but these errors were encountered: