Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #26 #182

Merged
merged 6 commits into from Jan 6, 2020
Merged

Conversation

ty0x2333
Copy link
Contributor

I used this library in my application. But when I submitted the application to the app store for review, I received a warning email. same as #26.

I see in README that "on iOS you will have to include all permission options when you want to submit your app". This makes this library almost impossible to use on iOS.

I added some macro definitions to remove useless permissions. (reference: https://github.com/delba/permission)

This PR will not change any default behavior.

By default, these macro definitions do not exist, and the code will default that they are enabled. Unless the user specifies their value in the Podfile.

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

feature

⤵️ What is the current behavior?

same as before

🆕 What is the new behavior (if this is a feature change)?

Users can remove unused permission codes on iOS.

💥 Does this PR introduce a breaking change?

No

🐛 Recommendations for testing

Usage: 296982b

📝 Links to relevant issues/docs

#26

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines (code style guide)
  • Relevant documentation was updated
  • Rebased onto current develop

@SpajicM
Copy link

SpajicM commented Dec 30, 2019

Finally a proper fix for this! Thanks!

Copy link
Member

@mvanbeusekom mvanbeusekom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ty0x2333 thank you very much for this PR it looks very good. Sorry for the late reply, I was on holiday during the festive season.

I do have one small remark which is related to the documentation, please have a look.

README.md Show resolved Hide resolved
@mvanbeusekom mvanbeusekom added this to the 4.1.0 milestone Jan 6, 2020
@mvanbeusekom
Copy link
Member

Resolves: #26
Resolves: #179

mvanbeusekom
mvanbeusekom previously approved these changes Jan 6, 2020
Copy link
Member

@mvanbeusekom mvanbeusekom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this looks great.

@mvanbeusekom mvanbeusekom merged commit a1b96e6 into Baseflow:develop Jan 6, 2020
@jikeyt
Copy link

jikeyt commented Jan 9, 2020

@ty0x2333 I need only camera and photos permission. I added the following code in the podfile, excluded those two, cleaned and rebuilt. But once uploaded to TestFlight, I'm still getting the error. Am I missing something? PFA.

Screenshot 2020-01-09 at 5 11 40 PM

@mvanbeusekom
Copy link
Member

@jikeyt just checking the obvious, which version of the plugin are you using? This feature is not yet released to pub and should only work if you reference the develop branch (or the fork from @ty0x2333).

@mvanbeusekom
Copy link
Member

We just (5 minutes ago) released version 4.1.0 which contains the contents of this PR.

@ramoncardena
Copy link

Thanks so much for this fix @ty0x2333!

@brunozanoelo
Copy link

brunozanoelo commented Jul 8, 2020

Hello @mvanbeusekom. I´m developin with flutter for Android and iOS, I don´t have any Podfile on my project, because I use windows. Where should I change those permission? Thank you.

@mvanbeusekom
Copy link
Member

mvanbeusekom commented Jul 8, 2020

Hi @brunozanoelo, if you want to develop for iOS you will have to compile your project on a Apple machine running macOS, there is no escaping to this. So if you stick to Windows you will not be able to develop the iOS App (or at least compile it). In this case you will only be able to develop for Android and the web (and in the near future Windows and Linux Desktop).

Most likely Flutter noticed you are running on Windows when you initially created your project and didn't setup the iOS part of the project (in your project root there should be an ios folder is you want to release to iOS, this is also the folder that would contain the Podfile file).

In your case there will not be an iOS App and thus no need to worry about the permission configuration yet. Once you get hold of a Apple machine with macOS and Xcode you will be able to generate the iOS part of the Flutter project and you will automatically also have a Podfile.

@brunozanoelo
Copy link

brunozanoelo commented Jul 9, 2020

Hello @mvanbeusekom, Thank you for you reply.

I don´t have an mac computer, so I´m building this with Codemagic, with him, I´m able to build and automatically publish into Play Store and Apple Store. However, the changes to run the app inside Podfile is very difficult for me, since I need to access the cloud machine pretty fast and change the Podfile everytime I build one version, and actually, this is not working so far.

It seens, I´m the different one, but buying one macOS will be pretty expensive in my country.

@SpajicM
Copy link

SpajicM commented Jul 9, 2020

@brunozanoelo I've used MacInCloud to do iOS specific things, it's pretty cheap if you only need it for a couple of days, and first 24h were free.

> IMPORTANT: On iOS you will have to include all permission options when you want to submit your App. This is because the `permission_handler` plugin touches all different SDKs and because the static code analyser (run by Apple upon App submission) detects this and will assert if it cannot find a matching permission option in the `Info.plist`. More information about this can be found [here](https://github.com/Baseflow/flutter-permission-handler/issues/26). Unfortunately we don't have a good solution for this.
> IMPORTANT: ~~On iOS you will have to include all permission options when you want to submit your App.~~ This is because the `permission_handler` plugin touches all different SDKs and because the static code analyser (run by Apple upon App submission) detects this and will assert if it cannot find a matching permission option in the `Info.plist`. More information about this can be found [here](https://github.com/BaseflowIT/flutter-permission-handler/issues/26).

On iOS, the permission_handler plugin use [macros](https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/ios/Classes/PermissionHandlerEnums.h) to control whether a permission is supported.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL is no longer valid. Any chance to submit a pr to correct it?


On iOS, the permission_handler plugin use [macros](https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/ios/Classes/PermissionHandlerEnums.h) to control whether a permission is supported.

By default, all the permissions listed [here](https://github.com/Baseflow/flutter-permission-handler#list-of-available-permissions) are supported.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL is no longer valid. Any chance to submit a pr to correct it?

> ... # Here are some configurations automatically generated by flutter
>
> # You can remove unused permissions here
> # for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/ios/Classes/PermissionHandlerEnums.h

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL is no longer valid. Any chance to submit a pr to correct it?

@@ -64,6 +64,47 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'

# You can remove unused permissions here
# for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/ios/Classes/PermissionHandlerEnums.h

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL is no longer valid. Any chance to submit a pr to correct it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants