[bug] CodeScanner doesn't work in ios

17 vues
Accéder directement au premier message non lu

Fuad Nassar

non lue,
14 févr. 2020, 10:17:5614/02/2020
à CodenameOne Discussions
Device: ios 13.1
our app need a scan qr code in ios device,so we tried to use this code to scan qr-code but that does not work for both package (codescan&ext.codescan)

import com.codename1.codescan.CodeScanner;
import com.codename1.codescan.ScanResult;
 if (CodeScanner.getInstance() != null) {
                CodeScanner.getInstance().scanQRCode(new ScanResult() {
                    public void scanCompleted(String contents, String formatName, byte[] rawBytes) {
                        Dialog.show("Completed", contents, "OK", null);
                    }

                    public void scanCanceled() {
                        Dialog.show("Cancelled", "Scan Cancelled", "OK", null);
                    }
                    public void scanError(int errorCode, String message) {
                        Dialog.show("Error", message, "OK", null);
                    }
                });
            } else {
                Dialog.show("Wearing", "CodeScanner == null", "OK", null);
            }
the result when run on ios(13.1): app does not do anything and scan does not be started

we know the above code was deprecated, so we tried add cn1-codescan.cn1lib with same above code just change imports to
import com.codename1.ext.codescan.CodeScanner;
import com.codename1.ext.codescan.ScanResult;
the result when run on ios(13.1): app was closed like is a pretty crash
we also tried ZXing-cn1.cn1lib but also there's no any doing. 

how we can scan qr code in ios with easy way?

Shai Almog

non lue,
15 févr. 2020, 01:17:0015/02/2020
à CodenameOne Discussions
Only the cn1lib will work, that code doesn't exist anymore in Codename One core. There might be a regression with 13.1 please file an issue and we'll look into it.

Fuad Nassar

non lue,
25 févr. 2020, 14:25:1225/02/2020
à CodenameOne Discussions

Thank you shai, 
actually the problem has fixed by add these hint
ios.NSCameraUsageDescription=Some functionality of the application requires access to your camera
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message