Skip to content

Commit 9610d34

Browse files
committed
update readme
1 parent 2c2ddb6 commit 9610d34

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

README.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,62 @@ res://
4040

4141
## Usage
4242

43-
After setup, the plugin will be ready to use.
44-
Examples of usage can be found in the `main.gd` file provided in the repository.
43+
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.
44+
45+
46+
### Send a notification immediately
47+
```gdscript
48+
trigger_notification(channel: String, notification_data: Notification) -> String
49+
```
50+
**Parameters:**
51+
- `channel` (`String`): The notification channel identifier.
52+
- `notification_data` (`Notification`): Notification object.
53+
54+
---
55+
### Send a notification from JSON
56+
```gdscript
57+
json_notification(channel: String, json_name: String) -> String
58+
```
59+
**Parameters:**
60+
- `channel` (`String`): The notification channel identifier.
61+
- `json_name` (`String`): Name of the JSON file containing notification data.
62+
63+
[Read this before use JSON](#considerations)
64+
65+
---
66+
### Schedule a notification after a delay
67+
```gdscript
68+
schedule(channel: String, notification_data: Notification, past_n_seconds: int = 0) -> String
69+
```
70+
**Parameters:**
71+
- `channel` (`String`): The notification channel identifier.
72+
- `notification_data` (`Notification`): Notification object.
73+
- `past_n_seconds` (`int`, optional): Delay in seconds before the notification is triggered (default is 0).
74+
75+
---
76+
### Schedule a JSON-based notification after a delay
77+
```gdscript
78+
schedule_json(channel: String, json_name: String, past_n_seconds: int = 0) -> String
79+
```
80+
**Parameters:**
81+
- `channel` (`String`): The notification channel identifier.
82+
- `json_name` (`String`): Name of the JSON file containing notification data.
83+
- `past_n_seconds` (`int`, optional): Delay in seconds before the notification is triggered (default is 0).
84+
85+
[Read this before use JSON](#considerations)
86+
87+
---
88+
### Cancel a scheduled notification
89+
```gdscript
90+
cancel(notification_id: int) -> String
91+
```
92+
**Parameters:**
93+
- `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.
94+
95+
96+
## Considerations
97+
- `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.
98+
- To save and modify JSONs use `JSONHandler.save_json(name: String, data: Dictionary = {})`.
4599

46100

47101
## Future implementations

0 commit comments

Comments
 (0)