Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be πŸ“–

Android Notification Plugin

An asset by marcosdima
The page banner background of a mountain and forest
Android Notification Plugin hero image

Quick Information

0 ratings
Android Notification Plugin icon image
marcosdima
Android Notification Plugin

Godot plugin that provides full support for managing and sending notifications on Android devices. - Send instant notifications. - Schedule notifications with custom delays. - Support several styles: basic, images, big text and multiple lines. - JSON-based configuration for easy customization and updates.

Supported Engine Version
4.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
1 day ago
Git URL
Issue URL

AndroidNotificationPlugin

AndroidNotificationPlugin is a Godot plugin for managing and sending notifications on Android devices.


Installation

  1. Download the .zip file of this repository. (Or just clone the repository)
  2. Extract it into your project under res://addons/.
    The structure should look like this:
res://
└── addons/
    └── AndroidNotificationPlugin/
        β”œβ”€β”€ plugin.cfg
        β”œβ”€β”€ export_plugin.gd
        └── ...
  1. In Godot, go to Project β†’ Project Settings β†’ Plugins and activate AndroidNotificationPlugin.

Setup

  1. Add a NotificationNode to your scene.
  2. Configure notification images:
    • Load them as CompressedTexture2D.
    • Assign a resource name for each image.
    • Recommendation: set an small_icon.png for simpler implementation.
  3. Define channels:
    • At least one channel is required.
    • Important: do not repeat channel IDs.
  4. Permission: On devices running Android 13 (API 33) or higher, the POST_NOTIFICATIONS permission is required in order to display notifications. Call NotificationNode.request_post_notification() to request this permission from the user at runtime.

Usage

After setup, the plugin will be ready to use. This section describes the main functions available for sending, scheduling, and managing notifications in your Godot Android project. Examples of usage can be found in the main.gd file included in the repository.

Send a notification immediately

trigger_notification(channel: String, notification_data: Notification) -> String

Parameters:

  • channel (String): The notification channel identifier.
  • notification_data (Notification): Notification object.

Send a notification from JSON

json_notification(channel: String, json_name: String) -> String

Parameters:

  • channel (String): The notification channel identifier.
  • json_name (String): Name of the JSON file containing notification data.

Read this before use JSON


Schedule a notification after a delay

schedule(channel: String, notification_data: Notification, past_n_seconds: int = 0) -> String

Parameters:

  • channel (String): The notification channel identifier.
  • notification_data (Notification): Notification object.
  • past_n_seconds (int, optional): Delay in seconds before the notification is triggered (default is 0).

Schedule a JSON-based notification after a delay

schedule_json(channel: String, json_name: String, past_n_seconds: int = 0) -> String

Parameters:

  • channel (String): The notification channel identifier.
  • json_name (String): Name of the JSON file containing notification data.
  • past_n_seconds (int, optional): Delay in seconds before the notification is triggered (default is 0).

Read this before use JSON


Cancel a scheduled notification

cancel(notification_id: int) -> String

Parameters:

  • notification_id (int): The ID of the notification to cancel. If the notification has already been sent, it will be removed from the notification bar.

Considerations

  • NotificationNode methods return a String. This is a stringified object. If needed, you can parse it with NotificationResult.parse(res: String) -> NotificationResult Currently, the available results are: NotificationCreated, NotificationCanceled, and NotificationError. This implementation is still basic, so the methods return a String to let you handle it as you find most appropriate.
  • To save and modify JSONs use JSONHandler.save_json(name: String, data: Dictionary = {}).

Future implementations

  • Persistent scheduled notifications: ensure that scheduled notifications remain active even after the app is closed or restarted.
  • Extended customization options: provide more ways to customize notifications.

License

This project is licensed under the MIT License.

Godot plugin that provides full support for managing and sending notifications on Android devices.
- Send instant notifications.
- Schedule notifications with custom delays.
- Support several styles: basic, images, big text and multiple lines.
- JSON-based configuration for easy customization and updates.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Android Notification Plugin icon image
marcosdima
Android Notification Plugin

Godot plugin that provides full support for managing and sending notifications on Android devices. - Send instant notifications. - Schedule notifications with custom delays. - Support several styles: basic, images, big text and multiple lines. - JSON-based configuration for easy customization and updates.

Supported Engine Version
4.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
1 day ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers