-
Notifications
You must be signed in to change notification settings - Fork 24
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
Register plugin outside of AppDelegate #1
Register plugin outside of AppDelegate #1
Conversation
Hi @AnomalousLLC. This seems helpful, thanks. I don't use vision-camera-code-scanner on Expo right now so I'll take your word on it that the code works in that setup. I tried compiling this branch on the example project in this repo just to test that it still works without Expo and it did work for a regular build, but it failed to compile when building with
I just spent a while working with @bglgwyng to add support for Unfortunately, I don't know at the moment exactly how you might resolve this, but I'll spend a bit of time on it if you will and hopefully one of us will get there soon ;) |
Hi, @rkmackinnon! Appreciate your review.
Seems the header isn't included by default when linking statically & needed to be manually defined. Please try again with the Thanks |
Thanks for the update. I was able to do some more testing today. That branch got me part way there, but there seems to be a tricky naming convention for referencing that header depending on whether or not static linking is used. I was able to get it to work in both cases with an additional modification to VisionCameraCodeScanner.m. If there's a way to do it without the __has_include macro I think it would look nicer, but I'm happy to merge your PR if you include this change. #import <Foundation/Foundation.h>
#import "VisionCameraCodeScanner.h"
#if defined __has_include && __has_include("VisionCameraCodeScanner-Swift.h")
#import "VisionCameraCodeScanner-Swift.h"
#else
#import <VisionCameraCodeScanner/VisionCameraCodeScanner-Swift.h>
#endif
@implementation RegisterPlugins
+ (void) load {
[self registerPlugin:[[VisionCameraCodeScanner alloc] init]];
}
@end Cheers |
Hi again, @rkmackinnon! Good catch on the conditional import; just confirmed it's still working in EAS builds. Should be ready to merge. Cheers |
This is merged now. Thank you very much for your contribution. I've also made a couple more minor commits to the podspec and to the example app to take advantage of your new auto-registration code. At some point when the underlying VisionCamera repo is further along on their Android updates for v3 I'll spend some more time incorporating those changes here. |
Maintains compatibility with Expo out of the box, without requiring prebuild or ejecting