Skip to content

Commit

Permalink
- Added OAauth 2 code flow
Browse files Browse the repository at this point in the history
- TiDropbox.callMethod now uses parameters
- Removed gitTio
  • Loading branch information
Astrovic committed Apr 19, 2023
1 parent 163a5bf commit 00e2f8e
Show file tree
Hide file tree
Showing 39 changed files with 2,814 additions and 446 deletions.
527 changes: 356 additions & 171 deletions README.md

Large diffs are not rendered by default.

506 changes: 357 additions & 149 deletions app/README.md

Large diffs are not rendered by default.

32 changes: 28 additions & 4 deletions app/controllers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
var TiDropbox = require("ti.dropbox").TiDropbox;
TiDropbox.init('e9tribefg77q4wg'/*<YOUR APP KEY HERE>*/, 'https://astrovicapps.com/'/*<YOUR redirect_uri HERE>*/);

TiDropbox.init({
APP_KEY: 'e9tribefg77q4wg', /*<YOUR APP KEY HERE>*/
APP_SECRET: 'dkrhmji4z14k2wf', /*<YOUR APP SECRET HERE>*/
redirectUri: 'https://astrovicapps.com/_apptest/tidropbox_cb.html', /*<YOUR OAuth2 Redirect URI SET TO DROPBOX APP CONSOLE>*/
response_type: "code", // "token" or "code". Token flow expires after 4 hours!
app_mime_scheme: "tidropbox" // *<YOUR APP MIME SCHEME HERE SET TO TIAPP.XML>*/
});

var dropboxAPIv2 = require("dropboxAPIv2").dropboxAPIv2;
var selectedMethod = "";
Expand Down Expand Up @@ -66,7 +73,7 @@ function checkToken(){
$.apiListTV.show();
}else{
$.loginBtn.logged = false;
$.loginBtntitle = "Dropbox Login";
$.loginBtn.title = "Dropbox Login";
$.apiListTV.hide();
};
$.activityBgView.hide();
Expand Down Expand Up @@ -176,7 +183,18 @@ function callMethod(e){
}else{
var blob = null;
};
TiDropbox.callMethod(selectedMethod, params, blob, onSuccessCallback, onErrorCallback);
TiDropbox.callMethod({
methodStr: selectedMethod,
paramsObj: params,
fileBin: blob,
onSuccessCallback: onSuccessCallback,
onErrorCallback: onErrorCallback,
callMethodXhrObjCallback: function(e) {
console.log("/////// current TiDropbox.xhr object //////////");
console.log(e);
console.log("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");
}
});
}else if(e.source.text === "Info"){
Alloy.createController('infoWin',{method : dropboxAPIv2[selectedMethod], selectedMethod : selectedMethod}).getView().open();
};
Expand Down Expand Up @@ -309,7 +327,13 @@ function createTest(){
i++;
if(testFiles[i]){
$.activityLbl.text = testFiles[i].methodStr + "\n" + testFiles[i].testParams.path;
TiDropbox.callMethod(testFiles[i].methodStr, testFiles[i].testParams, testFiles[i].blob, onSuccess, onError);
TiDropbox.callMethod({
methodStr: testFiles[i].methodStr,
paramsObj: testFiles[i].testParams,
fileBin: testFiles[i].blob,
onSuccessCallback: onSuccess,
onErrorCallback: onError
});
}else{
$.activityLbl.text = "DONE :)";
setTimeout(function(){
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/infoWin.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ function closeWin(e){
}

function onLoad(e){
$.wv.setScalesPageToFit(true);
$.wv.scalesPageToFit = true;
}

0 comments on commit 00e2f8e

Please sign in to comment.