Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example to add alarm to alarm manager - Error #126

Open
Helpquake opened this issue Jan 2, 2019 · 4 comments
Open

Example to add alarm to alarm manager - Error #126

Helpquake opened this issue Jan 2, 2019 · 4 comments

Comments

@Helpquake
Copy link

Helpquake commented Jan 2, 2019

Hi all and happy new year!!!!
I was trying to set an alarm with the following code:

var sApp = startApp.set({ /* params */
    "action":"android.intent.action.SET_ALARM",
    "noParseAction": true
}, {
    "android.intent.extra.alarm.MESSAGE":"New Alarm",
    "android.intent.extra.alarm.HOUR":17,
    "android.intent.extra.alarm.MINUTES": 30
});

sApp.start(function(success) {
    console.log(success);
}, function(error) {
    console.error(error);
});

I also added the following permission in the manifest
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>

But I get the following error:

class java.lang.NoSuchFieldException: No field android.intent.action.SET_ALARM in class Landroid/content/Intent; (declaration of 'android.content.Intent' appears in /system/framework/framework.jar)

How can I solve? I'm trying on a galaxy A7 - Android marshmallow
Thanks a lot.

@lampaa
Copy link
Owner

lampaa commented Jan 14, 2019

Hi!

Please, change noParseAction to noParse. Its my error in docs.

@Danyzzz
Copy link

Danyzzz commented Jan 14, 2019

@lampaa thanks a lot!
I found other error in docs:

sApp.start(function(success) {
console.log(success);
}, function(error) {
console.error(success);
});

inside function error there is "console.error(success)" but success is not defined.
the right solution is "console.error(error)"

@lampaa
Copy link
Owner

lampaa commented Jan 14, 2019

@Danyzzz fixed, thx)

@jrpereirajr
Copy link

I can fix this by replacing "action":"android.intent.action.SET_ALARM" by "intent":"android.intent.action.SET_ALARM".

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

No branches or pull requests

4 participants