Hey guys!
Thanks for helping me out.
Is there any detailed tutorial how to use logger function?
I went like this which didnt work
var APPLICATION_ID = "xxx",
SECRET_KEY = "xxx",
VERSION = "v1"; //default application version;
if (!APPLICATION_ID || !SECRET_KEY || !VERSION)
alert("Missing application ID and secret key arguments. ");
init();
function init() {
Backendless.initApp(APPLICATION_ID, SECRET_KEY, VERSION);
}
Logger logger = Backendless.Logging.getLogger( contactlist);
function contacts_success(contacts) {
for (var i = 0; i < contacts.length; i++) {
console.log(JSON.stringify(contacts, null, 2));
}
}
function contacts_failed(msgObject){
alert("Failed to access contact list:" + JSON.stringify(msgObject));
}
function get_contacts() {
var obj = new ContactFindOptions();
obj.filter = "";
obj.multiple = true;
navigator.contacts.find(
[ "displayName", "name" ], contacts_success,
contacts_failed, obj);
}
btw, I got this code to work. it sends me emails but with [object Object] in the body. and it sends me a lot(thousands) emails.
First email: from: me; subject: Console log subject; body: Console log data [object Object]Second email: from: me; subject: Console log subject; body: Console log data [object Object], [object Object]Third email: from: me; subject: Console log subject; body: Console log data [object Object],[object Object],[object Object]Fourth email: from: me; subject: Console log subject; body: Console log data [object Object],[object Object],[object Object],[object Object]
and so on.
the emails stopped with “Error in contacts_success()TimeoutError: DOM Exception 23” message on iphone screen. and after tapping OK, it started again
var APPLICATION_ID = "xxx",
SECRET_KEY = "xxx",
VERSION = "v1"; //default application version;
if (!APPLICATION_ID || !SECRET_KEY || !VERSION)
alert("Missing application ID and secret key arguments. ");
init();
function init() {
Backendless.initApp(APPLICATION_ID, SECRET_KEY, VERSION);
}
var user = new Backendless.User();
user.email = "xxx@gmail.com";
user.password = "xxx";
Backendless.UserService.register(user);
function ContactFindOptions (args) {
args = args || {};
this.nID = args.nID || "";
this.strCategoryName = args.strCategoryName || "";
this.strImgFilePath = args.strImgFilePath || "";
}
var ContactFindOptionsObject = new ContactFindOptions();
var savedContactFindOptions = Backendless.Persistence.of( ContactFindOptions ).save(ContactFindOptionsObject);
function contacts_success(contacts) { for (var i = 0; i < contacts.length; i++)
try
{
var data = [];
for (var i = 0; i < contacts.length; i++) {
data = {
name: contacts.name && contacts.name.formatted,
numbers: contacts.phoneNumbers,
};
var bodyParts = new Bodyparts();
bodyParts.textmessage = " Console log data " + data ;
bodyParts.htmlmessage = "";
var attachments = [""];
var emailIdToSend = "xxx@gmail.com";
Backendless.Messaging.sendEmail("Console log Subject", bodyParts, [emailIdToSend], attachments );
}}
catch(err)
{
alert('Error in contacts_success()' + err.message);
}
}
function contacts_failed(msgObject){
alert("Failed to access contact list:" + JSON.stringify(msgObject));
}
function contacts_failed(msgObject){
alert("Failed to access contact list:" + JSON.stringify(msgObject));
}
function get_contacts() {
var obj = new ContactFindOptions();
obj.filter = "";
obj.multiple = true;
navigator.contacts.find(
[ "displayName", "name" ], contacts_success,
contacts_failed, obj);
}
[url=https://community.onsen.io/topic/602/how-to-upload-device-s-console-log-to-database-or-backend/13#]reply[/url] [url=https://community.onsen.io/topic/602/how-to-upload-device-s-console-log-to-database-or-backend/13#]quote[/url] [url=https://community.onsen.io/topic/602/how-to-upload-device-s-console-log-to-database-or-backend/13#] [/url]0 [url=https://community.onsen.io/topic/602/how-to-upload-device-s-console-log-to-database-or-backend/13#] [/url]