# Mobile Notifications Samples & Wrapper
This Unity project demonstrates how to use the [Unity Mobile Notifications API](https://docs.unity3d.com/Packages/[email protected]/manual/index.html) in real-world use cases, including a simple cross platform wrapper to show how to use the APIs.
## Overview: the Game Notifications Manager
The primary component of the wrapper is the Game Notifications Manager. It is the interface through which you can schedule cross-platform local notifications.
### Usage
1. Add the Game Notifications Manager to a Game Object (Note that the Manager's lifetime is currently limited to one scene. Up to you to add a DontDestroyOnLoad)
2. Reference it from a game script that will send notifications.
3. Initialize the Manager. Provide at least one channel if targeting Android. This should only be done once per application session.
```
var channel = new GameNotificationChannel(ChannelId, "Default Game Channel", "Generic notifications");
manager.Initialize(channel);
```
4. Create a new notification:
```
IGameNotification notification = manager.CreateNotification();
```
(Note that the wrapper might return a null object on some platforms. Check for null before continuing.)
5. Fill in the important fields
```
notification.Title = title;
notification.Body = body;
notification.DeliveryTime = deliveryTime;
```
6. Schedule the notification.
```
manager.ScheduleNotification(notification);
```
The Manager saves a small file to disk whenever backgrounding so that it can keep track of notifications that were published and scheduled in previous sessions.
### Operation Modes
The manager features several operation modes that control its behaviour. The default operation mode has queueing, foreground clearing and automatic rescheduling all on.
* **No queueing**
The wrapper immediately schedules messages with the underlying operating system. Notifications can and will appear while the game is in the foreground.
* **Queuing**
The wrapper only schedules messages with the OS when backgrounding. Any messages that aren't shown (because the app is in the foreground) fire an expiry event. The system will also (optionally, but on by default) have the ability to calculate badge numbers automatically in this mode. If you don't provide any badge numbers manually with your notifications, the wrapper will set the badge numbers so that they increment based on the scheduled time of each notification.
* **Foreground clearing**
The wrapper will remove all scheduled messages when the app comes into the foreground.
* **Automatic rescheduling**
If this is set, after clearing all messages when foregrounding, the wrapper will go through all notifications marked this way, and put them back in the queue for delivery.
To configure a notification for rescheduling:
```
var notificationToDisplay = manager.ScheduleNotification(notification);
notificationToDisplay.Reschedule = true;
```
## Platform Support notes
Each platform supported by the Game Notifications Manager is implemented by two types. To implement new platforms, simply implement a new IGameNotificationsPlatform and IGameNotification, and instantiate it in GameNotificationsManager.Initialize.
### IGameNotificationsPlatform
Wrapper for interfacing with the platform operating system. Generally talks directly to AndroidNotificationCenter and iOSNotificationCenter. Also responsible for creating IGameNotifications.
### IGameNotification
Platform implementation of an instance of a notification.
## Demo Notes
* Operates using all operation modes on by default.
* Features a very simple clicker game. It will schedule local notifications whenever a cookie or cupcake is completed.
* The News Feed button will retrieve the latest item from the Unity news RSS and schedule it as a notification 5 minutes in the future (configurable in GameController)
* More Options contains a 'play reminder' button which will schedule an absence notification message for a fixed time of day the following day. (6am by default, configurable in GameController)
## Credits
This Sample was developed in conjunction with 24 Bit Games. www.24bit.games
没有合适的资源?快使用搜索试试~ 我知道了~
基于C#开发的一款室内解谜类游戏源码(课程作业).zip
共2000个文件
meta:3577个
cs:1967个
png:1037个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 136 浏览量
2023-07-28
10:35:38
上传
评论
收藏 154.35MB ZIP 举报
温馨提示
基于C#开发的一款室内解谜类游戏源码(课程作业).zip 基于C#开发的一款室内解谜类游戏源码(课程作业).zip 基于C#开发的一款室内解谜类游戏源码(课程作业).zip 【资源介绍】 该资源内项目源码是个人的课程作业,代码都测试ok,都是运行成功后才上传资源,评审平均分达到94.5分,放心下载使用! 该资源适合计算机相关专业(如人工智能、通信工程、自动化、软件工程等)的在校学生、老师或者企业员工下载,适合小白学习或者实际项目借鉴参考! 当然也可作为毕业设计、课程设计、课程作业、项目初期立项演示等。如果基础还行,可以在此代码基础之上做改动以实现更多功能。
资源推荐
资源详情
资源评论
收起资源包目录
基于C#开发的一款室内解谜类游戏源码(课程作业).zip (2000个子文件)
000d956793c62a878875c2f541de2afb 39KB
0019db2611aed046daabcbd575193956 6KB
00258432afd33e1d61c3dc13bda237f5 648B
003c5782d71d1ebf045690fc811f3971 29KB
00445c1f0aca66452050783ac3930359 10KB
0044e30f7b7d74858a9f8d479b0f754f 4KB
0047d0b364eb6dbfe0202067ca09da2c 5KB
005252ecd1eb70be46ad27af274b68e2 4KB
005976675201a744d2a464be0cc2a3e7 4KB
005c41ad700abedb340891a286e91997 2KB
0067e017f7fffabb9b15b2b598648b64 9KB
006a111e359493c05c4759b372aa2004 949KB
00759bb433a1dd76175c9cebe3745733 28KB
008a0efbde27f8350c317dfdb890aaa9 6KB
008ea581481e1efc8e9a6d1e0133f2dd 620B
00985d34b25fbee95185c5c12f989a06 13KB
00a20e615125c3191ef84b15b51d9096 17KB
00ad88b82c5418954383e2c312f87e4d 27KB
00b623c226be64ffb74b8a5e7dbec308 4KB
00baf9c7ad09b4ac5c6ee958bc3aed02 5KB
00d4d2f2fd1c0ce1fbac9950cbd55cba 27KB
00e28e1ac0200c384084d44e8c695c16 29KB
00ee567d55203adcee04c3ea54c5ffb3 28KB
010140116509b1402545bf535eae4bc5 1KB
0109ff030ee5d2e143d2a6080abda5b2 1KB
0120a250e6cdac84d66db484211c8cf2 4KB
012c4e7ed80308b09d389444902dff1f 178B
014a8d4069f339a679ea1a17facdf50e 5KB
014bf668e1d9124998f2f3ad35c8a1e0 31KB
014d22974081e939ff95516927ec83d2 7KB
015bdd14b5ec9d6ee2f2377185af32c2 6KB
0160f739ec66f3b3b0cf07ff352df163 80KB
0162bf00290464536d249b1a732112dd 7KB
0176b343eb9c39c1be427c7351f2582a 5KB
018b7042d517a8769ca74bc8db2ed49e 4KB
019567b5f45886319b34a7d1f2894381 7KB
01a83915262fb502a97c1a9bb4c0bbf6 29KB
01ad3db0ed67f817948eaea3cb2ae4c2 4KB
01b65d2fefd87dcb7bf0b4556f4c55c4 2KB
01d713aab1457fcbc6844d5392bd2674 8KB
01ff977cc5ceffa2fa98424274aeb49e 14KB
02028db92ee975671c7e1e07983ba786 5KB
02042757a7e3726dac35ebc78910b187 542KB
02087343b600b25e25aa5a6d122e88b3 6KB
020ee5020c8104f8d4822d4a7669c841 21KB
0226ef5d479b2013fe4125dcdf830462 2KB
025135f320faf6678504af839464edf0 4KB
0256ba847f7efb3a95fe432f3105688a 5KB
02760b973ee117e8be0ec511f2390b10 152B
028c57bb2734bdf6f1dcbf2d9c26cd79 381B
029c67f17cbfbf181ecff95d0eaa0d12 38KB
029ecebeea985511f7f1a86fbb8a006b 54KB
02a1ed252b6e6247d3394e615bf82ec0 17KB
02bf9c24b7fa54ff345048d2232ba853 2KB
02cfa50d452f5ba3f4836ca88e7dc9f7 2KB
02d30cbd515b3f1bf7bbfb81a928e30e 7KB
02d5ab4ab07dc6d33817723da3402d87 11KB
02dbda8093ca99869ade194d552d7ca3 7KB
02e61ba612c06b95469e2290f537334f 12KB
02e89bd30f74db8f1e9fb711d3aa163e 20KB
02eff69157c3d65aa16baa3c02c6b029 140B
0325c671c930704eb50ec800a67cdfab 7KB
03323353270d5417585daf75113019de 13KB
03366e61ce4515593528eebf1402ad76 7KB
034bac3d1dbfb29d7cacd698519b5b38 5KB
035be9868232dcf3370b1e02f9f62e2e 6KB
036020dbe3a43ffafeaf9657400243a1 9KB
03660c2a9abe174f09bca1ec0c0011c9 29KB
03688eba8ef236992cc250a0802b96d0 24KB
038473ee2eb558a4e3511d1b1019c7bc 1KB
038d12627e152d8b6951368f49e39cbf 6KB
03a5ced6f9ee1d2615d6df4bab0937c3 5KB
03bc86108d2f6e2f0620f3af3748e893 5KB
03dcfe5fe0183f1ae561e1f16361237c 5KB
03ea10d42ee87fb9c2eec68727088117 5KB
03ed559d7d2e64e4cd8d1361b42c1503 29KB
04379cf2190990245dfe6b17848f786f 6KB
0442ff0f8401d0fed2805c0e2020bd85 18KB
0443ff3bd3481825d6e7c9af190315da 4KB
045f475ecd9f5169c0420f88a4d159a9 15KB
0462373a0c02ede617a8e32247c2ba8b 328B
04742f4ae6b4dfa0ea1dd3d366f858c7 4KB
0481c18340f4817ffeafde528ab2df0a 4KB
048784fa4b831d6c9e0237f35c648bc9 6KB
0495b1ce7b390c943013ad42613b2f00 157B
049e260a1fee051953a5605aa813fc6e 5KB
049ffd944fd736a6eaf717b51fe0c4ef 139KB
04a1934c9099546ff759fa02bbf35ac5 11KB
04a39c7d216d952d4f1403f442081f8b 5KB
04b44512495c0f663fbf7e66b94f3175 606B
04bf0c0ac85a333fcd1ac3353394a0b0 6KB
04c1e74cbdae3505fb3df64f0320b708 2KB
04c557f6bbc49c165d4fd50bba5a38ff 3KB
04cc96eb15118ac563f04d62578ca5dc 7KB
04d96d6a047dbe629cdf8332cbf00a5b 4KB
04e03b1c2f680eda29f545016febbf00 4KB
04e7be8aa3c86342de2fcb83c0391850 5KB
04e808f73e6941e7af5170db0fe99918 7KB
04f6b105f3b0bc8fe4f251e568b6fc1a 6KB
04fc34a624398d323b16c984f53f1e49 31KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
Make程序设计
- 粉丝: 6821
- 资源: 3575
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功