Created
September 28, 2010 18:25
-
-
Save zsprackett/601490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.loadAccessToken = function(pService) | |
{ | |
Ti.API.debug('Loading access token for service [' + pService + '].'); | |
try | |
{ | |
var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirect | |
ory, pService + '.config'); | |
} | |
catch(ex) | |
{ | |
return; | |
} | |
if (file.exists == false) return; | |
try | |
{ | |
var contents = file.read(); | |
Ti.API.debug('got contents'); | |
} | |
catch(ex) | |
{ | |
Ti.API.debug('contents exception'); | |
return; | |
} | |
if (contents == null) return; | |
try | |
{ | |
Ti.API.debug('Parsing config'); | |
var config = JSON.parse(contents.text); | |
Ti.API.debug('Done parsing config'); | |
} | |
catch(ex) | |
{ | |
return; | |
} | |
if (config == null) return; | |
Ti.API.debug('Looks good 1.'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment