Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (silentpush)
Viewing all articles
Browse latest Browse all 2

push notification - update localdb or Ti.App.Properties.setString with app in background

$
0
0

can I use silent push to update a localDB?

I have followed the instructions here http://docs.appcelerator.com/titanium/3.0/#!/guide/iOS_Background_Services-section-37539664_iOSBackgroundServices-SilentPush

my goal is to update localdb or use Ti.App.Properties.setString when a notification is received when the app is in background

I am trying

Ti.App.iOS.addEventListener('silentpush', function(e){
 
    // Initiate a download operation
    var db = Ti.Database.open('testDB');
 
    db.execute('CREATE TABLE IF NOT EXISTS test(testId INTEGER);');
    db.execute('INSERT INTO test (testId) VALUES (?)', "2222");
    db.close;
    console.log("SILENT PUSH");
    // Put the application back to sleep
    Ti.App.iOS.endBackgroundHandler(e.handlerId);
});

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images