Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uralys/godot-android-notifications

Godot android plugin to send notifications
https://github.com/uralys/godot-android-notifications

android android-plugin godot godot-android godot-engine godot-plugin notifications

Last synced: 3 months ago
JSON representation

Godot android plugin to send notifications

Awesome Lists containing this project

README

        

This plugin worked for Godot 3, using the old plugin API and is now archived.
For Godot 4 use this one:

# godot-android-notifications

An Android plugin for Godot 3 to send Android notifications

This plugin implements for Godot Engine.

## Usage & Docs

## Icon

create a `icon_notification.png` within the android resources in your godot project:

```sh
android/build/res/mimap/icon_notification.png
```

## Compiling

Prerequisites:

- Android SDK (platform version 30)
- the Godot Android library (`godot-lib.***.release.aar`) for your version of Godot from the [downloads page](https://godotengine.org/download).

Steps to build:

1. Clone this Git repository
2. Put `godot-lib.***.release.aar` in `./godot-android-notifications/libs/`
3. Run `./gradlew build` in the cloned repository

If the build succeeds, you can find the resulting `.aar` files in `./godot-android-notifications/build/outputs/aar/`.

Copy this `.aar` and `GodotAndroidNotifications.gdap` in your godot project, into:

```sh
android/plugins/.
```

You should get something like:

```
android/plugins
├── GodotAndroidNotifications.1.0.0.release.aar
├── GodotAndroidNotifications.gdap
```

Now export your Godot project using the [custom build](https://docs.godotengine.org/en/stable/tutorials/export/android_custom_build.html)

## API

You have [2 functions](https://github.com/uralys/godot-android-notifications/blob/master/godot-android-notifications/src/main/java/org/godotengine/godot/plugin/androidnotifications/Scheduler.java#L111) available on godot side

## schedule

```
var notifier = Engine.get_singleton('GodotAndroidNotifications')

var notificationId = 'whatever, I use time stuff to get unique ids'

notifier.schedule(
'the title',
'the message',
secsToNextNotification,
notificationId
)
```

## cancel

You can store your `notificationId` anywhere, and use it to cancel the scheduling:

```
notifier.cancel(notificationId)
```

## Development

- inspiration from:
- reference plugin implementation :
- docs to create a plugin from godot: