Skip to content

Notification Scheduler Plugin allows scheduling of local notifications on the iOS platform.

License

Notifications You must be signed in to change notification settings

cengiz-pz/godot-ios-notification-scheduler-plugin

Repository files navigation


Notification Scheduler Plugin

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 .

Prerequisites

Follow instructions on the following page to prepare for iOS export:

Installation

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

Installing via AssetLib

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
  • enable the addon via the Plugins tab of Project->Project Settings... menu, in the Godot Editor
  • enable the plugin via the iOS section of Project->Export... menu, in the Godot Editor

Installing manually

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 of Project->Project Settings... menu, in the Godot Editor
  • enable the plugin via the iOS section of Project->Export... menu, in the Godot Editor

Notification icon

Select your notification icon via the iOS section of Project->Export... menu, in the Godot Editor

Usage

Add a NotificationScheduler node to your scene and follow the following steps:

  • Register listeners for the following signals emitted from the NotificationScheduler node
    • notification_opened - when user taps notification item
    • permission_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's set_interval(interval_in_seconds) method can be used for scheduling repeating notifications.
  • NotificationData's set_deeplink(data) method can be used for delivering URI data along with the notification.

Other Available Methods

  • 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.

Troubleshooting

XCode logs

XCode logs are one of the best tools for troubleshooting unexpected behavior. View XCode logs while running your game to troubleshoot any issues.

Troubleshooting guide

Refer to Godot's Troubleshooting Guide.





Credits

Developed by Cengiz

Original repository: Godot iOS Notification Scheduler Plugin





Contribution

This section provides information on how to build the plugin for contributors.



Prerequisites



Build

  • 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


Libraries

Library archives will be created in the bin/release directory.





All Plugins

Plugin Android iOS
Notification Scheduler https://github.com/cengiz-pz/godot-android-notification-scheduler-plugin https://github.com/cengiz-pz/godot-ios-notification-scheduler-plugin
Admob https://github.com/cengiz-pz/godot-android-admob-plugin https://github.com/cengiz-pz/godot-ios-admob-plugin
Deeplink https://github.com/cengiz-pz/godot-android-deeplink-plugin https://github.com/cengiz-pz/godot-ios-deeplink-plugin
Share https://github.com/cengiz-pz/godot-android-share-plugin https://github.com/cengiz-pz/godot-ios-share-plugin
In-App Review https://github.com/cengiz-pz/godot-android-inapp-review-plugin https://github.com/cengiz-pz/godot-ios-inapp-review-plugin