Skip to main content
Known Participant
February 7, 2014
Question

Local Notification

  • February 7, 2014
  • 2 replies
  • 9314 views

hello,

I am developing an App with Adobe Air and I need someway (ANE) to send a LOCAL notification.

I do not want to use Push notification, only LOCAL.

any suggestion on what ANE I should use?

I would also like it work for both platforms, android and IOS

Thanks in advance!

This topic has been closed for replies.

2 replies

marchbold
Inspiring
May 8, 2014

Hi all,

Glad to hear the positive feedback on our local notification extension.

As to the sound problems, it is due to the default setting for the application being turned off. Unfortunately there's no way to control this setting programmatically (at the moment at least) and I haven't been able to figure out why some apps have the default notification sound off and some not. It is happening to native applications as well so it's not an AIR related issue.

So the best advice I have at the moment is to be aware of it and make it a part of your help / guide for your application.

Cheers,

Michael

air native extensions // https://airnativeextensions.com
Inspiring
February 7, 2014

The best one, in my op, is Distriqt's local notif ANE:

http://distriqt.com/native-extensions

For local notifications, I recommend Distriqt's local notification ANE ( Android+iOS), since it's the ony one I know which uses the AlarmManager api on Android ( Koesler's Android Local notif doesn't last time I checked ).  This means that on Android, the local notification can be scheduled for a later time ( same as iOS ), and will fire EVEN if the app is either minimized or has been closed properly ( meaning closed by the OS, or by the user via NativeApplication.nativeApplication.exit() -- note: force-stopping is the exception and cancels scheduled notifications on Android ).  You can also have the local notification play a custom sound which is up to 30 secs long ( mp3s on Android / cafs on iOS).  Sound will be audible on both platforms, even if the device is suspended.  This is ideal for an alarm-clock, for example.  The downside of local notifs is that they don't execute code, per se, however they can pass a data payload ( text ) back to the app, if it is running ( even if minimized ), which a handler can receive to do stuff.

A bit more info about this ANE here:

http://forums.adobe.com/message/6095693#6095693

Participant
March 18, 2014

Hi Aster         

I have been trying out the Distriqt extensions. The local notification one works quite well.

Only things is that is does not play the alert sound when receiving the alert.

Im trying to have a sound play when the user receives a local notification (app is closed or in background)

But it does not play a sound. My other apps of different sorts are doing alert sounds just fine

Im using this code:

notification.vibrate = true;
notification.playSound = true;
notification.soundName = "fx05.caf";

on Iphone5, ios 7

And i have added the sound fil to the "included files"

Any experience with this ?

Thanx in advance

Henrik

Known Participant
October 22, 2014

Tamak1234,

Did you try the ANE on a different iOS device?

Possibly, the inaudible local notification sound may be due NOT to the ANE, but to an OS bug on the device, as previously mentioned. There are lot's of threads on the internet about this software issue ( including on youtube ).  In my case, I had this problem ( inaudible local notif sound ) on my iPad 1 / OS 5.1.1, but not on my iPod Touch ( same code / same ANE ) !


Thanks, 

it seems to have been some sort of issue that required that I update to the latest AIR beta and add the ios SDK to the build in flash builder... After Michael updated the ane and posted the update to GitHub and suggested I update AIR and add ios sdk it worked for me.

I had indeed tried it on multiple iphones, one running ios8 and one running 7.1.2  -- I hope to add an ipad or two to my test devices next week and cant wait!