From 3e8437ae559487362fae3525beb79c534c213a51 Mon Sep 17 00:00:00 2001 From: 单军华 Date: Thu, 12 Jul 2018 13:44:34 +0800 Subject: [PATCH] bug修复和功能优化 --- screendisplay/Pods/EaseUI/EaseUI/EMUIKit/3rdparty/DeviceHelper/internal/EMCDDeviceManager+Remind.m | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/screendisplay/Pods/EaseUI/EaseUI/EMUIKit/3rdparty/DeviceHelper/internal/EMCDDeviceManager+Remind.m b/screendisplay/Pods/EaseUI/EaseUI/EMUIKit/3rdparty/DeviceHelper/internal/EMCDDeviceManager+Remind.m new file mode 100755 index 0000000..a2b6de9 --- /dev/null +++ b/screendisplay/Pods/EaseUI/EaseUI/EMUIKit/3rdparty/DeviceHelper/internal/EMCDDeviceManager+Remind.m @@ -0,0 +1,56 @@ +/************************************************************ + * * Hyphenate CONFIDENTIAL + * __________________ + * Copyright (C) 2016 Hyphenate Inc. All rights reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Hyphenate Inc. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Hyphenate Inc. + */ + +#import "EMCDDeviceManager+Remind.h" + +void EMSystemSoundFinishedPlayingCallback(SystemSoundID sound_id, void* user_data) +{ + AudioServicesDisposeSystemSoundID(sound_id); +} + +@implementation EMCDDeviceManager (Remind) + +// The system sound for a new message +- (SystemSoundID)playNewMessageSound +{ + // Path for the audio file + NSURL *bundlePath = [[NSBundle mainBundle] URLForResource:@"EaseUIResource" withExtension:@"bundle"]; + NSURL *audioPath = [[NSBundle bundleWithURL:bundlePath] URLForResource:@"in" withExtension:@"caf"]; + + SystemSoundID soundID; + AudioServicesCreateSystemSoundID((__bridge CFURLRef)(audioPath), &soundID); + // Register the sound completion callback. + AudioServicesAddSystemSoundCompletion(soundID, + NULL, // uses the main run loop + NULL, // uses kCFRunLoopDefaultMode + EMSystemSoundFinishedPlayingCallback, // the name of our custom callback function + NULL // for user data, but we don't need to do that in this case, so we just pass NULL + ); + + AudioServicesPlaySystemSound(soundID); + + return soundID; +} + +- (void)playVibration +{ + // Register the sound completion callback. + AudioServicesAddSystemSoundCompletion(kSystemSoundID_Vibrate, + NULL, // uses the main run loop + NULL, // uses kCFRunLoopDefaultMode + EMSystemSoundFinishedPlayingCallback, // the name of our custom callback function + NULL // for user data, but we don't need to do that in this case, so we just pass NULL + ); + + AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); +} +@end -- Gitblit v1.8.0