我们使用Ionic框架开发混合移动应用程序。我们需要使用MFP 7.1向用户发送推送通知。所以使用RestAPI,我们正在努力。我们按照本教程中给出的步骤操作。 http://www.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.apiref.doc/rest_runtime/c_restapi_runtime.html
示例代码:
HttpPost httpPost = new HttpPost("https://example.com:10080/myproject/imfpush/v1/apps/com_ibm_tagpushv2/messages");
HttpClient client = new DefaultHttpClient();
HttpResponse response;
try {
response = client.execute(httpPost);
System.out.println("Response-->"+response);
} catch (ClientProtocolException e) {
System.out.println("Exception has occurred");
}
我的应用程序ID是com_ibm_tagpushv2。
错误:
Connection to https://example.com:10080 refused
请帮助。
答案 0 :(得分:0)