Search Unity

Easy Local Android Notifications

Discussion in 'Assets and Asset Store' started by CarlosFM, Jul 2, 2013.

  1. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi Ricardo,

    I just replied to your email. Hopefully the issue will be solved now :)

    Cheers
     
  2. AdrianC

    AdrianC

    Joined:
    Apr 22, 2012
    Posts:
    150
    Thinking about buying this plugin, but I'm a bit concerned about compatibility issues with Prime31 plugins. We're currently using a few of their plugins and some override the main activity. Does this plugin do that as well, because if it does, that will be a problem for us.

    Thanks
     
  3. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi AdrianC,

    You have nothing to worry about, the plugin does not extend the main activity, so you can safely use it with any other plugin!
     
  4. AdrianC

    AdrianC

    Joined:
    Apr 22, 2012
    Posts:
    150
    Got it, works well, extremely easy integration. Highly recommended for anybody who needs local notifications on Android.
     
  5. Coralie_V

    Coralie_V

    Joined:
    Jul 1, 2014
    Posts:
    8
    Hi I wanted to ask if the application need to be in background for the notifications to work ?
     
  6. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi Coralie_v,

    No, the app can be closed and the notifications will still be sent. The system works by creating a small service that contains an alarm; when it goes off it fires the notification, which will reopen your app upon tapping.

    Cheers
     
  7. Coralie_V

    Coralie_V

    Joined:
    Jul 1, 2014
    Posts:
    8
    Thanks for the answer CarlosFM ! Does the service run until it fires the notification ? Sorry for all those question but I try to find the best way to have local notification for my game because I still hesitate to use server push notification for that.
     
  8. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    No problem.

    Yes, the service runs until the notification is fired. If it's a repeating notification, it'll still be there to fire periodically.
     
  9. Coralie_V

    Coralie_V

    Joined:
    Jul 1, 2014
    Posts:
    8
    So now i use your plugin. I wanted at the start of the game get all notifications that are running in OS to compare it with those i saved in player pref. I don't find something to access notification like in IOS NotificationServices.GetLocalNotification(id) is there an easy way to do this or it can't be done ?
    Thank you
     
  10. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    At the moment we don't have a GetLocalNotification(id) method in ELAN, although we are considering adding it to the roster -if there is a strong use case for it.

    Currently ELAN returns an ID when you create a notification, so you can store this separately for future references. You can then cancel that notification using the same ID (or calling the cancel method on the ELANNotification if you are using ELAN 1.1). Please note that IF the notification was generated within the current app execution (current session) ELAN can cancel it automatically by calling CancelAllNotifications method.
     
  11. Coralie_V

    Coralie_V

    Joined:
    Jul 1, 2014
    Posts:
    8
    I save all notification ID in playerPref to have it for the next session. But in the next session I don't know if the notification launch itself or not, so I don't know if I must keep this ID in my playerPref. That is why I use GetLocalNotification at game start to delete not found ID from playerPref.
    But I guess instead of that I can also save notification's trigger date, so I can remove expired ID.
     
  12. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    @Coralie_V: I see your point. We are always trying to incorporate new functionality onto the plugin, and will study adding the use case you mentioned.

    Cheers
     
  13. Coralie_V

    Coralie_V

    Joined:
    Jul 1, 2014
    Posts:
    8
    I read somewhere that local notification on Android are lost when the phone is restarted. Is it true with your plugin ?

    EDIT : I answer my own question, and it is yes notifications are cleared when the device restart. So I guess it is another use case for having a getNotification function so we can know if we should reschedule them.
     
    Last edited: Jul 11, 2014
  14. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi,

    Is it possible to use a DateTime object to set the firedate of the notification? If not this could be a handy feature!

    Also:
    I'm creating an app where the user has a list of buttons. Each button in the list can have a notification attached to it. The list of buttons is dynamic. I've created a function to create a local notification, but how would I cancel the notification if the user deletes a button from the list? Is there a function in ELAN for that?
     
  15. Coralie_V

    Coralie_V

    Joined:
    Jul 1, 2014
    Posts:
    8
    I guess you can use CancelLocalNotification if I understand right.

    I have a question of my own. How can we know if the app is launch via a local notification ?
     
  16. marcelomunoz

    marcelomunoz

    Joined:
    Jul 24, 2014
    Posts:
    1
    Hi Carlos,
    I got the following error

    /AndroidRuntime(28373): Shutting down VM
    W/dalvikvm(28373): threadid=1: thread exiting with uncaught exception (group=0x41ad7da0)
    E/AndroidRuntime(28373): FATAL EXCEPTION: main
    E/AndroidRuntime(28373): Process: xxxxxx, PID: 28373
    E/AndroidRuntime(28373): java.lang.RuntimeException: Unable to start receiver com.CFM.ELAN.TimedAlarm: java.lang.NullPointerException: name == null
    E/AndroidRuntime(28373): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2521)
    E/AndroidRuntime(28373): at android.app.ActivityThread.access$1700(ActivityThread.java:157)
    E/AndroidRuntime(28373): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)
    E/AndroidRuntime(28373): at android.os.Handler.dispatchMessage(Handler.java:102)
    E/AndroidRuntime(28373): at android.os.Looper.loop(Looper.java:157)
    E/AndroidRuntime(28373): at android.app.ActivityThread.main(ActivityThread.java:5293)
    E/AndroidRuntime(28373): at java.lang.reflect.Method.invokeNative(Native Method)
    E/AndroidRuntime(28373): at java.lang.reflect.Method.invoke(Method.java:515)
    E/AndroidRuntime(28373): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
    E/AndroidRuntime(28373): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
    E/AndroidRuntime(28373): at dalvik.system.NativeStart.main(Native Method)
    E/AndroidRuntime(28373): Caused by: java.lang.NullPointerException: name == null
    E/AndroidRuntime(28373): at java.lang.Class.classForName(Native Method)
    E/AndroidRuntime(28373): at java.lang.Class.forName(Class.java:251)
    E/AndroidRuntime(28373): at java.lang.Class.forName(Class.java:216)
    E/AndroidRuntime(28373): at com.CFM.ELAN.TimedAlarm.onReceive(TimedAlarm.java:40)
    E/AndroidRuntime(28373): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2514)
    E/AndroidRuntime(28373): ... 10 more
    I/Process (28373): Sending signal. PID: 28373 SIG: 9
    D/CrashAnrDetector( 829): processName: xxxxxx
    D/CrashAnrDetector( 829): broadcastEvent : xxxxxx data_app_crash
    W/ContextImpl( 829): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1468 com.android.server.analytics.data.collection.application.CrashAnrDetector.broadcastEvent:296 com.android.server.analytics.data.collection.application.CrashAnrDetector.processDropBoxEntry:254 com.android.server.analytics.data.collection.application.CrashAnrDetector.access$100:60 com.android.server.analytics.data.collection.application.CrashAnrDetector$1.onReceive:102
    I/ActivityManager( 829): Process xxxxx (pid 28373) (adj 9) has died.

    Can you help me?
     
  17. Coralie_V

    Coralie_V

    Joined:
    Jul 1, 2014
    Posts:
    8
    Hi,

    I realised that their are no played sound or vibration on an Android 2.2.3 while there are some on 4.4.4.
    None are put to mute and both make sound on push notification.

    Any ideas ?
     
  18. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Apologies for the very delayed answers! I was on holidays, and Unity for some reason wasn't notifying me of the forum posts :(

    @marcelomunoz: We are working on solving this issue, it seems it was introduced in the latest version. We'll keep you posted.

    @Coralie_V: So on a device running Android 2.2.3 there are problems with vibrations / sounds? We have tested as far back as 2.3, so this may be a retrocompatibility issue. Could you confirm that's te issue? I got mixed messages from your post.

    Cheers
     
  19. Helmut Duregger

    Helmut Duregger

    Joined:
    Mar 17, 2010
    Posts:
    18
    @CarlosFM: Here it looks like the error
    java.lang.RuntimeException: Unable to start receiver com.CFM.ELAN.TimedAlarm: java.lang.NullPointerException: name == null
    only happens at subsequent times that the user taps on the notification. The first time it seems to work fine. After that you need to reinstall the app to make it work again.

    Hope the info helps.
     
  20. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Thanks Helmut, we're currently working hard on solving this, and the info is greatly appreciated.
     
  21. dio_qg

    dio_qg

    Joined:
    Aug 12, 2014
    Posts:
    2
    Hey Carlos, when I try the plugin, logcat says

    AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='FireNotification' signature='(Lcom.unity3d.player.UnityPlayerNativeActivity;Ljava/lang/String;Ljava/lang/String;I)V' in class Lcom/CFM/ELAN/ELANManager;

    I decompiled ELANManager.class and the FireNotification is just there. Don't know why it couldn't find it. Besides, why is the log saying Lcom/CFM/... instead of com/CFM/... ?
     
  22. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    @dio_qg: I believe you must me the same person I'm contacting via email, right? ;P

    Just as an extra bonus: the L before the package name is something the java intermediate language does, so it's not a problem, is the way is supposed to read :)
     
  23. Coralie_V

    Coralie_V

    Joined:
    Jul 1, 2014
    Posts:
    8
    @CarlosFM Hi, I tested today and it seems that I was wrong about the sound, it played. But I didn't have any vibration on android 2.3.5 HTC desire HD and android 2.3.3 on Samsung galaxy S2.

    EDIT : My mistake on nexus 7 I received a crash that say that I don't have permission to vibrate. By checking manifest I realise that I forgot this permission. So it's ok it works, it was just weird that the application doesn't crash on those device and that vibration works on other ...
     
    Last edited: Aug 19, 2014
  24. elasolova35

    elasolova35

    Joined:
    Dec 26, 2013
    Posts:
    3
    Hello,
    Are the java source files include in current version? I couldn't find them in the package.
    Also, the repeater does not seem to work. It fires the first one successfully, but the others do not reach. Can the small time interval be the problem? (or rather the delay in repeater should be bigger than some limit?) Thanks.
     
  25. elasolova35

    elasolova35

    Joined:
    Dec 26, 2013
    Posts:
    3
    So I did my reaserch.

    From android docs:
    "Note: as of API 19, all repeating alarms are inexact. If your application needs precise delivery times then it must use one-time exact alarms, rescheduling each time as described above. Legacy applications whose targetSdkVersion is earlier than API 19 will continue to have all of their alarms, including repeating alarms, treated as exact."

    Assuming that AlarmManager is used the repeating will be very inexact.
     
  26. Kiwidu

    Kiwidu

    Joined:
    Aug 20, 2014
    Posts:
    2
    Hi,

    I have a question concerning the black screen bug. Sending local notifications seems to work pretty nice, but clicking on the notification in android leads still to a black screen in my case. I use the latest version of ELAN and Unity 4.3.1f1. Is there any new information about this behavior?

    I also figured out that the removed “UnityPlayerNativeActivity” entries in the android manifest can lead to some exceptions when there are other plugins or libraries which are using native calls.

    Thank you in advance for any hints about the black screen bug :)
     
  27. dio_qg

    dio_qg

    Joined:
    Aug 12, 2014
    Posts:
    2

    Yup we got it work my friend. Thanks a lot for your help!~
     
  28. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    @elasolova35: the code is available upon request, after purchasing the package.

    Thanks for the note about the alarms, we'll investigate the impact on the plugin

    @Kiwidu: the black screen issue is most certainly a problem with the manifest. Are you using the latest version of the plugin? It ships with a guide that explains how to solve this particular issue. Let me know if you are having problems with it, my contact is: carlos.fernandez.musoles (at) gmail (dot) com
     
  29. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    @elasolova35: as per the "inexact" word used by Android; it may be a little misleading, this does not mean the alarm will not happen around the time it has been specified; it actually refers to the type of alarm being set. There are two types of alarms:

    -Exact: they fire off exactly at the precise moment they are scheduled. They do have a toll on battery consumption
    -Inexact: android batches alarms that fire off at similar times and fires them together; they are lighter, performance-wise.

    While it may be inconvenient for some of your use cases, the fact that most alarms are inexact isn't a bad thing, it's just what android does to keep batteries alive. Though I understand your concern and we will consider adding the possibility of having exact alarms future releases.

    Cheers
     
  30. Kiwidu

    Kiwidu

    Joined:
    Aug 20, 2014
    Posts:
    2
    Hi, as I figured out the black screen bug also occurs with other plugins providing local notifications for android. I found something here in the unity forum that describes exactly the same problem (http://forum.unity3d.com/threads/open-unity-application-using-notification-in-statusbar.172700/) and it seems that they have found a solution (http://stackoverflow.com/questions/15217463/launch-application-from-statusbar-without-re-creation). I guess it’s not only a problem with the android manifest. Would it be possible to update the ELAN plugin according to this information?

    Cheers
     
  31. Deleted User

    Deleted User

    Guest

    Hi CarlosFM,

    I was wondering if your ELAN would work with Amazon devices? I assume it should because Amazon is based off on Android for their apps (this is for a game). I tried researching local notifications for Amazon and it came up with zilch.

    Thanks!
     
  32. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi Cherubyxx,

    I believe I replied to a personal mail, but just to put it on the record, as long as the device you are targeting runs Android OS, ELAN will be able to generate notifications.

    Cheers,
    Carlos
     
  33. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi CarlosFM,

    I checked the documents, but is there a function that get's called when I open my App via the LocalNotification? Something like OnLocalNotificationFired(string id) ? I want to do something when a LocalNotification fires for instance play a certain animation, show a screen etc.
     
  34. rejwan1

    rejwan1

    Joined:
    Jul 3, 2012
    Posts:
    40
    Hey Carlos,

    I was wondering - we are using your plugin for a while now - is there support for stacking notifications?

    http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Managing

    Also - if I want to edit the Java files and recompile it myself, how should I do it now?

    2nd edit - if I already use Prime31's GCM plugin, is it possible to somehow combine the receiving of these notifications? Right now if I send both an ELAN notification and a GCM notification, they will appear on two separate notifications...
     
    Last edited: Sep 16, 2014
  35. pcg

    pcg

    Joined:
    Nov 7, 2010
    Posts:
    292
    I was also wondering about this.
     
  36. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    @pcg: at the moment there is no such functionality -though it is something we are working on.

    @rejwan1: you can definitely stack notifications by modifying the java code that creates them. If you want the source code, send me a note at carlos.fernandez.musoles (at) gmail (dot) com
     
  37. Deleted User

    Deleted User

    Guest

    Hi Carlos,
    I'm having trouble with this:
    On notification firing (I don't even see the notification) it causes the app the crash with "Unfortunately, AppName has stopped." This is my Android logcat:

    E/AndroidRuntime(25338): java.lang.Error: FATAL EXCEPTION [main]
    E/AndroidRuntime(25338): Unity version : 4.5.3f3
    E/AndroidRuntime(25338): Device model : LGE Nexus 5
    E/AndroidRuntime(25338): Device fingerprint: google/hammerhead/hammerhead:4.4.2/KOT49H/937116:user/release-keys
    E/AndroidRuntime(25338):
    E/AndroidRuntime(25338): Caused by: java.lang.RuntimeException: Unable to start receiver com.CFM.ELAN.TimedAlarm: java.lang.NullPointerException: name == null
    E/AndroidRuntime(25338): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2426)
    E/AndroidRuntime(25338): at android.app.ActivityThread.access$1700(ActivityThread.java:135)
    E/AndroidRuntime(25338): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)
    E/AndroidRuntime(25338): at android.os.Handler.dispatchMessage(Handler.java:102)
    E/AndroidRuntime(25338): at android.os.Looper.loop(Looper.java:136)
    E/AndroidRuntime(25338): at android.app.ActivityThread.main(ActivityThread.java:5017)
    E/AndroidRuntime(25338): at java.lang.reflect.Method.invokeNative(Native Method)
    E/AndroidRuntime(25338): at java.lang.reflect.Method.invoke(Method.java:515)
    E/AndroidRuntime(25338): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    E/AndroidRuntime(25338): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    E/AndroidRuntime(25338): at dalvik.system.NativeStart.main(Native Method)
    E/AndroidRuntime(25338): Caused by: java.lang.NullPointerException: name == null
    E/AndroidRuntime(25338): at java.lang.Class.classForName(Native Method)
    E/AndroidRuntime(25338): at java.lang.Class.forName(Class.java:251)
    E/AndroidRuntime(25338): at java.lang.Class.forName(Class.java:216)
    E/AndroidRuntime(25338): at com.CFM.ELAN.TimedAlarm.onReceive(TimedAlarm.java:40)
    E/AndroidRuntime(25338): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2419)
    E/AndroidRuntime(25338): ... 10 more

    Please help - urgent matter.
     
  38. Industrion

    Industrion

    Joined:
    Nov 21, 2013
    Posts:
    41
    @CarlosFM do you have any information on what can cause 'Unable to start receiver com.CFM.ELAN.TimedAlarm' to occur?

    I have the same issue. I haven't upgraded the version of ELAN that we're using in the past couple of weeks, and notifications have been working during that time - so maybe there's something else I've changed that's caused a problem. I've tried looking at the android manifest files - I still feel like the issue could be in there somewhere.

    EDIT:

    I think I've spotted what's causing an issue for me. I only have one local notification in the app, so I make its ID 1000 (an arbitrary number), as follows:

    ELANNotification n = new ELANNotification();
    n.ID = 1000;

    Each time I go to create this notification (a come-back-and-play reminder), I attempt to clear an existing notification with this ID, to prevent getting an additional, now-premature reminder.

    It appears that the call to ELANManager.CancelLocalNotification(nID) is what can cause the above issue. If I instead just call ELANManager.CancellAllNotifications(), this doesn't happen.

    Perhaps the issue is because you're not supposed to attempt to cancel a notification if it isn't definitely already queued up, but I've had that very functionality in place or a while, and I've only just started seeing this crash. Besides, it would be better to at least explain that in an exception or log inside the CancelLocalNotification method, or provide a check method that lets you query whether or not you should attempt to cancel a notification with a given ID.
     
    Last edited: Oct 8, 2014
  39. Industrion

    Industrion

    Joined:
    Nov 21, 2013
    Posts:
    41
    @CarlosFM I have another question:

    In your ELAN Guide PDF, you mention that the way to customise the notification icon is to replace Plugins/Android/res/drawable/ic_launcher.png. I'd like to customise the icon, but I'm confused, as I thought ic_launcher was the name given to the home screen icon. Additionally, my app's notifications are actually showing my app icon (which is better than nothing, but I want to use a compliant mono-coloured white icon, like other Android apps), but I haven't ever replaced the file Plugins/Android/res/drawable/ic_launcher.png - it's still the traditional Android robot logo.

    I didn't think this'd work, but I tried replacing that file with my own icon, and the notification icons change. I also tried putting files named ic_stat_notify.png and ic_stat_notification.png in the folder, and in folders alongside this, named after the different DPI settings.

    So I've tried a few approaches, but even if I focus on the instructions given in your guide, I can't get my icon to show.

    Any ideas?

    Thanks
     
  40. Daniel10

    Daniel10

    Joined:
    Aug 11, 2013
    Posts:
    10
    I've the same problem here when I try to cancel an existing notification before create another.

     
  41. Industrion

    Industrion

    Joined:
    Nov 21, 2013
    Posts:
    41
    Hi Daniel, I think I was essentially doing the same thing. It's maybe the trying when there's no notification to actually cancel - I'm not sure about that, though, I didn't run a simplified test, where I know there's definitely a notification in place - you might know differently. I only have one notification, so a cancel-all operation is the same as cancelling the specific notification, and that's why I was able to get past that particular issue, for now.

    Have you customised your icon image for your notifications, by any chance? :D
     
  42. Daniel10

    Daniel10

    Joined:
    Aug 11, 2013
    Posts:
    10
    Hi Industrion! ^^
    In your case this solution is fine, but my game use 3 types notifications. I've made some temporary changes in ELANNotifications.cs and all works "fine" now.

    And about the icon, I thought I had succeeded change because I used my game icon as image hahahaha :D
    I just tried with another image and also did not succeed :(
     
  43. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    @Daniel10 and @Industrion:

    Thanks for all the info you posted, it will really help us catch that bug once and for all. I believe there is a problem if you try to cancel a notification and you get an error, irrespective of whether the notification has been scheduled already. So we'll build a safeguard clause to prevent this from happening.

    As per the icon issue, I'll take a closer look at it and will let you know.

    Cheers and thanks for your patience
     
  44. Industrion

    Industrion

    Joined:
    Nov 21, 2013
    Posts:
    41
    Hi Carlos,

    D'you have any ideas about the notification icons, that we could try in the meantime?

    Cheers
     
  45. oogaboogacaveman

    oogaboogacaveman

    Joined:
    Oct 15, 2014
    Posts:
    2
    Hello Carlos! Thanks for being so active with support for this plugin. I've looked over the history of this post and unless I'm missing something I have a new problem. For some reason, selecting a notification does not launch the app. I saw other people talking about their app crashing or launching with weird graphical glitches, but none of that happens here, the notification just goes away without doing anything

    this is the logcat from the point where I open the notifications tab through pressing on the button and the notifications showing again

    D/NotificationService( 1410): sending mute to fm
    D/IconMerger( 3206): notification for com.projectName.test (1)
    D/IconMerger( 3206): notification for com.amazon.cloud9 (1)
    D/IconMerger( 3206): notification for com.amazon.cloud9 (1)
    D/IconMerger( 3206): notification for com.amazon.cloud9 (1)
    D/IconMerger( 3206): notification for xcxin.filexpert (1)
    D/IconMerger( 3206): notification for com.android.systemui (1)
    D/IconMerger( 3206): sum of notifications: 6
    I/ActivityManager( 1410): Start proc android.process.media for content providercom.android.providers.media/.MediaProvider: pid=8091 uid=10011 gids={1015, 2001, 3003}
    D/AlarmManagerService( 1410): Kernel timezone updated to 240 minutes west of GMT
    I/ActivityManager( 1410): Start proc com.alphonso.pulse for broadcast com.alphonso.pulse/.background.OnTimeChangedReceiver: pid=8097 uid=10007 gids={3003, 1015}
    I/ActivityThread( 8091): Pub media: com.android.providers.media.MediaProvider
    D/ContentProvider( 8091): Videos folder exist
    D/ContentProvider( 8091): Pictures folder exists
    V/MediaProvider( 8091): Attached volume: internal
    V/MediaProvider( 8091): /mnt/sdcard volume ID: -1695871268
    V/MediaProvider( 8091): Attached volume: external
    I/ActivityThread( 8091): Pub downloads: com.android.providers.downloads.DownloadProvider
    D/ContentProvider( 8091): Videos folder exist
    D/ContentProvider( 8091): Pictures folder exists
    I/ActivityThread( 8091): Pub drm: com.android.providers.drm.DrmProvider
    D/ContentProvider( 8091): Videos folder exist
    D/ContentProvider( 8091): Pictures folder exists
    I/ActivityThread( 8097): Pub com.alphonso.pulse.otter.pulseprovider: com.alphonso.pulse.amazon.PulseProvider
    D/ContentProvider( 8097): Videos folder exist
    D/ContentProvider( 8097): Pictures folder exists
    I/com.amazon.dcp.metrics.CrashDetectionHelper( 8097): Setting up crash detector.
    W/ASFDummyExtractor( 3553): ASF parser is not available
    E/MPEG4Extractor( 3553): both mdat,ftyp not found
    I/AudioService( 1410): AudioFocus requestAudioFocus()
    D/AudioResampler( 3553): forcing AudioResampler quality to 2
    D/Omap4ALSA( 3553): open called for devices 00000002 in mode 0 channels 00000000...
    I/Omap4ALSA( 3553): Using ping-pong!
    I/Omap4ALSA( 3553): Buffer size: 4096
    I/Omap4ALSA( 3553): Latency: 92879
    I/Omap4ALSA( 3553): Initialized ALSA PLAYBACK device 'plughw:0,0'
    E/AudioHardwareALSA( 3553): RE-OPEN AFTER STANDBY:: took 103 msecs
    I/ActivityManager( 1410): Process com.amazon.dcp:OTAService (pid 7783) has died.
    V/NotificationService( 1410): sending unmute to fm
    I/AudioService( 1410): AudioFocus abandonAudioFocus()
    I/ChargeProtectionService( 1410): Current State: (23, 45] C, next state: (23, 45] C
    V/AlarmManager( 1410): alarms: 1 type: RTC_WAKEUP
    V/AlarmManager( 1410): 0: Jan 15 12:21:43 am com.android.providers.calendar
    E/Omap4ALSA( 3553): called drain&close
    I/LAB126 ( 3206): open notifications from tap in the status bar, child count: 7
    I/AudioService( 1410): AudioFocus abandonAudioFocus()
    I/ActivityManager( 1410): Process com.android.quicksearchbox (pid 7795) has died.
    D/dalvikvm( 3206): GC_EXTERNAL_ALLOC freed 1623K, 52% free 3936K/8199K, external 5079K/5273K, paused 44ms
    D/LAB126 ( 3206): expand softkeys
    I/ActivityManager( 1410): Process com.svox.pico (pid 7897) has died.
    D/ActivityManager( 1410): Starting: Intent { cmp=com.projectName.test/com.unity3d.player.UnityPlayerActivity bnds=[0,550][600,660] } from pid -1
    D/LAB126 ( 3206): collapsing softkeys because notification closing.
    D/LAB126 ( 3206): collapse softkeys
    D/IconMerger( 3206): notification for com.amazon.cloud9 (1)
    D/IconMerger( 3206): notification for com.amazon.cloud9 (1)
    D/IconMerger( 3206): notification for com.amazon.cloud9 (1)
    D/IconMerger( 3206): notification for xcxin.filexpert (1)
    D/IconMerger( 3206): notification for com.android.systemui (1)
    D/IconMerger( 3206): sum of notifications: 5

    One thing I did notice is that there is no activity called UnityPlayerActivity in the android manifest, the closest thing is

    <activity android:name="com.prime31.UnityPlayerNativeActivity" android:label="@String/app_name" screenOrientation="sensor">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    </activity>

    do I need to add an activity to the manifest? I read that other people had no problem integrating this plugin and prime31 into the same app, so I don't know why this one is behaving differently
     
  46. Industrion

    Industrion

    Joined:
    Nov 21, 2013
    Posts:
    41
    @oogaboogacaveman, I believe that, if you're using a custom activity like prime31 does, then you need to specify programmatically (i.e. in your C# code) the name attribute of your AndroidManifest activity that contains MAIN and LAUNCHER, i.e. the activity that is your main one. Like this:

    ELANNotification notification = new ELANNotification();
    notification.ID = 123;
    notification.fullClassName = "com.prime31.UnityPlayerNativeActivity";
    notification.title = "Hello";
    // create the rest of the notification
    ELANManager.sendParametrizedNotification(notification);
     
    oogaboogacaveman likes this.
  47. oogaboogacaveman

    oogaboogacaveman

    Joined:
    Oct 15, 2014
    Posts:
    2
    worked like a charm! Thank you very much
     
  48. gumiJeff

    gumiJeff

    Joined:
    Jan 9, 2013
    Posts:
    1
    Hi, where can I get the *.drjava? Currently, ELAN.jar doesn't have it and need to do some modifiications.
     
  49. rafimagsi

    rafimagsi

    Joined:
    Oct 27, 2014
    Posts:
    14
    I can't send two notifications at the same time my code is :

    voidStart(){


    ELANNotificationnewnotif = newELANNotification ();
    newnotif.message = "This is new notiffffff";
    newnotif.title = "Animal Abc";
    newnotif.repetition = 30;
    newnotif.delay = 5;
    newnotif.useSound = true;
    newnotif.useVibration = true;
    newnotif.send ();


    ELANNotificationnewnotif2 = newELANNotification ();
    newnotif2.message = "This is second Notification";
    newnotif2.title = "Animal Abc 2";
    newnotif2.repetition = 30;
    newnotif2.delay = 10;
    newnotif2.useSound = true;
    newnotif2.useVibration = true;
    newnotif2.send ();
    }
     
  50. chandler55

    chandler55

    Joined:
    Jun 8, 2010
    Posts:
    17
    I also get this same error. Seems to disappear if I don't cancel any notifications, but I need that obviously :/