How to connect to development server in the cloud - ios

I can't connect to my MobileFirst server from my iOS native app.
I change the host, wlServerContext and port in my worklight.plist.
I upload the .wlapp and .adapter in the console of the server.
This is the log in my app:
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
I need to test an example with notifications based on tags. My example works locally but I want to test it with the development server in the cloud and I cannot do that if my app doesn't connect.
I'm using MobileFirst 7.0
Regards.

You say it's working locally. Can you expend on that?
Are you sure in the settings you've placed in worklight.plist?
http://198.11.212.197:8080/wladmin/apps/services/api/El_Universal_Demo/iOSnative/init
That IP address looks local to me rather than remote ("in the cloud"). Verify your settings.

Thanks, this problem was resolved.
I had to reinstall all the configuration of installation in my server and again upload the run time (.war), wlapp and adapter.
Also in the moment when I did the deploy of my native app in eclipse some times appeared an error in the console about a problem in the file .war.
So I had to make other workspace and verify settings of my native app. (worklight.plist)
My problem now is that I donĀ“t receive any notification in my iPhone when I run a notification of my adapter but is other topic.
[1] How to invoke the url or link of an adapter
Regards

Related

End point does not exists - AWS SNS

I'm getting "Endpoint does not exists" when I'm trying to register for topic from my ios project. Inside info.plist file, I set my SNSPlatformApplicationARN to the app I created in SNS console. I've been scratching my heads of to resolve this issue. I appreciate any help. This is full error :
016-12-11 12:52:05.534 MiGPShttps://forums.aws.amazon.com/ AWSiOSSDK v2.4.11 https://forums.aws.amazon.com/ AWSURLSessionManager.m line:212 | -https://forums.aws.amazon.com/ | Session task failed with error: Error Domain=NSPOSIXErrorDomain Code=54 "Connection reset by peer" UserInfo={_kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=54}
2016-12-11 12:52:05.820 MiGPShttps://forums.aws.amazon.com/ AWSiOSSDK v2.4.11 https://forums.aws.amazon.com/ AWSURLSessionManager.m line:553 | -https://forums.aws.amazon.com/ | Response headers:
{
"Content-Length" = 262;
"Content-Type" = "text/xml";
Date = "Sun, 11 Dec 2016 17:52:05 GMT";
"x-amzn-RequestId" = "xxxx";
}
2016-12-11 12:52:05.820 MiGPShttps://forums.aws.amazon.com/ AWSiOSSDK v2.4.11 https://forums.aws.amazon.com/ AWSURLResponseSerialization.m line:240 | -https://forums.aws.amazon.com/ | Response body:
<ErrorResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
<Error>
<Type>Sender</Type>
<Code>NotFound</Code>
<Message>Endpoint does not exist</Message>
</Error>
<RequestId>xxxx-xxx-xxx</RequestId>
</ErrorResponse>

Unable to login to app on device or simulator after upgrade to iOS 9 and MobileFirst 7.1

