Comments (14)
I haven't tested it but defaulting to all working and opt-in to remove is my preference, I believe that's also how
permissions_handler
works which is kind of the blueprint for all others because it's so ubiquitous
As it turns out, permissions_handler has flipped to the opt-in so that by default nothing works and you must add an option to compile that code in.
I think we should do the same for audio_session. Of course for audio_session it would not be true that the default means "nothing works" since everything except for the microphone should work by default. This will also make the platform setup easier for just_audio.
Of course it will technically be a breaking change which I have avoided until now.
Any thoughts before I go ahead with this?
from audio_session.
This would be very handy for us - we've just started using audio_session and currently have a modified copy to avoid the RecordPermission related calls to avoid triggering Apple's ITMS-90683 check.
Obviously if we're not triggering any of the code users will not see a popup asking for microphone access when using the app, but we'd prefer the App Privacy section in the Store to not mention microphone access at all
from audio_session.
Should be fixed on the latest commit. I have also renamed the macro to
AUDIO_SESSION_MICROPHONE
.
Perfick - just had a happy upload to TestFlight with AUDIO_SESSION_MICROPHONE=0
Thanks again
from audio_session.
It's just an idea on the wishlist at this stage and it may be a while before I can actually get around to it (working hard on the next audio_service release right now). But if someone else wants to take a crack at it, you would be very welcome to help out!
from audio_session.
The latest commit implements @lukepighetti 's suggestion (explained in the README). I'm not sure of the comprehensive list of APIs that need to be compiled out for it to pass the app store's privacy test but let me know if there's any more code I should compile out and I can make the change.
from audio_session.
Ah, sorry. There shouldn't be an equals sign, there should be a space:
#define MICROPHONE_ENABLED 1
It's been a while since I've used the preprocessor.
I'm also thinking of renaming this macro to something more unique to audio_session in case there is ever a name clash with other plugins.
from audio_session.
Should be fixed on the latest commit. I have also renamed the macro to AUDIO_SESSION_MICROPHONE
.
from audio_session.
I am also running into this issue. Would be nice if there was a clean way to handle it.
permission_handler
uses code in Podfile to handle this, for what it's worth.
from audio_session.
Thanks for sharing @lukepighetti . I'm happy to go with that approach since --dart-define
is not as convenient as I had hoped. (Another option could be to do something with .xcconfig
files.)
from audio_session.
FYI you can test this by adding the following to the dependency_overrides section of your pubspec.yaml:
audio_session:
git:
url: https://github.com/ryanheise/audio_session.git
I would appreciate hearing about whether it works for you or whether there are any issues. If all is well I'll publish the next release.
from audio_session.
FYI you can test this by adding the following to the dependency_overrides section of your pubspec.yaml:
audio_session: git: url: https://github.com/ryanheise/audio_session.gitI would appreciate hearing about whether it works for you or whether there are any issues. If all is well I'll publish the next release.
I think you may need to add an #ifundef MICROPHONE_ENABLED to default it to 1 for users who do not add the Podfile chunk
(Many thanks for this change)
David
from audio_session.
I haven't tested it but defaulting to all working and opt-in to remove is my preference, I believe that's also how permissions_handler
works which is kind of the blueprint for all others because it's so ubiquitous
from audio_session.
FYI you can test this by adding the following to the dependency_overrides section of your pubspec.yaml:
audio_session: git: url: https://github.com/ryanheise/audio_session.gitI would appreciate hearing about whether it works for you or whether there are any issues. If all is well I'll publish the next release.
I think you may need to add an #ifundef MICROPHONE_ENABLED to default it to 1 for users who do not add the Podfile chunk
(Many thanks for this change)
David
Ah - I see one is in there already, which makes the following unexpected?
Command CompileSwift failed with a nonzero exit code
In file included from /Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:1:
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.h:4:31: warning: ISO C99 requires whitespace after the macro name [-Wc99-extensions]
#define MICROPHONE_ENABLED=1
^
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:214:5: error: invalid token at start of a preprocessor expression
#if MICROPHONE_ENABLED
^
In file included from /Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:1:
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.h:4:31: note: expanded from macro 'MICROPHONE_ENABLED'
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:222:5: error: invalid token at start of a preprocessor expression
#if MICROPHONE_ENABLED
^
In file included from /Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:1:
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.h:4:31: note: expanded from macro 'MICROPHONE_ENABLED'
#define MICROPHONE_ENABLED=1
^
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:478:5: error: invalid token at start of a preprocessor expression
#if MICROPHONE_ENABLED
^
In file included from /Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:1:
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.h:4:31: note: expanded from macro 'MICROPHONE_ENABLED'
#define MICROPHONE_ENABLED=1
^
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:492:5: error: invalid token at start of a preprocessor expression
#if MICROPHONE_ENABLED
^
In file included from /Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:1:
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.h:4:31: note: expanded from macro 'MICROPHONE_ENABLED'
#define MICROPHONE_ENABLED=1
^
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:586:5: error: invalid token at start of a preprocessor expression
#if MICROPHONE_ENABLED
^
In file included from /Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.m:1:
/Users/abs/.pub-cache/git/audio_session-9e435529b1314e84e77ef40ee6c2d58c648dd104/ios/Classes/DarwinAudioSession.h:4:31: note: expanded from macro 'MICROPHONE_ENABLED'
#define MICROPHONE_ENABLED=1
from audio_session.
Glad to hear it!
I have just published the latest updates in 0.1.3.
from audio_session.
Related Issues (20)
- Stop audio when another app plays audio! HOT 1
- How to configure session to use Bluetooth headset mic on Android? HOT 6
- Can't build on android when targetting android 34 HOT 11
- Add privacy manifest for Apple HOT 6
- [iOS] Background audio not playing on iPhone 13+ HOT 3
- AVAudioSessionCategoryOptions.mixWithOthers stops background music the first time when audio is player, after continuing the music further sounds no longer stop the music HOT 1
- Call requires API level 23 (current min is 16) HOT 1
- Can not play by speaker on iOS HOT 3
- Is it possible to play audio when Do Not Disturb mode is on, but not in silent mode? HOT 1
- `AVAudioSessionCategoryOptions`'s `contains` method takes `AVAudioSessionInterruptionOptions`. Maybe it should be `AVAudioSessionCategoryOptions`? HOT 5
- Dependency causing an ANR in the Background HOT 3
- The music played by IOS17 is not output from Bluetooth earphones HOT 2
- Android detects the headset as if it is connected even if it is not HOT 1
- Trouble closing an audio session HOT 1
- Echo cancellation HOT 3
- Can't get current audio device HOT 1
- failed for task ':audio_session:compileReleaseJavaWithJavac' (target SDK 33) HOT 1
- AudioSessionConfiguration with multiple categories causes PlatformException(-50)
- Execution failed for task ':audio_session:compileDebugJavaWithJavac'
- [Question] Can audio playback be started while app is in the background in IOS? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audio_session.