回答

0

使用標準的網絡過程http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Network.HTTPClient聲明網絡通話,並使用谷歌日曆API https://developers.google.com/google-apps/calendar/v3/reference/

例如獲取用戶日曆

var url = " https://www.googleapis.com/calendar/v3/users/me/calendarList"; 
var client = Ti.Network.createHTTPClient({ 
    // function called when the response data is available 
    onload : function(e) { 
     Ti.API.info("users calendars: " + JSON.stringify(this.responseText)); 
     alert('success'); 
    }, 
    // function called when an error occurs, including a timeout 
    onerror : function(e) { 
     Ti.API.debug(e.error); 
     alert('error'); 
    }, 
    timeout : 5000 // in milliseconds 
}); 
// Prepare the connection. 
client.open("GET", url); 
// Send the request. 
client.send(); 
相關問題