Code Monkey home page Code Monkey logo

Comments (14)

ryanheise avatar ryanheise commented on July 21, 2024 3

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.

abs0 avatar abs0 commented on July 21, 2024 2

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.

abs0 avatar abs0 commented on July 21, 2024 2

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.

ryanheise avatar ryanheise commented on July 21, 2024 1

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.

ryanheise avatar ryanheise commented on July 21, 2024 1

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.

ryanheise avatar ryanheise commented on July 21, 2024 1

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.

ryanheise avatar ryanheise commented on July 21, 2024 1

Should be fixed on the latest commit. I have also renamed the macro to AUDIO_SESSION_MICROPHONE.

from audio_session.

lukepighetti avatar lukepighetti commented on July 21, 2024

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.

ryanheise avatar ryanheise commented on July 21, 2024

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.

ryanheise avatar ryanheise commented on July 21, 2024

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.

abs0 avatar abs0 commented on July 21, 2024

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.

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.

lukepighetti avatar lukepighetti commented on July 21, 2024

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.

abs0 avatar abs0 commented on July 21, 2024

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.

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.

ryanheise avatar ryanheise commented on July 21, 2024

Glad to hear it!

I have just published the latest updates in 0.1.3.

from audio_session.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.