Skip to content

on iOS: native volume UI stop working after calling clearWatch() #19

Open
@zangi-dev

Description

@zangi-dev

Describe the bug
on version 6.0.1 after calling closeWatch() the native volume UI is not visible anymore inside the app. I need to restart the app to see the volume UI again.

To Reproduce
Steps to reproduce the behavior:

  1. Press Volume button - native UI is showing
  2. startWatch
  3. Press Volume button - native UI is not showing (correct)
  4. clearWatch
  5. Press Volume button - native UI is not showing (not correct)

Expected behavior
at point 5 the native UI should come up

Smartphone (please complete the following information):

  • Device: iPhone 11
  • OS: 18.3.2
  • Plugin Version: 6.0.1

Additional context
If I modify the stopHandler in VolumeButtonHandler.swift like this

public func stopHandler() {
        guard isStarted else { return }
        isStarted = false
        volumeView?.isHidden = false
        self.observation = nil
        NotificationCenter.default.removeObserver(self)
        try? session?.setActive(false) // <-- Add this line
        DispatchQueue.main.async { // <-- Add this line
            self.volumeView?.removeFromSuperview() // <-- Add this line
        } // <-- Add this line
    }

the native volume ui start showing again at point 5. The problem is that if I start watching again the native UI still shows.

Android work as expected. Thanks!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions