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

Use native barcode scanning on iOS #119

Closed
wants to merge 6 commits into from
Closed

Use native barcode scanning on iOS #119

wants to merge 6 commits into from

Conversation

DwayneCoussement
Copy link

@DwayneCoussement DwayneCoussement commented Mar 12, 2020

This Pull Request brings native iOS barcode scanning. This should fix the UIWebView references which could cause rejection by Apple's App Store.

Motivation: in April 2020 Apple won't accept any new apps with UIWebView in them anymore. In December 2020, existing apps have the same destiny. GoogleMobileVision still has this and has been moved to Firebase. So either going full native or adding the Firebase variant was a solution.

As of the current moment; native seemed the better solution (build times are lower if you don't have any other Firebase usage in your Flutter app, no need to have apikeys etc etc).

See also: https://developer.apple.com/news/?id=12232019b

@DwayneCoussement DwayneCoussement changed the title Use native barcode scanning. Use native barcode scanning on iOS Mar 12, 2020
@fryette
Copy link

fryette commented Mar 25, 2020

@DwayneCoussement bar codes seem broken

# Conflicts:
#	example/ios/Podfile.lock
#	example/ios/Runner.xcodeproj/project.pbxproj
@DwayneCoussement
Copy link
Author

My apologies for that; I do think we need to parameterize that part as well though.

@fryette
Copy link

fryette commented Mar 26, 2020

@rmtmckenzie Could you please take a look at this?

@SiavoshZarrasvand
Copy link

@rmtmckenzie Is this going to be merged? This package is very useful but the Pull-Requests are lagging behind and the issues are not being updated. Could be worthwhile to hand it over to someone who got the time to maintain it.

@rmtmckenzie
Copy link
Owner

Hi @SiavoshZarrasvand. I've been way too busy the last while, but this was also not the direction I wanted to go with the plugin - I've released a new version using FirebaseMobileVision. It took a while especially because I wanted to make sure my app with it integrated would actually be accepted by apple, which is has now.

If you're wanting to use the native barcode scanning I fully encourage you to keep a fork and publish it independently on pub.dev.

I do have a long-term plan to support different backends, but I also can't commit to any timeline to getting it done. See #121 though and if you think you'd like to use that give it a +1. If I start seeing a significant amount of support for it that will definitely encourage me to actually spend the time on it.

@SiavoshZarrasvand
Copy link

Done.

Where is the new release, is that in the master branch?

@rmtmckenzie
Copy link
Owner

It's on the master branch as well as on pub.dev

@DwayneCoussement
Copy link
Author

Hey,

I don’t think that having different implementations brings a lot of value at the current moment; unless you’d exclude your dependencies at build time. I went native because adding firebase for “just” scanning QR-codes in my case was a huge overhead on app size and couldn’t guarantee the user’s privacy as I’d want it to. If you’d have multiple implementations and libs in your podspec you’d not solve this problem; as libraries have access the moment they are included.

However I wanted to ask following questions here:

  • What does this mean for Huawei phones and the China region? And Android devices without play services (as this is becoming a thing)?
  • what does it mean for iOS clients in China?

@rmtmckenzie
Copy link
Owner

@DwayneCoussement My idea was to split the dependencies into separate plugins, so in your app you'd include for example qr_mobile_vision, and qr_mobile_vision_firebase_ios, and qr_mobile_vision_firebase_android to get the same behaviour as is built-in right now, or qr_mobile_vision and qr_mobile_vision_native_ios and qr_mobile_vision_zxing to get away from firebase. The qr_mobile_vision library would have no dependencies on anything other than the camera APIs, and would work with some sort of native registration process to get the frames from the camera to the processing APIs.

I also investigated simply using the camera package that the flutter team has made and the frames that are sent by it, but the overhead of transferring the data to dart and back caused some framerate issues, as well as the fact that it would crash from a memory leak.

@rmtmckenzie
Copy link
Owner

rmtmckenzie commented Apr 14, 2020

For Huawei phones and the china region, I'm not 100% sure what the upgrade to firebase means - but the current (released) implementation uses Google Mobile Vision and is heavily reliant on google play services, so the behaviour hasn't changed.

Oh but I've also just found this: https://firebase.google.cn/ - I think the firebase team has made firebase available for users in China through that endpoint. I have no idea how one would go about hooking that up in the app though - maybe by releasing a separate version of the app with an alternate firebase configuration, just for the chinese market?

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.

4 participants