Skip to content

Commit 4607c1a

Browse files
committed
Fix sound volume transfering to native
1 parent 164f2c8 commit 4607c1a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,7 @@ public string SoundName
268268
/// See Apple documentation for supported values.
269269
/// </summary>
270270
/// <see href="https://developer.apple.com/documentation/usernotifications/unnotificationsound/2963118-defaultcriticalsoundwithaudiovol?language=objc"/>
271-
public float? SoundVolume
272-
{
273-
get { return data.soundVolume < 0 ? null : data.soundVolume; }
274-
set { data.soundVolume = value == null ? -1.0f : value.Value; }
275-
}
271+
public float? SoundVolume { get; set; }
276272

277273
/// <summary>
278274
/// Arbitrary string data which can be retrieved when the notification is used to open the app or is received while the app is running.
@@ -461,6 +457,11 @@ internal iOSNotificationWithUserInfo GetDataForSending()
461457
{
462458
if (data.identifier == null)
463459
data.identifier = GenerateUniqueID();
460+
if (SoundVolume.HasValue)
461+
data.soundVolume = SoundVolume.Value;
462+
else
463+
data.soundVolume = -1.0f;
464+
464465
iOSNotificationWithUserInfo ret;
465466
ret.data = data;
466467
ret.userInfo = userInfo;

0 commit comments

Comments
 (0)