• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Local Notification

New Here ,
Feb 07, 2014 Feb 07, 2014

Copy link to clipboard

Copied

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!

TOPICS
Development

Views

7.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 07, 2014 Feb 07, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 18, 2014 Mar 18, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 18, 2014 Mar 18, 2014

Copy link to clipboard

Copied

The distriqt boys are extremely quick to respond, but it’s a little before 4 am for them at the moment. If they don’t reply to your post in their general discussions you could raise it as a github issue. Then they will see it quickly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 18, 2014 Mar 18, 2014

Copy link to clipboard

Copied

Hi Colin,

Thanx for the advice.

I already wrote them 2 emails during the last week, but unfortunatly I am not getting any response from them 😕

Mabye I will try raising as a github issue

I really love working with their extensions, but unfortunatly it is a show stopper for us if the sound is not working.

I actually also tried this extension


http://juankpro.com/wordpress/2012/05/10/local-notification-ane-source-code/

This is very simple...it works...but again the sound does not work. So im starting to suspect that something has changed in newer iOS version that affects the notification sound

So we have tried to make a native ObjC app with local notifications and here the sound works fine.....Its wierd 🙂

/H

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 18, 2014 Mar 18, 2014

Copy link to clipboard

Copied

I use the Distriqt local notifications and also don't get any sound.  I haven't looked in to it any further as it isn't critical for me.  I just assumed that the notification setting defaults to no sound?  Yeah - I just looked in my iOS Settings > Notification Centre, found my app and sounds are turned off for notifications from my app.  It must do this by default until the user changes it manually? 

The other thing that I have found is that notifications display as 'banner' by default, and it would be really nice to be able to specify/suggest to the OS how they should display (e.g. alert).  The user could always go and change it later, but it would be nice to specify the initial default setting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 18, 2014 Mar 18, 2014

Copy link to clipboard

Copied

Hi Ohla,

The sounds work for me on both platforms ( iOS and Android ).

2 Things to look into:

1) It may not be finding the sound file in the *.ipa.

Make sure the sound file is in the root of the ipa ( should be the 2nd folder from the top:  YourAppName.app folder ).  To make sure, just rename the *.ipa to *.zip, and open the file.  The file "fx05.caf" should be in the *.app folder, where the main swf is.

If you package your file with adt.bat, just add it to the adt line, like this

adt -package -target ipa-test .... fx05.caf - extDir .caf -extdir C:\projects\extentions\distriqt\release-v1.36\notifications\lib

2) The other thing that can be happening, as strange as it seems, is that the local notification sound engine may have crashed on your iOS device.  There are lot's of threads on the internet about this software issue ( including on youtube ).  So, your lack of sound may not be due to the ANE, but to an OS bug on the device.  I suggest you try the ANE on a different iOS device.  I have this problem on my iPad 1 / OS 5.1.1, but not on my iPod Touch!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 19, 2014 Mar 19, 2014

Copy link to clipboard

Copied

Hi All,


First off all let me express how impressed I am with the response rate in here.

Thanx alot everyone.

After Pea's advice I found out that sound was off for my app in the "notification center". It seems like this is the default setting.
This if ofcourse not ideal as the user would have to be asked to go into the notification center to change that setting when he first runs the app.

When we did a ObjectiveC test app for local notifications this did not seem to be the case. Any idea if this is something specific to AdobeAir based apps or/and if there is any workaround ?

Thanx again everyone for all your replies.

/Henrik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 19, 2014 Mar 19, 2014

Copy link to clipboard

Copied

I'm raising a ticket with Distriqt also - there are other defaults that would be good to be able to specify.

This stack overflow question asks the same thing, but in ObjC - seems no defintiive answer, but same problem natively.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 13, 2014 Oct 13, 2014

Copy link to clipboard

Copied

ohla,

I came across your post here regarding Distriqt's local notifications ANE and had a question...

you mentioned that you were "trying to have a sound play when the user receives a local notification (app is closed or in background)..."

How did that turn out for you?   I am also trying to do the same and it works brilliantly on Android but on iOS I dont get any notification if the device is ON but the app is in the background or the device is in a suspended state i.e. the screen dimmed and in sleep mode, so to speak...

Im trying to avoid push notifications and am hoping I can get background local notifications to work.

Thanks for any feedback you can provide from  your project / experience with this issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 15, 2014 Oct 15, 2014

Copy link to clipboard

Copied

Hi tamak1234,

Would you be able to give me some additional information about what you are experiencing? You should be able to play a sound with your delayed notification on iOS.

What version of iOS are you testing on?

Cheers     

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 17, 2014 Oct 17, 2014

Copy link to clipboard

Copied

Thanks, Michael...

1.) testing on an iphone 5, running ios8... and an iphone 4s running ios 7.1.2 and htc one running android 4.4.2 --- development machine is a macbook pro running Mavericks

