Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2069] Android: Appcelerator Cloud Services - Callback not working in SDK 3.0.0.GA

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-01-28T22:14:27.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterAntonio Sandoval
AssigneeMauro Parra-Miranda
Created2012-12-21T23:01:09.000+0000
Updated2016-03-08T07:41:02.000+0000

Description

Problem : Callback from ACS response not working in SDK 3.0.0.GA Test case : var Cloud = require('ti.cloud'); Cloud.debug = true; var win = Ti.UI.createWindow({backgroundColor:'#ccc'}); var container = Ti.UI.createScrollView({ height:'100%', width:'100%', left:0, backgroundColor:'#ddd', layout:'vertical' }); win.add(container); var username = Ti.UI.createTextField({ height:'40dp', width:'80%', top:'100dp', hintText:'Username', textAligh:'center' }); container.add(username); var password = Ti.UI.createTextField({ height:'40dp', width:'80%', top:'15dp', hintText:'ContraseƱa', textAlig:'center', passwordMask: true }); container.add(password); var submit = Ti.UI.createButton({ height:'40dp', width:'80%', top:'25dp', title:'Login', textAlig:'center' }); container.add(submit); submit.addEventListener('click', function(){ if(username.value && password.value){ Cloud.Users.login({ login: username.value, //user password: password.value //user }, function (e) { if (e.success) { alert(e.users[0]); }else{ alert('Error:\\n' + ((e.error && e.message) || JSON.stringify(e))); } }); }else{ alert('Error'); } }); win.open(); Community discussion: http://developer.appcelerator.com/question/146001/error-in-callback-from-acs-with-alloy

Comments

  1. Ryan Gartin 2012-12-22

    Sent email to Wei Kong with full instructions, project files and LogCats to reproduce the same issue. He is out of the Office until Jan. 6th though. Please let me know who else needs to see these details. If you just need the logcats they are http://pastie.org/5566390 and http://pastie.org/5566396, SDK's 2.1.4 and 3.0 respectively.
  2. Ryan Gartin 2013-01-02

    Tested on Emulator itself. Why does it show no data coming back from ACS??? Please have them check logs on their side please. [INFO][ActivityManager( 88)] START {cmp=com.eagledevelopers.sigep/org.appcelerator.titanium.TiActivity (has extras)} from pid 704 [INFO][dalvikvm-heap( 704)] Grow heap (frag case) to 10.633MB for 614416-byte allocation [INFO][TiRootActivity( 704)] (main) [0,0] checkpoint, on root activity resume. activity = com.eagledevelopers.sigep.SigepBetaActivity@4136a3d8 [INFO][dalvikvm-heap( 704)] Grow heap (frag case) to 11.070MB for 281896-byte allocation [INFO][WindowManager( 88)] createSurface Window{415534d0 com.eagledevelopers.sigep/org.appcelerator.titanium.TiActivity paused=false}: DRAW NOW PENDING [WARN][InputManagerService( 88)] Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@4151f340 (uid=10021 pid=209) [INFO][ActivityManager( 88)] Displayed com.eagledevelopers.sigep/org.appcelerator.titanium.TiActivity: +3s720ms (total +3m13s628ms) [INFO][TiAPI ( 704)] ACS Request: { url: "users/show/me.json", verb: "GET", secure: YES, data: {} }) [INFO][TiAPI ( 704)] GET: https://api.cloud.appcelerator.com/v1/users/show/me.json?oauth_consumer_key=UDRvNZOqjCl1qy5gIixQY2kI4csMl1n6&suppress_response_codes=true [INFO][TiAPI ( 704)] header: {"Authorization":"OAuth realm=\"\",oauth_version=\"1.0\",oauth_consumer_key=\"UDRvNZOqjCl1qy5gIixQY2kI4csMl1n6\",oauth_signature_method=\"HMAC-SHA1\",oauth_nonce=\"0WItGJwlUH0HTJi\",oauth_timestamp=\"1357154501\",oauth_signature=\"WCKs9U2vN2TOTsRx0AlbO9CG4jg%3D\""} [INFO][TiAPI ( 704)] data: {} [INFO][ActivityManager( 88)] START {cmp=com.eagledevelopers.sigep/org.appcelerator.titanium.TiActivity (has extras)} from pid 704 [WARN][WindowManager( 88)] Failure taking screenshot for (180x320) to layer 21015 [INFO][TiAPI ( 704)] ACS Request: { url: "chats/get_chat_groups.json", verb: "GET", secure: YES, data: {} }) [INFO][TiAPI ( 704)] GET: https://api.cloud.appcelerator.com/v1/chats/get_chat_groups.json?oauth_consumer_key=UDRvNZOqjCl1qy5gIixQY2kI4csMl1n6&suppress_response_codes=true [INFO][TiAPI ( 704)] header: {"Authorization":"OAuth realm=\"\",oauth_version=\"1.0\",oauth_consumer_key=\"UDRvNZOqjCl1qy5gIixQY2kI4csMl1n6\",oauth_signature_method=\"HMAC-SHA1\",oauth_nonce=\"4aNbhFt9RzJRU5q\",oauth_timestamp=\"1357154502\",oauth_signature=\"2ioClyZs1x6zWcjfktBe1he6J4M%3D\""} [INFO][TiAPI ( 704)] data: {} [INFO][WindowManager( 88)] createSurface Window{416a1548 com.eagledevelopers.sigep/org.appcelerator.titanium.TiActivity paused=false}: DRAW NOW PENDING [INFO][dalvikvm( 88)] Jit: resizing JitTable from 4096 to 8192 [INFO][ARMAssembler( 36)] generated scanline__00000077:03010104_00008001_00000000 [ 89 ipp] (110 ins) at [0x41d78450:0x41d78608] in 6062128 ns [INFO][ActivityManager( 88)] Displayed com.eagledevelopers.sigep/org.appcelerator.titanium.TiActivity: +1s409ms FastDev [INFO] [2013-01-02 14:21:40,848] ui/handheld/ui/handheld/ChatWindow.js exists: false [INFO] [2013-01-02 14:21:40,934] get ui/handheld/ChatWindow.js: C:\Users\rg0649\My Documents\Titanium_Studio_Workspace\SigEp Beta\Resources\ui/handheld/ChatWindow.js [INFO] [2013-01-02 14:21:41,605] ui/handheld/ti.cloud.js exists: false [WARNING] [2013-01-02 14:21:41,683] get ti.cloud.js: path not found
  3. Ryan Gartin 2013-01-03

    I have done a clean install from the ground up on a new computer which has never before seen Titanium. Brand new Java 1.7_10 JDK, latest Ti Studio, 3.0GA Mobile SDK. All fresh. It still does not work. I am able to get SDK 3.0 cloud working with script below on emulator only. If I build to emulator it works, without touching anything else and building straight to device it fails (no response issue). Now I then changed SDK to 2.1.4GA and build to device. Works. It works only on device using SDK 2.1.4GA or lower. Both SDK's work on emulator on new machine, not the old one though. Using this simple code below, nothing fancy: function ApplicationWindow(title) { var self = Ti.UI.createWindow({ title:title, backgroundColor:'white' }); var Cloud = require('ti.cloud'); Cloud.debug = true; var button = Ti.UI.createButton({ height:44, width:200, title:L('openWindow'), top:20 }); self.add(button); button.addEventListener('click', function() { //containingTab attribute must be set by parent tab group on //the window for this work Ti.API.info('acs start'); Cloud.Users.login({ login: 'tesf', password: 'ajd' }, function(e) { if(e.success) { } else{ alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e))); } }); }); return self; }; module.exports = ApplicationWindow;
  4. Eduardo Gomez 2013-01-28

    Can you verify that the callbacks are working as expected. Please test on: SDK build: 3.0.2.v20130121111701
  5. Antonio Sandoval 2013-01-28

    This bug is fixed, thanks.
  6. Mauro Parra-Miranda 2013-11-24

    DUP issue.

JSON Source