I can successfully authenticate Dropbox in my Phonegap app the first time, but I keep getting a new one if the button is pressed again, why is that? Shouldn't it return the same token again?
And there is a blank screen which appears. I have seen many dirty solution to change the inappbrowser.js code itself. this is problematic, since the plugin can't be edited if I have to compile the app for multiple platforms from an online build service.
What is your suggestion for a proper implementation, where authorization happens only once if successful and stored indefinitely in the app without concern if the app cache is cleared by user and a blank page is also not displayed?
At present I have this basic implementation, in index.html
<button onclick="authenticateWithCordova()">Authenticate</button>
<script>
function authenticateWithCordova()
{
var dbx = new window.Dropbox.Dropbox({ clientId: 'xxxxxxxxxx' });
dbx.authenticateWithCordova(AuthSuccess,AuthFail);
}
function AuthSuccess(accessToken)
{
localStorage.accessToken = accessToken;
console.log(accessToken);
}
function AuthFail()
{
alert("Auth Fail");
}
</script>