2.) using flashbuilder 4.6 premium, apache flex 4.12.1.    the notification center is set to play sound for the test app, the caf file is packaged / included (using the default .caf thats included, but ultimately would want my own audio file which I would covert to caf format.)

3.) otherwise notifications work fine on both ios and my android test device...  on android I get the native / os settings, user-defined notification audible sound, I noticed - so NEITHER ios or android plays the fx05.caf thats included with the ANE example.  on ios I get vibration and notification displayed -- just NOT the sound.

I can email you my mxml document / as3 code example (a bare bones example the is producing the same result as my larger client project where I first noticed it.)... or I can give you other info that I may be lacking in this reply -- just let me know.

Thanks so much for your help with this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 17, 2014 Oct 17, 2014

Copy link to clipboard

Copied

Hi,

I'm just about to release an update for iOS that fixes several issues, it would be good if you could test this version and let me know if you're still experiencing the problem? It will be in github later today.

Regards,

Michael    

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 17, 2014 Oct 17, 2014

Copy link to clipboard

Copied

awesome. thanks and I'll look out for it on github!

On Fri, Oct 17, 2014 at 6:08 PM, michaelarchbold <forums_noreply@adobe.com>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 18, 2014 Oct 18, 2014

Copy link to clipboard

Copied

Michael,

I just tried it (just replacing the ANE with the new .ane file from the lib folder -- not making any changes to the actionscript or MXML at all -- let me know if theres changes I need to make though)...

I get the following error when attempting to "Export Release Build" from flash builder... (see image below)Screen Shot 2014-10-18 at 12.38.30 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 18, 2014 Oct 18, 2014

Copy link to clipboard

Copied

Hi,

Please update to the latest AIR beta and use the iOS 8 SDK. As this was a fix for iOS 8 you'll need to update as well.

Cheers

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 18, 2014 Oct 18, 2014

Copy link to clipboard

Copied

I updated to the latest air 15 beta and have flash builder pointed to the ios 8 sdk and two things I can report from tests on an iphone 4s running ios 7.1.2:

1.) when I use the NEWer copy of the ANE that I got from github yesterday, the install process works fine, but when I tap the icon (on iphone) the app launches, to a black screen for a split second, then goes away (returns to ios home screen) aburptly, the app minimizes and if I double-tap the hardware 'home' button at bottom of phone, I can see the app is listed as one of the currently running apps (represented by a 'black' screen along with other apps that are currently running), and if I select it to try to give the app FOCUS and bring it into the foreground it once again goes full black screen then minimizes again.

2.) if I go back to the previous ane it works just as it did before, notification works but just doesn't play the .caf audio file.

not sure what else to try on my end but will test on an iphone 5 shortly and see if results are same there since it runs ios8.  my purpose in keeping this old iphone4s running 7.1.2 is to have an idea how the app will run for old devices folks may have who might have chosen to NOT upgrade to ios8 (since ios8 apparently runs horribly on the 4s)... but if that turns out to be the issue (that the ios version just isnt fully supported) then I'll ditch the idea of backwards compatibility and stress that ios 8 or better is required.

If it helps further diagnose this I sent via email (I have your email address from some earlier support you provided when I bought the ane package initially) Friday with a simplified mxml document that shows how I am attempting to use the notifications ane (the as3 code I wrote).

Thanks again for your help with this... Im hoping I can work this out and submit my app Monday.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 18, 2014 Oct 18, 2014

Copy link to clipboard

Copied

Oh right,

Can you log an issue in github and I'll track this through there for you?

Cheers    

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 19, 2014 Oct 19, 2014

Copy link to clipboard

Copied

Hmmm,

Seems like it might have been a corrupted build. I've updated github again, can you try it now?    

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 19, 2014 Oct 19, 2014

Copy link to clipboard

Copied

Michael,

I just added the issue in github  -- https://github.com/distriqt/airnativeextensions/issues/240   ... I included a bare-bones mxml / as3 example of how Im using the ane as well in case theres issues with that...

Let me know if theres anything else I can do to help out as we try to figure this out.  for now I'll launch my app / submit for approval without the audible sound working and just rely on visible notification badge and the vibration of the device.

Thanks for your hard work on this and the great customer support!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 19, 2014 Oct 19, 2014

Copy link to clipboard

Copied

Thanks tamak1234

I'll follow it up there with you.

Cheers,

Michael

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 19, 2014 Oct 19, 2014

Copy link to clipboard

Copied

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 ) !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 22, 2014 Oct 22, 2014

Copy link to clipboard

Copied

LATEST

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 19, 2014 Oct 19, 2014

Copy link to clipboard

Copied

Tamak1234,

Just an idea:

Have you tried running Adobe Scout while your app is launching?  The Trace Log window may give you some useful hint ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 19, 2014 Oct 19, 2014

Copy link to clipboard

Copied

Thanks, AsterLUXman -- Michael was right, turned out to be a corrupted build and works fine now in tems of INSTALLING and Running the air app... but the original issue -- the notification audible sound (fx05.caf) still isnt playing at all.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines