From 070183766296dda6a29d5bce8865e7466a04c239 Mon Sep 17 00:00:00 2001 From: Manuel Beck Date: Fri, 10 Oct 2025 16:35:04 +0200 Subject: [PATCH] CDVNotification.m: Fix pointer casting in sound completion callback Corrects casting of callback data to ensure proper handling of integer values when passing and retrieving the beep count in AudioServicesAddSystemSoundCompletion and soundCompletionCallback. --- src/ios/CDVNotification.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ios/CDVNotification.m b/src/ios/CDVNotification.m index bea6466b..451598f4 100644 --- a/src/ios/CDVNotification.m +++ b/src/ios/CDVNotification.m @@ -127,12 +127,12 @@ static void playBeep(int count) { #else AudioServicesCreateSystemSoundID((CFURLRef)audioPath, &completeSound); #endif - AudioServicesAddSystemSoundCompletion(completeSound, NULL, NULL, soundCompletionCallback, (void*)(cbDataCount-1)); + AudioServicesAddSystemSoundCompletion(completeSound, NULL, NULL, soundCompletionCallback, (void *)(intptr_t)(cbDataCount - 1)); AudioServicesPlaySystemSound(completeSound); } static void soundCompletionCallback(SystemSoundID ssid, void* data) { - int count = (int)data; + int count = (int)(intptr_t)data; AudioServicesRemoveSystemSoundCompletion (ssid); AudioServicesDisposeSystemSoundID(ssid); if (count > 0) {