Skip to content

Unity3D Plugin for Android local notifications with example project

Notifications You must be signed in to change notification settings

r2cris/unity-android-notifications

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity3D Android notification plugin

License: MIT Features:

  • Set delayed notification
  • Set delayed repeatable notification
  • Supports custom icon and large icon
  • Fully supports Unity 4.х - 5.х
  • Fully supports Android 4.1 - 6.0

FAQ

How to get exact notification in Android M ?

It's not recommended by Google since notifications are batching when phone in IDLE_MAINTENANCE state. Now you'll receive notification with additional delay. You can use NotificationExecuteMode.ExactAndAllowWhileIdle mode to force system show your notification with maximum priority. [Read more] (https://developer.android.com/intl/ru/reference/android/app/AlarmManager.html#setExact(int, long, android.app.PendingIntent))

How to set up big icon ?

Just put it into drawable directories *\UnityProject\Assets\Plugins\Android\res* with name notify_icon_big.png. And in the SendNotification method set bigIcon to "notify_icon_big"

How to get rid of obsolete warnings like "OBSOLETE - Providing Android resources in Assets/Plugins/Android/res is deprecated, please move your resources to an Android Library. See "Building Plugins for Android" section of the Manual." ?

You can avoid this by recompiling plugin with icons inside.

I got application crash

Check you don't call CancelNotification and SetNotification in one frame, and you put notify_icon_small into the res directory. Be sure you generate unique id for every new notification.

Notification doesn't launch the app

Set LocalNotification.mainActivityClassName to the your main activity class (from manifest)

Screenshot

Screenshot

About

Unity3D Plugin for Android local notifications with example project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 65.0%
  • C# 35.0%