Open carlosrd opened 9 years ago
It looks as though Titanium no longer supports this behavior has it causes an application crash. It works in a purely native app though. If anyone has an idea on how to work around this crash please let me know and I'm happy to accept a PR.
It just bite me today! I got around like this:
index.js
function isBootTime() {
var fl = Ti.Filesystem.getFile('file:///proc/uptime'), b, t;
try {
if (fl && ( b = fl.read())) {
t = b.text.split(' ')[0];
fl = b = null;
return (t < 60);
}
} catch(er) {
}
return false;
}
if (isBootTime()) {
return $.win.close();
}
Hi, any news on that ? Still seems to not be working. Thanks
@julien9999 Have you tried this one? https://github.com/azwan082/nc-boot-completed
You could edit it and adapt to your needs. :)
@benbahrenburg ,
It looks as though Titanium no longer supports this behavior has it causes an application crash. It works in a purely native app though.
You're right. I read an article from the docs https://docs.appcelerator.com/platform/latest/#!/guide/Android_Broadcast_Intents_and_Receivers stating ,
Note that Titanium only supports programmatically creating and registering broadcast receivers. Titanium does not support declaring a receiver in the Android manifest.
I know this is old, but do you happen to know any remedy for this?
Hi!
I've tried the BootReceiver function included on Android.Tools but it doesn't work as I expected. There is an option in the meta-data parameters to set the restart to background or foreground (sendToBack).
The problem is it doesn't matter the value on sendToBack: Always restart the app on foreground!
I tested the app on a Nexus 4 running Android 4.4.2 and I used Titanium SDK 3.4.1 to develop it.