[AC-3001] Mobile Web: Cannot get ACS Cloud to work
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-03-18T18:51:56.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Studio, Titanium SDK & CLI |
Labels | acs, cloud, cloudservices, mobileweb, studio |
Reporter | Joe Falcone |
Assignee | Mauro Parra-Miranda |
Created | 2012-04-22T15:56:45.000+0000 |
Updated | 2016-03-08T07:48:01.000+0000 |
Description
Have tried this with the ACS Example app distributed with the module - the app comes up in the browser and you can try operations, and you get NS_ERROR_DOM_INVALID_ACCESS_ERR from the browser when you try to login or do anything else.
If this has something to do with cross-domain issues, we asked this question at the 2.0 meetup and the engineers in the back of the room disagreed as to whether this was fixed or not in ACS and MobileWeb. So what's the story?
I did try this with a cross-domain enabled Internet Explorer and got the same results so its not clear to me whether this is a cross-domain issue, especially since no ACS methods are being invoked in the simplest case. Tested with both Safari and Firefox on Mac.
(From Firebug Lite in Safari) ti.cloud example app Login: [INFO] ACS Request: { url: "users/login.json", verb: "POST", secure: YES, data: {"login":"konlovett","password":"foobar"} }) [INFO] POST: https://api.cloud.appcelerator.com/v1/users/login.json?oauth_version=1.0&oauth_consumer_key=...&oauth_signature_method=HMAC-SHA1&oauth_nonce=...&oauth_timestamp=1335210744&oauth_signature=... [INFO] header: {} [INFO] data: {"login":"konlovett","password":"foobar","ti_analytics":"{\"id\":\"...\",\"mid\":\"...\",\"aguid\":\"...\",\"event\":\"cloud.users.login\",\"deploytype\":\"development\"}"} POST https://api.cloud.appcelerator.com/v1/users/login....744&oauth_signature=... 200 OK 409ms Show Current User: [INFO] ACS Request: { url: "users/logout.json", verb: "GET", secure: YES, data: {} }) [INFO] GET: https://api.cloud.appcelerator.com/v1/users/logout.json?oauth_version=1.0&oauth_consumer_key=...&oauth_signature_method=HMAC-SHA1&oauth_nonce=...&oauth_timestamp=1335209493&oauth_signature=...&ti_analytics={"id":"...","mid":"...","aguid":"...","event":"cloud.users.logout","deploytype":"development"} [INFO] header: {} [INFO] data: {} [ERROR] undefined: Can't reach host GET https://api.cloud.appcelerator.com/v1/users/logout...":"cloud.users.logout","deploytype":"development"} 0 1041ms Error: NETWORK_ERR: XMLHttpRequest Exception 101 {...} ABORT_ERR 102 NETWORK_ERR 101 code 101 message "NETWORK_ERR: XMLHttpRequest Exception 101" name "NETWORK_ERR" >>>
This is with the ti.cloud Example app that resides under commonjs/ti.cloud/2.01/example. My colleague has also tested this with a built-from-scratch app that just logs in and creates a photo collection and he gets the same results.
@Joe - it is my understanding that this is no longer an issue. Can you also confirm this? Thanks
I have a similar problem - it seems like it still exists (although I'm not sure if it's the exact same issue). Hope this information will help. This is a show stopper for my development. I have used the latest 2.2.0 ti.cloud example. The application works if compiled for Android and run on the emulator (Platform 2.2 API Level 8) but not if run as mobile web (Firefox 14.0.1 on PC via Run As->Mobile Web Preview in Browser, Firefox 14.0.1 on Android (LG P970 Android 2.3.4) accessing a package at www.sancreed.co.za/admin/cloud, native Android browser also fails from the same URL), BlackBerry emulator (Curve 9300, Pearl 9100, pretty much all the others). e.message is "Can't reach host". Interestingly the cloud services do work if I use Safari on iPhone 4 (latest version of iOS, accessing the URL above), using Chrome on the desktop (accessing the URL above) and Chrome on the iPhone 4 (accessing the URL above), Web Console output below for Firefox on desktop - same issues for all the other problem platforms (I've replaced my keys appropriately): [18:05:45.456] OPTIONS https://api.cloud.appcelerator.com/v1/users/login.json?oauth_consumer_key=xxxxxxx [HTTP/1.1 406 Not Acceptable 2332ms] [18:05:45.446] [INFO] ACS Request: { url: "users/login.json", verb: "POST", secure: YES, data: {"login":"bob","password":"test"} }) @ http://127.0.0.1:8020/index.html:11198 [18:05:45.451] [INFO] POST: https://api.cloud.appcelerator.com/v1/users/login.json?oauth_consumer_key=yyyyyyy@ http://127.0.0.1:8020/index.html:11198 [18:05:45.451] [INFO] header: {"Authorization":"OAuth realm=\"\",oauth_version=\"1.0\",oauth_consumer_key=\"yyyyyyyy\",oauth_signature_method=\"HMAC-SHA1\",oauth_nonce=\"XMkOK1vhJT2HteQ\",oauth_timestamp=\"1346256345\",oauth_signature=\"nmZai22TbXmS8yEiPOzrotSlJpQ%3D\""} @ http://127.0.0.1:8020/index.html:11198 [18:05:45.452] [INFO] data: {"login":"bob","password":"test","suppress_response_codes":"true","ti_analytics":"{\"id\":\"36E4E152-047E-4609-8DF6-DF1713A8650D\",\"mid\":\"21BE3EA5-FF35-480D-90A1-705CC1CA518A\",\"aguid\":\"13532f38-6ad5-45b8-8f3f-b2d7dbc5af84\",\"event\":\"cloud.users.login\",\"deploytype\":\"development\",\"sid\":\"5794F52C-30D6-42A4-850F-1F1ABF4EA176\"}"} @ http://127.0.0.1:8020/index.html:11198 [18:05:47.786] [ERROR] undefined: Can't reach host @ http://127.0.0.1:8020/index.html:11198 [18:05:47.786] [ERROR] Can't reach host @ http://127.0.0.1:8020/index.html:11198 [18:05:47.786] [ERROR] undefined: Can't reach host @ http://127.0.0.1:8020/index.html:11198 [18:05:47.786] [ERROR] Can't reach host @ http://127.0.0.1:8020/index.html:11198
I have encountered the exact same error. Working with ACS on Chrome works (Win and Mac), on mobile browsers (Safari on Iphone/iPad) and Chrome on Android, but trying to connect with Firefox or IE gives the EXACT SAME ERRORS as the comment above.
One additional observation: when using the Ripple add-on to Chrome [a Blackberry emulator], which fakes the following User Agent for Blackberry phones, the ACS features work if I disable Cross Domain Proxy in Ripple's Settings. [I'm trying to get my app which uses ACS working on Blackberry and intend to use Ripple to package the Titanium app for distribution via the Blackberry app store]. I haven't tested them all and I don't know if this is even relevant but several of the other user agents work (e.g. below). - Mozilla/5.0 (BlackBerry; U; BlackBerry 9100; en) AppleWebKit/534.3+ (KHTML, like Gecko) Version/6.0.0.286 Mobile Safari/534.3+ - Mozilla/5.0 (BlackBerry; U; BlackBerry 9300; en) AppleWebKit/534.3+ (KHTML, like Gecko) Version/6.0.0.286 Mobile Safari/534.3+ - Mozilla/5.0 (BlackBerry; U; BlackBerry 9860; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/7.0.0.0 Mobile Safari/534.1 - Mozilla/5.0 (BlackBerry; U; BlackBerry 9700; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1 ..and even the Nokia N8, apparently: (Symbian/3; S60/5.2 Mozilla/5.0; NokiaN8-00/10.0.000; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.2
Should be fixed by CLOUDSRV-1368. Let us know if otherwise.
Closing since it's a dup.