Notification Scheduler Plugin allows scheduling of local notifications on the iOS platform.
For Android version, visit https://github.com/cengiz-pz/godot-android-notification-scheduler-plugin .
Follow instructions on the following page to prepare for iOS export:
There are 2 ways to install the Notification Scheduler
plugin into your project:
- Through the Godot Editor's AssetLib
- Manually by downloading archives from Github
Steps:
- search for and select the
iOS Notification Scheduler
plugin in Godot Editor - click
Download
button - on the installation dialog...
- keep
Change Install Folder
setting pointing to your project's root directory - keep
Ignore asset root
checkbox checked - click
Install
button
- keep
- enable the addon via the
Plugins
tab ofProject->Project Settings...
menu, in the Godot Editor - enable the plugin via the
iOS
section ofProject->Export...
menu, in the Godot Editor
Steps:
- download release archive from Github
- unzip the release archive
- copy to your Godot project's root directory
- enable the addon via the
Plugins
tab ofProject->Project Settings...
menu, in the Godot Editor - enable the plugin via the
iOS
section ofProject->Export...
menu, in the Godot Editor
Select your notification icon via the iOS
section of Project->Export...
menu, in the Godot Editor
Add a NotificationScheduler
node to your scene and follow the following steps:
- Register listeners for the following signals emitted from the
NotificationScheduler
nodenotification_opened
- when user taps notification itempermission_granted
permission_denied
- At startup, using the
NotificationScheduler
node to check that the application has permissions to post notifications:
$NotificationScheduler.has_post_notifications_permission()
- If the application doesn't have permissions to post notifications, then request permission using the
NotificationScheduler
node:
$NotificationScheduler.request_post_notifications_permission()
-
permission_granted
signal will be emitted when the application receives the permissions -
Create a notification channel using the
NotificationScheduler
node:
$NotificationScheduler.create_notification_channel(
NotificationChannel.new()
.set_id("my_channel_id")
.set_name("My Channel Name")
.set_description("My channel description")
.set_importance(NotificationChannel.Importance.DEFAULT))
- Build
NotificationData
object:
var my_notification_data = NotificationData.new()
my_notification_data.set_id(__notification_id).\
set_channel_id("my_channel_id").\
set_title("My Notification Title").\
set_content("My notification content").\
set_small_icon_name("ic_name_of_the_icon_that_you_generated").\
set_delay(my_delay_in_seconds)
- In order to schedule repeating notifications, set the repeat interval value using `set_interval()``
- Note: minimum interval value allowed on the iOS platform is 60 seconds.
- Schedule notification using the
NotificationScheduler
node:
$NotificationScheduler.schedule(
my_notification_data
)
NotificationData
'sset_interval(interval_in_seconds)
method can be used for scheduling repeating notifications.NotificationData
'sset_deeplink(data)
method can be used for delivering URI data along with the notification.- The Deeplink Plugin can then be used to process the URI data.
cancel(notification_id)
get_notification_id()
- alternative way to get the ID of the last opened notification.open_app_info_settings()
- open the notification settings screen for your app in iOS Settings app.
XCode logs are one of the best tools for troubleshooting unexpected behavior. View XCode logs while running your game to troubleshoot any issues.
Refer to Godot's Troubleshooting Guide.
Developed by Cengiz
Original repository: Godot iOS Notification Scheduler Plugin
This section provides information on how to build the plugin for contributors.
- Run
./script/build.sh -A <godot version>
initially to run a full build - Run
./script/build.sh -cgA <godot version>
to clean, redownload Godot, and rebuild - Run
./script/build.sh -ca
to clean and build without redownloading Godot - Run
./script/build.sh -h
for more information on the build script
Library archives will be created in the bin/release
directory.