Why is haptic feedback ineffective on iOS devices during stream publishing?
Problem Description
After integrating the ZEGO Express SDK in an iOS app, calling system haptic feedback related interfaces (such as UIImpactFeedbackGenerator, UINotificationFeedbackGenerator, AudioServicesPlaySystemSound, etc.) during stream publishing has no effect, and the device does not vibrate.
Problem Cause
This is the default behavior of the iOS system, not an SDK defect. When AVAudioSession is set to a recording-related Category (record or playAndRecord), the system will disable haptic feedback and system sounds triggered by the app to prevent these vibrations/sounds from being captured by the microphone, which would interfere with call quality.
Solution
The ZEGO Express SDK provides an advanced configuration option allow_haptics_during_recording. After setting it to true, the SDK will internally set the allowHapticsAndSystemSoundsDuringRecording property to true, thereby preserving the app's vibration capability during stream publishing.
This configuration must be set via the setEngineConfig interface (in the advancedConfig) before calling createEngineWithProfile to create the engine.
