jpsim / JPSVolumeButtonHandler

JPSVolumeButtonHandler provides an easy block interface to hardware volume buttons on iOS devices. Perfect for camera apps!
MIT License
333 stars 90 forks source link

Does not work in flutter project #61

Open matthias-glatthorn opened 3 years ago

matthias-glatthorn commented 3 years ago

I try to use JPSVolumeButtonHandler in a flutter project, but the volume buttons are not detected. This is how I used it:

AppDelegate.swift:

var volumeButtonHandler: JPSVolumeButtonHandler?
volumeButtonHandler = JPSVolumeButtonHandler(up: {self.doSomething()}, downBlock: {self.doSomething()})
volumeButtonHandler?.start(true)
...  
func doSomething() -> Void {  
...  
}