File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -96,10 +96,18 @@ +(BOOL)requiresMainQueueSetup{
96
96
}
97
97
98
98
RCT_EXPORT_METHOD (setVolume:(float )val config:(NSDictionary *)config){
99
+ [self stopObserving ];
100
+
99
101
dispatch_sync (dispatch_get_main_queue (), ^{
100
102
id showUI = [config objectForKey: @" showUI" ];
101
103
[self showVolumeUI: (showUI != nil && [showUI boolValue ])];
102
104
volumeSlider.value = val;
105
+
106
+ __weak RCTSystemSetting *weakSelf = self;
107
+ [[NSNotificationCenter defaultCenter ] addObserverForName: @" AVSystemController_SystemVolumeDidChangeNotification" object: nil queue: nil usingBlock: ^(NSNotification * _Nonnull note) {
108
+ __strong RCTSystemSetting *strongSelf = weakSelf;
109
+ [strongSelf startObserving ];
110
+ }];
103
111
});
104
112
}
105
113
You can’t perform that action at this time.
0 commit comments