My hybrid app built using Ionic and IBM MobileFirst is unable to login after the upgrade to iOS 9 and MF 7.1 when built via XCode and deployed to a device or through iOS simulator.
I am running this on my local WebSphere Liberty server within Eclipse so there is no SSH involved, so have followed instructions to disable bitcode and ATS from the link below with no effect.
https://developer.ibm.com/mobilefirstplatform/2015/09/09/ats-and-bitcode-in-ios9/
However the app is able to be logged in using the MF Mobile Browser Simulator, it only fails when attempting a login on the device or iOS simulator, so I'm sure this is something to do with the build process rather than an app error.
Here's the log trace I get, seems to be not finding the server IP (which I've obscured), but that is the correct IP for my local Liberty Server
Anyone else having a similar issue? Any help would be much appreciated!
2015-10-20 14:01:02.269 WorkManagement[26452:2390658] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/Eugene/Library/Developer/CoreSimulator/Devices/49A9535D-0085-4FD6-A57F-A45D0F7E7819/data/Containers/Data/Application/86E6CEFF-F2E5-4523-9763-A421A1A64659/Library/Cookies/com.WorkManagement.binarycookies
2015-10-20 14:01:02.427 WorkManagement[26452:2390658] [DEBUG] [WL_SPLASH] -[WLSplashView updateImage] in WLSplashView.m:189 :: Splash screen image is taken from UILaunchImages: Default-667h
2015-10-20 14:01:02.453 WorkManagement[26452:2390658] [DEBUG] [WL_SPLASH] -[WLSplashView updateImage] in WLSplashView.m:189 :: Splash screen image is taken from UILaunchImages: Default-667 h
2015-10-20 14:01:02.455 WorkManagement[26452:2390658] Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x7f91936521e0>.
2015-10-20 14:01:02.494 WorkManagement[26452:2391815] [DEBUG] [WL_CONFIG] -[WLConfig init] in WLConfig.m:71 :: {
"application id" = WorkManagement;
"application version" = "1.0";
authenticitySharedData = "${authenticitySharedData}";
buildtime = 1445346036;
environment = iphone;
host = "ip-XXX-XX-X-XX.eu-west-1.compute.internal";
ignoredFileExtensions = "";
platformVersion = "7.1.0.0";
port = 10080;
protocol = http;
testWebResourcesChecksum = false;
wlAppFamily = "";
wlMainFile = "index.html";
wlSecureDirectUpdatePublicKey = "";
wlServerContext = "/dlr-mxr-mobile-wm/";
wlShareCookies = "";
wlShareUserCert = false;
wlUid = "JIl9TfKyrbvMt7TN91OoYw==";
}
2015-10-20 14:01:02.496 WorkManagement[26452:2391815] [DEBUG] [WL_INIT] -[WLImpl initWL] in WLImpl.m:127 :: At first launch
2015-10-20 14:01:02.501 WorkManagement[26452:2391815] [DEBUG] [WL_INIT] -[WLImpl initWL] in WLImpl.m:153 :: Web resources should not be extracted.
2015-10-20 14:01:03.750 WorkManagement[26452:2390658] Apache Cordova native platform version 3.7.0 is starting.
2015-10-20 14:01:03.750 WorkManagement[26452:2390658] Multi-tasking -> Device: YES, App: YES
2015-10-20 14:01:03.756 WorkManagement[26452:2390658] Unlimited access to network resources
2015-10-20 14:01:03.757 WorkManagement[26452:2390658]
Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file
2015-10-20 14:01:03.762 WorkManagement[26452:2390658] [CDVTimer][wlapp] 1.286030ms
2015-10-20 14:01:03.763 WorkManagement[26452:2390658] [CDVTimer][push] 1.507044ms
2015-10-20 14:01:03.764 WorkManagement[26452:2390658] [CDVTimer][TotalPluginStartup] 3.289998ms
2015-10-20 14:01:03.806 WorkManagement[26452:2390658] Resetting plugins due to page load.
2015-10-20 14:01:04.178 WorkManagement[26452:2390658] Finished load of: file:///Users/Eugene/Library/Developer/CoreSimulator/Devices/49A9535D-0085-4FD6-A57F-A45D0F7E7819/data/Containers/Bundle/Application/B76AFE6B-15B9-4651-9230-30123351DB91/WorkManagement.app/www/default/index.html#/login
2015-10-20 14:01:06.407 WorkManagement[26452:2391782] [DEBUG] [NONE] ondeviceready event dispatched
2015-10-20 14:01:06.411 WorkManagement[26452:2391782] [DEBUG] [NONE] wlclient init started
2015-10-20 14:01:06.412 WorkManagement[26452:2391754] [DEBUG] [NONE] Read cookies: null
2015-10-20 14:01:06.413 WorkManagement[26452:2390658] log1
2015-10-20 14:01:06.413 WorkManagement[26452:2391755] [DEBUG] [NONE] CookieMgr read cookies: {}
2015-10-20 14:01:06.422 WorkManagement[26452:2391755] [DEBUG] [NONE] before: initOptions.onSuccess
2015-10-20 14:01:06.424 WorkManagement[26452:2391755] [DEBUG] [NONE] after: initOptions.onSuccess
2015-10-20 14:01:06.424 WorkManagement[26452:2391782] [DEBUG] [NONE] added onPause and onResume event handlers
2015-10-20 14:01:06.425 WorkManagement[26452:2392040] [DEBUG] [NONE] wlclient init success
2015-10-20 14:01:06.434 WorkManagement[26452:2391754] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.600 WorkManagement[26452:2390658] In $auth factory - authString : QkxMT1lEOm1heGltbw==
2015-10-20 14:01:07.600 WorkManagement[26452:2390658] username : BLLOYD
2015-10-20 14:01:07.601 WorkManagement[26452:2390658] password : maximo
2015-10-20 14:01:07.659 WorkManagement[26452:2392040] [DEBUG] [NONE] establishSSLClientAuth
2015-10-20 14:01:07.662 WorkManagement[26452:2390658] [WARN] [USER_CERT_AUTH] +[WLUserAuthManager getCertificateIdentifier] in WLUserAuthManager.m:68 :: Certificate Identifier Key: com.worklight.userenrollment.certificate:com.WorkManagement
2015-10-20 14:01:07.671 WorkManagement[26452:2390658] THREAD WARNING: ['UserAuth'] took '10.719238' ms. Plugin should use a background thread.
2015-10-20 14:01:07.672 WorkManagement[26452:2392040] [DEBUG] [NONE] establishSSLClientAuth isCertificateExists: false
2015-10-20 14:01:07.673 WorkManagement[26452:2391782] [DEBUG] [NONE] Request [/apps/services/api/WorkManagement/iphone/query]
2015-10-20 14:01:07.673 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.677 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.678 WorkManagement[26452:2390658] [DEBUG] [WL_AUTH] -[WLAuthorizationManager invokeInstanceRegistrationRequestWithCompletionHandler:] in WLAuthorizationManager.m:548 :: Call instance registration endpoint
2015-10-20 14:01:07.710 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager generateKeyPair:withPublicKeyLabel:withKeySize:] in WLCertManager.m:225 :: generateKeyPair generating keypair --> Success
2015-10-20 14:01:07.719 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.720 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] +[WLAFHTTPRequestOperationManagerWrapper requestWithURL:] in WLAFHTTPRequestOperationManagerWrapper.m:52 :: Request url is http://ip-XXX-XX-X-XX.eu-west-1.compute.internal:10080/dlr-mxr-mobile-wm/authorization/v1/clients/instance
2015-10-20 14:01:07.722 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:142 :: Request timeout is 10.000000
2015-10-20 14:01:07.723 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:221 :: Sending request (http://ip-XXX-XX-X-XX.eu-west-1.compute.internal:10080/dlr-mxr-mobile-wm/authorization/v1/clients/instance) with headers:
{
"Accept-Language" = "en-US";
"User-Agent" = "WorkManagement/1.0 (iPhone; iOS 9.0; Scale/2.00)/WLNativeAPI/7.1.0.0";
"X-Requested-With" = XMLHttpRequest;
"x-wl-app-version" = "1.0";
"x-wl-device-id" = "9263C520-E277-4D6B-A076-1D68915D78E3";
"x-wl-platform-version" = "7.1.0.0";
}
You can see the request body in the Analytics platform logs.
2015-10-20 14:01:07.731 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper start] in WLAFHTTPRequestOperationManagerWrapper.m:320 :: Starting the request with URL http://ip-XXX-XX-X-XX.eu-west-1.compute.internal:10080/dlr-mxr-mobile-wm/authorization/v1/clients/instance
2015-10-20 14:01:07.732 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] __42-[WLRequest sendRequest:path:withOptions:]_block_invoke in WLRequest.m:231 :: waiting for response... (Thread=<NSThread: 0x7f919340bb50>{number = 1, name = main})
2015-10-20 14:01:07.733 WorkManagement[26452:2390658] THREAD WARNING: ['WLAuthorizationManagerPlugin'] took '61.285889' ms. Plugin should use a background thread.
2015-10-20 14:01:07.744 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:352 :: Request Failed
2015-10-20 14:01:07.744 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:353 :: Response Status Code : 0
2015-10-20 14:01:07.746 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:354 :: Response Error : A server with the specified hostname could not be found.
2015-10-20 14:01:07.748 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.748 WorkManagement[26452:2390658] [ERROR] [WL_REQUEST] -[WLRequest requestFailed:error:] in WLRequest.m:486 :: Status code='0' error='A server with the specified hostname could not be found.' response='(null)'
2015-10-20 14:01:07.749 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] -[WLRequest requestFailed:error:] in WLRequest.m:489 :: Response Header: (null)
Response Data: (null)
2015-10-20 14:01:07.749 WorkManagement[26452:2390658] [DEBUG] [WL_AUTH] -[WLAuthorizationManager failRegistratioWithResponse:] in WLAuthorizationManager.m:866 :: Response does not contain a valid certificate and client Id. device registration failed
2015-10-20 14:01:07.753 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2015-10-20 14:01:07.759 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2015-10-20 14:01:07.762 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.774 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.781 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.781 WorkManagement[26452:2390658] [DEBUG] [WL_AUTH] -[WLAuthorizationManager invokeInstanceRegistrationRequestWithCompletionHandler:] in WLAuthorizationManager.m:548 :: Call instance registration endpoint
2015-10-20 14:01:07.812 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager generateKeyPair:withPublicKeyLabel:withKeySize:] in WLCertManager.m:225 :: generateKeyPair generating keypair --> Success
2015-10-20 14:01:07.818 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.819 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] +[WLAFHTTPRequestOperationManagerWrapper requestWithURL:] in WLAFHTTPRequestOperationManagerWrapper.m:52 :: Request url is http://ip-XXX-XX-X-XX.eu-west-1.compute.internal:10080/dlr-mxr-mobile-wm/authorization/v1/clients/instance
2015-10-20 14:01:07.820 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:142 :: Request timeout is 10.000000
2015-10-20 14:01:07.821 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:221 :: Sending request (http://ip-XXX-XX-X-XX.eu-west-1.compute.internal:10080/dlr-mxr-mobile-wm/authorization/v1/clients/instance) with headers:
{
"Accept-Language" = "en-US";
"User-Agent" = "WorkManagement/1.0 (iPhone; iOS 9.0; Scale/2.00)/WLNativeAPI/7.1.0.0";
"X-Requested-With" = XMLHttpRequest;
"x-wl-app-version" = "1.0";
"x-wl-device-id" = "9263C520-E277-4D6B-A076-1D68915D78E3";
"x-wl-platform-version" = "7.1.0.0";
}
You can see the request body in the Analytics platform logs.
2015-10-20 14:01:07.822 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper start] in WLAFHTTPRequestOperationManagerWrapper.m:320 :: Starting the request with URL http://ip-XXX-XX-X-XX.eu-west-1.compute.internal:10080/dlr-mxr-mobile-wm/authorization/v1/clients/instance
2015-10-20 14:01:07.822 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] __42-[WLRequest sendRequest:path:withOptions:]_block_invoke in WLRequest.m:231 :: waiting for response... (Thread=<NSThread: 0x7f919340bb50>{number = 1, name = main})
2015-10-20 14:01:07.823 WorkManagement[26452:2390658] THREAD WARNING: ['WLAuthorizationManagerPlugin'] took '47.751953' ms. Plugin should use a background thread.
2015-10-20 14:01:07.829 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:352 :: Request Failed
2015-10-20 14:01:07.830 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:353 :: Response Status Code : 0
2015-10-20 14:01:07.831 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:354 :: Response Error : A server with the specified hostname could not be found.
2015-10-20 14:01:07.832 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.833 WorkManagement[26452:2390658] [ERROR] [WL_REQUEST] -[WLRequest requestFailed:error:] in WLRequest.m:486 :: Status code='0' error='A server with the specified hostname could not be found.' response='(null)'
2015-10-20 14:01:07.834 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] -[WLRequest requestFailed:error:] in WLRequest.m:489 :: Response Header: (null)
Response Data: (null)
2015-10-20 14:01:07.834 WorkManagement[26452:2390658] [DEBUG] [WL_AUTH] -[WLAuthorizationManager failRegistratioWithResponse:] in WLAuthorizationManager.m:866 :: Response does not contain a valid certificate and client Id. device registration failed
2015-10-20 14:01:07.859 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2015-10-20 14:01:07.864 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2015-10-20 14:01:07.872 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
When using the MBS, you are basically being served directly by the server. The MBS is inside the server and you open the server IP or localhost.
When using a physical device or the iOS Simulator you are connecting to a "remote" hostname. It could be that the value mentioned is not being translated correctly by DNS.
You can try two things, by editing the worklight.plist file in your Xcode project:
Empty the host property; this usually then allows it to pick a value on its own and seems to work, in iOS
Replace the existing host value with the IP address instead of a hostname

