Skip to content

Commit ddeea3d

Browse files
authored
Merge pull request #266 from Unity-Technologies/prepare-2-2-0
Prepare for 2.2.0 release
2 parents 2b9cf63 + 9f66b00 commit ddeea3d

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

TestProjects/Main/Assets/Scripts/iOSTest.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,22 @@ void OnRemoteNotificationReceivedHandler(iOSNotification notification)
8383

8484
void Start()
8585
{
86+
InstantiateAllTestButtons();
87+
88+
StartCoroutine(StartRoutine());
89+
}
90+
91+
IEnumerator StartRoutine()
92+
{
93+
// on app launch (not resume) notifications don't arrive immediately
94+
// so in Start of the fisrt scene GetLastRespondedNotification may return null, wait a couple of frames
95+
yield return null;
96+
yield return null;
8697
// in case a killed app was launched by clicking a notification
8798
iOSNotification notification = iOSNotificationCenter.GetLastRespondedNotification();
8899
string lastAction = iOSNotificationCenter.GetLastRespondedNotificationAction();
89100
string lastTextInput = iOSNotificationCenter.GetLastRespondedNotificationUserText();
90101
RegisterCategories();
91-
InstantiateAllTestButtons();
92102
ClearBadge();
93103
RemoveAllNotifications();
94104
m_LOGGER

com.unity.mobile.notifications/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this package will be documented in this file.
44

5-
## [Unreleased]
5+
## [2.2.0] - 2023-04-06
66

77
### Changes & Improvements:
88
- [Android] - Added support for notification channel groups.

com.unity.mobile.notifications/Runtime/iOS/iOSNotificationCenter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ private static iOSNotification[] NotificationDataToNotifications(iOSNotification
133133

134134
/// <summary>
135135
/// Use this to retrieve the last local or remote notification received by the app.
136+
/// Do not call this in Awake or Start of the first scene, wait for at least a frame.
137+
/// On cold app start iOS reports this with small delay.
136138
/// </summary>
137139
/// <seealso cref="SetNotificationCategories(IEnumerable{iOSNotificationCategory})"/>
138140
/// <returns>

com.unity.mobile.notifications/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.unity.mobile.notifications",
33
"displayName": "Mobile Notifications",
4-
"version": "2.1.1",
4+
"version": "2.2.0",
55
"unity": "2020.3",
66
"description": "Mobile Notifications package adds support for scheduling local repeatable or one-time notifications on iOS and Android.\n\nOn iOS receiving of push notifications is also supported.",
77
"keywords": [

0 commit comments

Comments
 (0)