Hi, basically i want to create a notification that appears on the device of a fully offline game at a specific time (e.g, every day at 1pm) - how can I do this? I am aware of a way to get this to work via a onesignal server but i feel this should be simpler.
Danijel
November 22, 2024, 7:44pm
2
To achieve this, here’s an example of how it can be done:
In this setup, the clock is represented as a simple string. In your case, you can set it to "13"
(or any desired hour). The system will then compare this value with the current time. You’ll need to expand the logic to handle additional conditions or behaviors as needed.
For example, you could add checks for minutes, handle different formats, or trigger specific events based on the comparison result.
Hello,
I have already created an extension that sends notifications offline (except for the banner/icon part) a while ago.
However, the extension is in its early stages, and remember to ask the end user to disable battery optimization.
Any feedback is welcome.
GDevelopApp:main
← EyadMahm0ud:LocalNotification
opened 03:03PM - 09 Oct 24 UTC
Send local notifications without service or required internet connection.
Sup… ports:
- Add icon and attachment (banner).
![Screenshot_٢٠٢٤-١٠-١٠-١١-٣٦-٤٩-٨١_e389f039e258938d57957ac01fb2c20c](https://github.com/user-attachments/assets/10135caa-c545-4467-a862-b10658023ecf)
- Send notification on a fixed date:
![Screenshot_٢٠٢٤-١٠-٠٩-١٧-٥٦-٣٦-٤٤_e30b29e3e95c3d200d1767f3dfeb8174](https://github.com/user-attachments/assets/4b3b8bbe-4076-4f78-9d49-588c7b1d1663)
- Send notification after countdown:
![Screenshot_٢٠٢٤-١٠-٠٩-١٧-٥٢-٤٠-٢٨_e30b29e3e95c3d200d1767f3dfeb8174](https://github.com/user-attachments/assets/bc043e15-f444-4904-9e12-7a887dd42646)
- Send notification repeatedly:
![Screenshot_٢٠٢٤-١٠-٠٩-١٧-٥٥-٤٨-١١_e30b29e3e95c3d200d1767f3dfeb8174](https://github.com/user-attachments/assets/2625fb9a-e899-477c-a637-352d09aa1358)
Example project:
[Local Notification Example.zip](https://github.com/user-attachments/files/17310409/Local.Notification.Example.zip)
//TO:DO
- [ ] Remove the Ignore Battery Optimization plugin and use a function from the local-notification pulgin itself.
- [ ] Add condition to check permission status.
- [ ] Add action to update/cancel notification.
{
"author": "",
"category": "Advanced",
"extensionNamespace": "",
"fullName": "Local notification",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBkPSJNMjYuOCwyNUg1LjJjLTAuOCwwLTEuNS0wLjQtMS45LTEuMWMtMC40LTAuNy0wLjMtMS41LDAuMS0yLjJMNC41LDIwYzEuOC0yLjcsMi43LTUuOCwyLjctOWMwLTMuNywyLjQtNy4xLDUuOS04LjMNCgkJQzEzLjcsMS42LDE0LjgsMSwxNiwxczIuMywwLjYsMi45LDEuN2MzLjUsMS4yLDUuOSw0LjYsNS45LDguM2MwLDMuMiwwLjksNi4zLDIuNyw5bDEuMSwxLjdjMC40LDAuNywwLjUsMS41LDAuMSwyLjINCgkJQzI4LjQsMjQuNiwyNy42LDI1LDI2LjgsMjV6Ii8+DQo8L2c+DQo8cGF0aCBkPSJNMTEuMSwyN2MwLjUsMi4zLDIuNSw0LDQuOSw0czQuNC0xLjcsNC45LTRIMTEuMXoiLz4NCjwvc3ZnPg0K",
"name": "LocalNotification",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/UI Essentials/471c40650163a6ed6eda461408e95b801a0f09f2918c38c9c974f375678fc109_UI Essentials_notification_alarm_bell.svg",
"shortDescription": "Send scheduled notifications without internet connection required.",
"version": "0.0.1",
"description": "Send notification with icon and banner attachment repeatedly or when a specific date and time comes or after a countdown.",
"tags": [
"local",
"notification",
"mobile"
],
"authorIds": [
"lj8txSYs8QPfahnyD8MFO4XvMv02"
],
This file has been truncated. show original