Skip to content
This repository was archived by the owner on Nov 24, 2019. It is now read-only.
This repository was 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

@spinacius

Description

@spinacius

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions