https://github.com/unity-package/notification-unity
Support scheduling local one-time or repeatable notifications for Unity games (Android and iOS)
https://github.com/unity-package/notification-unity
notifications notifications-unity push-notifications unity unity-package unity-packages unity3d
Last synced: 4 months ago
JSON representation
Support scheduling local one-time or repeatable notifications for Unity games (Android and iOS)
- Host: GitHub
- URL: https://github.com/unity-package/notification-unity
- Owner: unity-package
- License: mit
- Created: 2024-08-28T03:26:08.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-11-28T09:49:43.000Z (7 months ago)
- Last Synced: 2025-01-31T03:34:27.498Z (5 months ago)
- Topics: notifications, notifications-unity, push-notifications, unity, unity-package, unity-packages, unity3d
- Language: C#
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## What
Support scheduling local one-time or repeatable notifications for Unity games (Android and iOS)
## How To Install
### Add the line below to `Packages/manifest.json`
for version `1.0.0`
```csharp
"com.wolf-org.notifications":"https://github.com/unity-package/notification-unity.git#1.0.0",
```
dependency `com.unity.mobile.notifications-2.3.2` and `com.cysharp.unitask-2.5.5`
```csharp
"com.unity.mobile.notifications": "2.3.2",
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.5.5",
```## Use
- Add define symbol `VIRTUESKY_NOTIFICATION`
- Create `NotificationChanel` (via `Create` > `Unity-Common` > `Notification Chanel`)

- `Identifier`
- `Minute` (after t minute notification will be sent)
- `Repeat` (is it repeatable or not)
- `Pig Picture` (only android)
- `Name Picture` (name pig picture notification)
`Note: File big picture must be place in folder StreamingAsset, Name Picture must contains file extension ex .jpg`
- `Override Icon`
- `Small Icon` (custom small icon)
- `Large Icon` (custom large icon)- `NotificationPrepare`
Attach NotificationPrepare to scene to prepare notification android bigpicture, RequestUserPermission android and schedule
- Send notification
```csharp
public NotificationChanel notificationChanel;private void Start()
{
notificationChanel.Send();
}
```
- Schedule notification```csharp
public NotificationChanel notificationChanel;private void Start()
{
notificationChanel.Schedule();
}
```
- Cancel All Scheduled```csharp
public NotificationChanel notificationChanel;private void Start()
{
notificationChanel.CancelAllScheduled();
}
```