+ Start a Discussion
DannyK89DannyK89 

Mobile SDK Workbook help

Ok so I have been following along with the work book. I skipped the ISO and android applications and tried to do the HTML 5 application. I am doing this in my sandbox org. I have changed the login.js file so that it logs in using the test.salesforce.com url. All the oauth stuff seems to work, however when it gets to the point to show the albums all i get is the loading wheel. I'm not sure when the problem is. Thanks. 

joshbirkjoshbirk

Did you get past Step 3?  That's where the actull retrieve/display of Albums takes place.

 

If so, can you edit oauthcallback.html to alert the oauthResponse instead of closing?  Like so:

 

 

window.opener.sessionCallback(oauthResponse);
alert(oauthResponse);
//window.close();

 

 

 

And make sure that alert appears with a token like string?

DannyK89DannyK89

No I didn' t get past step three. I tryed to move forward but that didn't work. So I guess I am stuck at step 3.

joshbirkjoshbirk

And the JavaScript from above?  Does editing oauthcallback.html reveal anything?  Need to confirm that it is hitting your localhost and that the token is getting set.

Oliver WoolgarOliver Woolgar

For Windows Environments (Tested using  WAMP Server, and possibly apache)...

 

One thing to check is if the php server or web server  has the php_curl extension enabled.

 

If this is causing your problem within your one of the webserver log files you might see a log entry like this:

 

"Call to undefined function curl_init() in x:\???\???\proxy.php" where the path is our web application path.

 

To solve this problem open up the php.ini file and find a line similar to this.

";extension=php_curl.dll"

 

If you find this line it may  be commented by using  preceeding ";".  This means php_curl is not enabled. (This is the default setting). If so uncomment save the php.ini file and then restart your web server. You may have solved your problem.

 

Hope this helps.

DannyK89DannyK89

I made the java script change and there was no change. The window that I use for oauth closes even with the commented out part that closes the window. 

Max ShirazMax Shiraz

I have the same problem. The HTML5 example does not work, same problem as described by DannyK89. I tracked the problem down to the  forcetk.Client.prototype.ajax method which invokes the JQuery ajax call. The error message returned from that call is simply "parserror". The "loading wheel" graphic contines to display bu the scripts have finished processing.

 

Are the *any* working examples of a HTML5 mobile SDK??? No-one seems to offer an example that works out of the box.

joshbirkjoshbirk

The HTML5 example should work fine if the PHP proxy has been setup - but there are a lot of different ways of configuring php.  

 

If you are having these kinds of problems, can you post your PHP setup and config?  Are you using WAMP/MAMP/etc.  And can you confirm that curl itself is enabled.  Without curl enabled, the forceTK library will just get a PHP error back instead of JSON object, which it cannot parse (hence, parse error).