我正在构建一个 qr 考勤扫描仪,并希望查看扫描是否在我的收藏中的start和end时间字段的限制范围内session。如果扫描发生在两次之间,则应被接受,否则将不被接受并显示祝酒词。目前我有它检查会话是否只存在而不是在开始和结束时间字段的时间之间。rawData 是sessionID从二维码中提取的,一旦提取,它会检查它是否是有效的 sessionID。现在我只需要检查扫描时间。任何帮助都会很棒:
private void barcodeRecognition(Bitmap photo) {
FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(photo);
FirebaseVisionBarcodeDetector detector = FirebaseVision.getInstance()
.getVisionBarcodeDetector();
Task<List<FirebaseVisionBarcode>> result = detector.detectInImage(image)
.addOnSuccessListener(new OnSuccessListener<List<FirebaseVisionBarcode>>() {
@Override
public void onSuccess(List<FirebaseVisionBarcode> barcodes) {
for (FirebaseVisionBarcode barcode: barcodes) {
Rect bounds = barcode.getBoundingBox();
Point[] corners = barcode.getCornerPoints();
final String rawValue = barcode.getRawValue();
int valueType = barcode.getValueType();
mAuth.getCurrentUser();
// TRY LINKING TO userUID on Attendance on Firebase console
FirebaseUser currentUser = mAuth.getCurrentUser();
final String user = currentUser.getUid(); // USED TO GET CURRENT USER UID OF PERSON LOGGED IN
//THIS CAN BE SET TO .getUserName() or getEmail() depending on preference
}
}
}
});
慕村225694
相关分类