-
Notifications
You must be signed in to change notification settings - Fork 744
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
Intent clash with PhoneGap apps #28
Comments
While adding the ability to restrict the allowed barcode formats (cuts down on read errors), aside from passing that option thru to zxing, I made these changes in my copy: Within BarcodeScanner.java in plugin.xml: and I restored the action checking code that Eccenux commented out in EncodeActivity.java The zxing library is looking for the actions "com.google.zxing.client.android.SCAN" and "com.google.zxing.client.android.ENCODE" rather than "com.phonegap.plugins.barcodescanner.SCAN" and "ENCODE". Giving the specific component in the Intent prevents going to other apps that use the same library. I'm new to plugins and Android. Expect that this can be done better or just plain done right. Please speak up if you see problems with this approach. After some field testing, I'll try to share the restricted format code too. |
The problem is the scan intent name is the same for all applications built with PhoneGap.
Reproducing:
Result:
Android will show a menu to choose application. This might be confusing to the user. Not a big issue if all apps use the same version of the plugin and phonegap. If apps use different versions and the user choose default action then every other app will fail.
Two places need changing:
<action android:name="com.phonegap.plugins.barcodescanner.SCAN"/>
SCAN_INTENT = "com.phonegap.plugins.barcodescanner.SCAN";
Problem is both should be changed to add application (widget) id. Not sure if plugman allows this.
The text was updated successfully, but these errors were encountered: