私は&年前に更新するアプリを1年間持っています。それはステートマシンで書かれていた。今はいくつか追加しましたが、iOS(iOSデバッグ向けに構築された)ではconnectionRequestが機能していないようです。私はアンドロイドでそれを構築し、それは非常にうまく動作します。iOSでConnectionRequestが動作しない
public void connectionForLogin(String username, String password) {
ConnectionRequest cr = new ConnectionRequest() {
@Override
protected void readResponse(InputStream input) throws IOException {
JSONParser jSONParser = new JSONParser();
Map<String, Object> parsedData = jSONParser.parseJSON(new InputStreamReader(input));
ArrayList<Map<String, Object>> response = (ArrayList<Map<String, Object>>) parsedData.get("root");
if (response != null) {
for (Map<String, Object> element : response) {
success = (String) element.get("login");
msg = (String) element.get("msg");
ArrayList<Map<String, Object>> userInfoArray = (ArrayList) element.get("user_info");
Storage.getInstance().writeObject("userInfo", userInfoArray);
}
}
}
@Override
protected void postResponse() {
super.postResponse();
}
@Override
protected void handleErrorResponseCode(int code, String message) {
}
@Override
protected void handleException(Exception err) {
}
@Override
protected void handleIOException(IOException err) {
}
@Override
protected void handleRuntimeException(RuntimeException err) {
}
};
cr.setPost(true);
cr.setDuplicateSupported(true);
cr.setTimeout(30000);
AllUrl au = new AllUrl();
InfiniteProgress ip = new InfiniteProgress();
Dialog d = ip.showInifiniteBlocking();
cr.setDisposeOnCompletion(d);
cr.setUrl(http://zzz.com/api/logins/match? + "username=" + username + "&password=" + password);
NetworkManager.getInstance().addToQueueAndWait(cr);
}
これはURLによるものですか? APIはhttp&iOSにhttpsが必要だと思っています。しかし、なぜ以前のバージョンが正常に動作しているのですか? – beck