iOS ネイティブ・アプリから MobileFirst サーバーに接続できません。worklight.plist のホスト、wlServerContext、およびポートを変更します。サーバーのコンソールに .wlapp と .adapter をアップロードします。
これは私のアプリのログです:
2015-03-30 14:34:31.119 El_Universal_Demo[696:146217] Connecting to server and initializing push notification ...
2015-03-30 14:34:31.125 El_Universal_Demo[696:146217] [DEBUG] [WL_CONFIG] -[WLConfig init] in WLConfig.m:69 :: {
"application id" = "El_Universal_Demo";
"application version" = "1.0";
environment = iOSnative;
host = "198.11.212.197";
platformVersion = "7.0.0.0";
port = 8080;
protocol = http;
wlServerContext = "/wladmin";
wlUid = "wY/mbnwKTDDYQUvuQCdSgg==";
}
2015-03-30 14:34:31.160 El_Universal_Demo[696:146217] [WARN] [USER_CERT_AUTH] + [WLUserAuthManager getCertificateIdentifier] in WLUserAuthManager.m:68 :: Certificate Identifier Key: com.worklight.userenrollment.certificate:com.eluniversal.El-Universal-Demo
2015-03-30 14:34:31.173 El_Universal_Demo[696:146217] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] +[WLAFHTTPClientWrapper requestWithURL:] in WLAFHTTPClientWrapper.m:46 :: Request url is http://198.11.212.197:8080/wladmin/apps/services/api/El_Universal_Demo/iOSnative/init
2015-03-30 14:34:31.202 El_Universal_Demo[696:146217] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:141 :: Request timeout is 60.000000
2015-03-30 14:34:31.206 El_Universal_Demo[696:146217] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:220 :: Sending request (http://198.11.212.197:8080/wladmin/apps/services/api/El_Universal_Demo/iOSnative/init) with headers:
{
"Accept-Language" = es;
"User-Agent" = "El_Universal_Demo/1 (iPhone; iOS 8.1.2; Scale/2.00)/WLNativeAPI/7.0.0.0";
"X-Requested-With" = XMLHttpRequest;
"x-wl-app-version" = "1.0";
"x-wl-clientlog-appname" = "El_Universal_Demo";
"x-wl-clientlog-appversion" = "1.0";
"x-wl-clientlog-deviceId" = "A6042553-8580-4365-A69C-6731388D6A56";
"x-wl-clientlog-env" = iOSnative;
"x-wl-clientlog-model" = "iPhone6,1";
"x-wl-clientlog-osversion" = "8.1.2";
"x-wl-device-id" = "A6042553-8580-4365-A69C-6731388D6A56";
"x-wl-platform-version" = "7.0.0.0";
}
You can see the request body in the Analytics platform logs.
2015-03-30 14:34:31.219 El_Universal_Demo[696:146217] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper start] in WLAFHTTPClientWrapper.m:297 :: Starting the request with URL http://198.11.212.197:8080/wladmin/apps/services/api/El_Universal_Demo/iOSnative/i nit
2015-03-30 14:34:31.225 El_Universal_Demo[696:146217] [DEBUG] [WL_REQUEST] __42-[WLRequest sendRequest:path:withOptions:]_block_invoke in WLRequest.m:230 :: waiting for response... (Thread=<NSThread: 0x17007f3c0>{number = 1, name = main})
2015-03-30 14:34:31.231 El_Universal_Demo[696:146217] url a cargar (null)
2015-03-30 14:34:31.288 El_Universal_Demo[696:146217] APNS Token : <9f662f33 5de5971b 5371851e 7d91fc17 f6f83d55 a9c913f6 973eec67 2e10c365>
2015-03-30 14:34:31.289 El_Universal_Demo[696:146217] APNS Token : <9f662f33 5de5971b 5371851e 7d91fc17 f6f83d55 a9c913f6 973eec67 2e10c365>
2015-03-30 14:34:31.476 El_Universal_Demo[696:146217] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:324 :: Request Failed
2015-03-30 14:34:31.480 El_Universal_Demo[696:146217] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:325 :: Response Status Code : 404
2015-03-30 14:34:31.484 El_Universal_Demo[696:146217] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:326 :: Response Error : Expected status code in (200-299), got 404
2015-03-30 14:34:31.501 El_Universal_Demo[696:146217] [ERROR] [WL_REQUEST] -[WLRequest requestFailed:error:] in WLRequest.m:466 :: Status code='404' error='Expected status code in (200-299), got 404' response=''
2015-03-30 14:34:31.508 El_Universal_Demo[696:146217] [DEBUG] [WL_REQUEST] -[WLRequest requestFailed:error:] in WLRequest.m:469 :: Response Header: {
Connection = "Keep-Alive";
"Content-Language" = "en-US";
"Content-Length" = 0;
Date = "Mon, 30 Mar 2015 20:34:44 GMT";
"Keep-Alive" = "timeout=10, max=100";
"X-Powered-By" = "Servlet/3.0";
}
Response Data:
2015-03-30 14:34:31.514 El_Universal_Demo[696:146217] [ERROR] [WL_CLIENT] - [WLClient onInitRequestFailure:userInfo:] in WLClient.m:1060 :: onInitRequestFailure
タグに基づく通知で例をテストする必要があります。私の例はローカルで動作しますが、クラウド内の開発サーバーでテストしたいのですが、アプリが接続されていないとそれを行うことができません。
MobileFirst 7.0 を使用しています
よろしく。