trigger.io iOS Facebook apprequests incorrect parameter quotation

I'm making an apprequests using native Facebook plugin as follows:
forge.facebook.ui(
{
method: "apprequests",
title: "How well do you know your friends?",
message: "Play this friends guessing game with me. This is just like the game Guess Who with Facebook.",
to: 100005076427220
},
function(response) {
alert('succ:' + JSON.stringify(response));
}, function(response){
alert('error:' + JSON.stringify(response));
}
);
On Android everything looks fine. Here is the debug output:
[ INFO] D/Forge (11035): Native call facebook.ui with task.params: {"method":"apprequests","title":"How well do you know your friends?","message":"Play this friends guessing game with me. This is just like the game Guess Who with Facebook.","to":100005076427220}
[ INFO] D/Forge (11035): Returned: {"content":{"to[0]":"100005076427220","request":"1404036919832397"},"callid":"39281D3C-EACE-4070-937C-3BE1852DA12F","status":"success"}
Unfortunately on iOS is not. Here is the debug output:
[DEBUG] Native call: {
[DEBUG] callid = "BF08EEC1-175D-483F-846B-319721A82B04";
[DEBUG] method = "facebook.ui";
[DEBUG] params = {
[DEBUG] message = "Play this friends guessing game with me. This is just like the game Guess Who with Facebook.";
[DEBUG] method = apprequests;
[DEBUG] title = "How well do you know your friends?";
[DEBUG] to = 100005076427220;
[DEBUG] };
[DEBUG] }
[DEBUG] 2013-10-30 15:53:53.283 Forge[732:907] -[__NSCFNumber UTF8String]: unrecognized selector sent to instance 0x1cdd9c20
[DEBUG] Returning to javascript: {
[DEBUG] callid = "BF08EEC1-175D-483F-846B-319721A82B04";
[DEBUG] content = {
[DEBUG] message = "-[__NSCFNumber UTF8String]: unrecognized selector sent to instance 0x1cdd9c20";
[DEBUG] type = "UNEXPECTED_FAILURE";
[DEBUG] };
[DEBUG] status = error;
As you can see, the parameter method = apprequests; is not quoted as it is in Android
method = "apprequests"; It is not from my code but from the public plugin itself.
Is it possible that this makes the error?
I'm using Platform version v2.0.3 and Facebook module v2.0.1

Trigger.io App crashing when using forge.event.connectionStateChange.addListener

I'm trying to use forge.event.connectionStateChange.addListener from the docs. I've create and entirely empty application, added "event":true to the config.json configuration and added the following bit to the main.js:
forge.logging.info("Add JavaScript to js/main.js!");
forge.event.connectionStateChange.addListener(
function() {
alert('Device ' + (forge.is.connection.connect() ? "is" : "is not") + 'connected.');
},
function(){
alert('Erorr');
}
);
When I run the application and turn off my machine's wifi, the application crashes. I can provide more log if needed.
[DEBUG] Native call: {
[DEBUG] callid = "9B3DBB44-870E-438B-8128-07E88474DDAB";
[DEBUG] method = "launchimage.hide";
[DEBUG] params = {
[DEBUG] };
[DEBUG] }
[DEBUG] Returning to javascript: {
[DEBUG] callid = "9B3DBB44-870E-438B-8128-07E88474DDAB";
[DEBUG] content = "<null>";
[DEBUG] status = success;
[DEBUG] }
[INFO] No reload update available.
[INFO] 2013-03-04 16:59:54.725 Forge[68603:c07] +[BorderControl returnResult:]: unrecognized selector sent to class 0x2fb4a4
[INFO] 2013-03-04 16:59:54.725 Forge[68603:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[BorderControl returnResult:]: unrecognized selector sent to class 0x2fb4a4'
[INFO] *** First throw call stack:
[INFO] (0x33b6012 0x2e55e7e 0x34412ad 0x33a5bbc 0x33a594e 0x2e695c8 0x2895765 0x3339f3f 0x333996f 0x335c734 0x335bf44 0x335be1b 0x33107e3 0x3310668 0x1d99ffc 0x26e6 0x2625)
[INFO] libc++abi.dylib: terminate called throwing an exception
Sorry - our bad: this is a symptom of the same problem which was causing problems with Reload in v1.4.32.
There's a fix in v1.4.33 - please do give it a try and let me know if that works for you.

Trigger.io sencha doesn't load on iOS

I am stuck on a blank white screen while loading Trigger.io iOS with Sencha 2.
It works fine on Android, but on iOS, it just shows a blank white screen.
Here's the debug output:
[INFO] 943E7E1BD31/Library/Application%20Support/Forge/assets-AA20D894-4614-43FB-BE67-D78F05175E9B/src/index.html
[DEBUG] Returning to javascript: {
[DEBUG] event = \"internal.connectionStateChange\";
[DEBUG] params = {
[DEBUG] connected = 1;
[DEBUG] wifi = 1;
[DEBUG] };
[DEBUG] }
[DEBUG] Native call: {
[DEBUG] callid = \"C812FD5E-EFAE-4BCD-A3EE-CFB2574F70EA\";
[DEBUG] method = \"internal.hideLaunchImage\";
[DEBUG] params = {
[DEBUG] };
[DEBUG] }
[DEBUG] Returning to
[DEBUG] script: {
[DEBUG] callid = \"C812FD5E-EFAE-4BCD-A3EE-CFB2574F70EA\";
[DEBUG] content = \"<null>\";
[DEBUG] status = success;
[DEBUG] }
After hiding launch image, it's calling content = \"<null>\"; ?
It turns out Sencha 2 has a bug, it was throwing an error like this:
Error: [ERROR][Ext.viewport.Ios#undefined] Timeout waiting for window.innerHeight to change
I did some research, and it seems to be a bug relating to Safari vs. UI Web View.
To solve this problem, add this under Ext.application({
viewport: { autoMaximize: false },
Cheers

Resources