Skip to content
This repository has been archived by the owner on Nov 24, 2019. It is now read-only.

If application is in background or not running AlarmService doesn't trigger #76

Open
spinacius opened this issue Sep 4, 2016 · 0 comments

Comments

@spinacius
Copy link

Hello! I am trying to use this module to provide an agenda events-scheduler to my application.

I have added a service.js file which is executed when the AlarmService triggers:

var json = JSON.parse(Ti.Android.currentService.getIntent().getStringExtra("customData"));
var requestCode = "" + json["requestCode"];
playAlarmSound();
Alloy.createController("_agenda_alarm", {requestCode: requestCode}).getView().open();


function playAlarmSound() {

    var player = Ti.Media.createSound({
        url : "audio/alarm.wav",
        allowBackground: true
    });

}

Basically I want to open a custom modal window where i can get input from the user. My problem is that when the application is in background or not running the AlarmService is not triggered. When the app is in background i would like that the AlarmService restores it in foreground and runs the custom code defined in my service, on the other hand if the app is not running i would like that at trigger time the AlarmService starts the application and runs the custom code of the service.
Is this possible? How can i do that?

I am using Titanium SDK 5.3.0

Thanks in advance for any help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant