Commit 565b9f67 by pierce

fixed 提示音不播放的问题

parent c2de1e10
......@@ -78,14 +78,14 @@
//中奖奖音效
BOOL soundSwitch = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_SETTING_SOUND_SWITCH_BOOL] boolValue];
BOOL soundSwitch = [FUSSoundAndVibrateHelper systemSoundOpen];
if (soundSwitch && needRing && ![NSString isNull:soundName]) {
[FUSSoundAndVibrateHelper playSoundEffect:soundName bundle:[FUSCommonBundle bundle] ofType:@"mp3"];
}
//振动效果
if (needVibrate) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
BOOL vibrateSwitch = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_SETTING_VIBRATE_SWITCH_BOOL] boolValue];
BOOL vibrateSwitch = [FUSSoundAndVibrateHelper systemVibrateOpen];
if (vibrateSwitch) {
[FUSSoundAndVibrateHelper fus_playSystemVibrate];
}
......
......@@ -42,11 +42,6 @@ NS_ASSUME_NONNULL_BEGIN
// 用户是否已认证
+ (NSString *)fus_USER_AUTHSTATE;
// 设置中声音开关
+ (NSString *)fus_SETTING_SOUND_SWITCH_BOOL;
// 设置中振动开关
+ (NSString *)fus_SETTING_VIBRATE_SWITCH_BOOL;
// 设置中启动语音开关
+ (NSString *)fus_SETTING_LAUNCH_SOUND_SWITCH_BOOL;
......
......@@ -59,15 +59,6 @@
return @"videoAuthState";
}
// 设置中声音开关
+ (NSString *)fus_SETTING_SOUND_SWITCH_BOOL {
return @"SettingSoundSwitchBool";
}
// 设置中振动开关
+ (NSString *)fus_SETTING_VIBRATE_SWITCH_BOOL {
return @"SettingVibrateSwitchBool";
}
// 设置中启动语音开关
+ (NSString *)fus_SETTING_LAUNCH_SOUND_SWITCH_BOOL {
return @"SettingLaunchSoundSwitchBool";
......
......@@ -220,8 +220,9 @@ static NSString *const kGtAppSecret = @"OSSSWqbWY0ACJiUv4AHdW7";
BOOL notFirst = [[[NSUserDefaults standardUserDefaults] objectForKey:NOT_FIRST_LAUNCH_BOOL] boolValue];
if (!notFirst) {
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:NOT_FIRST_LAUNCH_BOOL];
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:FUSUserUDKeys.fus_SETTING_SOUND_SWITCH_BOOL];
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:FUSUserUDKeys.fus_SETTING_VIBRATE_SWITCH_BOOL];
[FUSSoundAndVibrateHelper setSystemSoundOpen:YES];
[FUSSoundAndVibrateHelper setSystemVibrateOpen:YES];
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:FUSUserUDKeys.fus_SETTING_LAUNCH_SOUND_SWITCH_BOOL];
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:kFUSConfigAppStatusUDKey];
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:FUSLiveUDKeys.fus_SHOULD_REMOTE_NOTIFICATION_TIP];
......
......@@ -114,17 +114,17 @@
};
FUSCustomSettingItem *messageSoundItem = [FUSCustomSettingItem fus_itemWithTitle:[NSString fus_localString:@"声音提醒"] type:CustomSettingItemTypeSwitch];
messageSoundItem.switchState = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_SETTING_SOUND_SWITCH_BOOL] boolValue];
messageSoundItem.switchState = [FUSSoundAndVibrateHelper systemSoundOpen];
messageSoundItem.switchClick = ^(FUSCustomSettingItem *item){
[FUSTalkingData fus_trackEvent:FUSUserEventTrackParams.fus_EVENT_SETTING_NEWSSLERT_SOUNDALERT];
[[NSUserDefaults standardUserDefaults] setObject:@(item.currentSwitchState) forKey:FUSUserUDKeys.fus_SETTING_SOUND_SWITCH_BOOL];
[FUSSoundAndVibrateHelper setSystemSoundOpen:item.currentSwitchState];
};
FUSCustomSettingItem *meesageShockItem = [FUSCustomSettingItem fus_itemWithTitle:[NSString fus_localString:@"振动提醒"] type:CustomSettingItemTypeSwitch];
meesageShockItem.switchState = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_SETTING_VIBRATE_SWITCH_BOOL] boolValue];
meesageShockItem.switchState = [FUSSoundAndVibrateHelper systemVibrateOpen];;
meesageShockItem.switchClick = ^(FUSCustomSettingItem *item){
[FUSTalkingData fus_trackEvent:FUSUserEventTrackParams.fus_EVENT_SETTING_NEWSSLERT_VIBRATEALERT];
[[NSUserDefaults standardUserDefaults] setObject:@(item.currentSwitchState) forKey:FUSUserUDKeys.fus_SETTING_VIBRATE_SWITCH_BOOL];
[FUSSoundAndVibrateHelper setSystemVibrateOpen:item.currentSwitchState];
};
FUSCustomSettingItem *clearAllUnreadItem = [FUSCustomSettingItem fus_itemWithTitle:[NSString fus_localString:@"全部标为已读"] type:CustomSettingItemTypeShowTextAndArrow];
......
......@@ -166,11 +166,10 @@
}
_url = url;
NSString *mute = [[NSUserDefaults standardUserDefaults] stringForKey:FUSUserUDKeys.fus_SETTING_SOUND_SWITCH_BOOL];
if (![NSString isNullWithString:FUSLiveHelper.shareInstance.roomInfoModel.roomId]) {
url = [FUSHttpManager fus_getHttUrl:url params:@{@"roomid":FUSLiveHelper.shareInstance.roomInfoModel.roomId}];
}
url = [FUSHttpManager fus_getHttUrl:url params:@{@"sound":mute}];
url = [FUSHttpManager fus_getHttUrl:url params:@{@"sound":@([FUSSoundAndVibrateHelper systemSoundOpen])}];
FUSWKWebViewController *wkVC = [[FUSWKWebViewController alloc] init];
wkVC.webView.clearCache = self.clearCache;
......
......@@ -338,17 +338,17 @@
};
_messageSoundItem = [FUSCustomSettingItem fus_itemWithTitle:[NSString fus_localString:@"声音提醒"] type:CustomSettingItemTypeSwitch];
_messageSoundItem.switchState = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_SETTING_SOUND_SWITCH_BOOL] boolValue];
_messageSoundItem.switchState = [FUSSoundAndVibrateHelper systemSoundOpen];
_messageSoundItem.switchClick = ^(FUSCustomSettingItem *item){
[FUSTalkingData fus_trackEvent:FUSUserEventTrackParams.fus_EVENT_SETTING_NEWSSLERT_SOUNDALERT];
[[NSUserDefaults standardUserDefaults] setObject:@(item.currentSwitchState) forKey:FUSUserUDKeys.fus_SETTING_SOUND_SWITCH_BOOL];
[FUSSoundAndVibrateHelper setSystemSoundOpen:item.currentSwitchState];
};
_meesageShockItem = [FUSCustomSettingItem fus_itemWithTitle:[NSString fus_localString:@"振动提醒"] type:CustomSettingItemTypeSwitch];
_meesageShockItem.switchState = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_SETTING_VIBRATE_SWITCH_BOOL] boolValue];
_meesageShockItem.switchState = [FUSSoundAndVibrateHelper systemVibrateOpen];
_meesageShockItem.switchClick = ^(FUSCustomSettingItem *item){
[FUSTalkingData fus_trackEvent:FUSUserEventTrackParams.fus_EVENT_SETTING_NEWSSLERT_VIBRATEALERT];
[[NSUserDefaults standardUserDefaults] setObject:@(item.currentSwitchState) forKey:FUSUserUDKeys.fus_SETTING_VIBRATE_SWITCH_BOOL];
[FUSSoundAndVibrateHelper setSystemVibrateOpen:item.currentSwitchState];
};
......
......@@ -326,7 +326,7 @@
[self.getAwardImageView setWebImageWithSubURLString:model.icon placeholder:[FUSUserCenterBunble imageNamed:@"checkIn_placeholder"] completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
BOOL soundSwitch = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_SETTING_SOUND_SWITCH_BOOL] boolValue];
BOOL soundSwitch = [FUSSoundAndVibrateHelper systemSoundOpen];
if (soundSwitch && FUSConfig.sharedInstanced.liveConfigs.isAnchor == NO) {
[FUSSoundAndVibrateHelper playSoundEffect:@"check_in_success" bundle:[FUSUserCenterBunble bundle] ofType:@"mp3"];
......
......@@ -181,7 +181,7 @@
completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
BOOL soundSwitch = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_SETTING_SOUND_SWITCH_BOOL] boolValue];
BOOL soundSwitch = [FUSSoundAndVibrateHelper systemSoundOpen];
if (soundSwitch && FUSConfig.sharedInstanced.liveConfigs.isAnchor == NO) {
[FUSSoundAndVibrateHelper playSoundEffect:@"check_in_success" bundle:[FUSUserCenterBunble bundle] ofType:@"mp3"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment