Posts

Post not yet marked as solved
0 Replies
705 Views
Hello there, I'm using firebase to push notification with data is: { "notification": { "title": "Title notification", "category": "GENERAL", "body": "body notification", "sound": "default" }, "mutable_content": true, "data": { "title": "Title message", "body": "Body message.", "idhit": "a043dada-1208-4067-b5b6-50bc8578bfc3", "gmtdatetimeid": "620989200", "typehit": 0, "carnumber": "ABC123", "alertname": "Unauthorized Vehicle", "gmtDatetime": "2020/06/05 07:28:30.929", "latitude":"10.792332496703715", "longitude":"106.68018372088815" }, "registration_ids": [ "eBStmdlNfUzJghm1KwpKr-:APA91bGcqODroQnUKKOvJmlg3Vs1ej9Zq-" ] } when my app receive data, i want to get GPS of device and compare it with gps from notification. How do did it, thanks!!!
Posted Last updated
.
Post not yet marked as solved
0 Replies
396 Views
Hi Team,I'm using AVFoundation AVCaptureMetadataOutput for scan barcodeHere is my code- (BOOL)startReading { NSError *error; AVCaptureDevice *captureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:captureDevice error:&error]; if (!input) { NSLog(@"%@", [error localizedDescription]); return NO; } m_pCaptureSession = [[AVCaptureSession alloc] init]; [m_pCaptureSession addInput:input]; m_pCaptureSession.sessionPreset = AVCaptureSessionPresetHigh; AVCaptureMetadataOutput *captureMetadataOutput = [[AVCaptureMetadataOutput alloc] init]; [m_pCaptureSession addOutput:captureMetadataOutput]; //captureMetadataOutput.metadataObjectTypes = [captureMetadataOutput availableMetadataObjectTypes]; captureMetadataOutput.metadataObjectTypes = [[NSArray alloc] initWithObjects:AVMetadataObjectTypePDF417Code, nil]; [captureMetadataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()]; //AVCaptureVideoPreviewLayer *previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:m_pCaptureSession]; m_pPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:m_pCaptureSession]; [m_pPreviewLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill]; [m_pPreviewLayer setFrame:m_pLayoutPreview.layer.bounds]; [self->m_pLayoutPreview.layer addSublayer:m_pPreviewLayer]; [self->m_pLayoutPreview setHidden:NO]; [self->m_pLayoutContent setHidden:YES]; [m_pCaptureSession startRunning]; return YES;}- (void)captureOutput:(AVCaptureOutput *)output didOutputMetadataObjects:(NSArray<__kindof AVMetadataObject *> *)metadataObjects fromConnection:(AVCaptureConnection *)connection{ for (AVMetadataObject *barcodeMetadata in metadataObjects) { if ([barcodeMetadata.type isEqualToString:AVMetadataObjectTypePDF417Code]) { //AVMetadataMachineReadableCodeObject *barcodeObject = (AVMetadataMachineReadableCodeObject *)[m_pPreviewLayer transformedMetadataObjectForMetadataObject:barcodeMetadata]; AVMetadataMachineReadableCodeObject *barcodeObject = metadataObjects[0]; m_sDataScanLincenseNumber = [barcodeObject stringValue]; [self performSelectorOnMainThread:@selector(fillData) withObject:nil waitUntilDone:NO]; return; } }}It's work good.But it's not work with this code https://imge.to/i/vJLJdj However, my android app can detect data from this barcodePlease tell me my problem is what? and how to relolve itThanks.
Posted Last updated
.
Post not yet marked as solved
2 Replies
459 Views
In my iOS app.I using AVCaptureDevice setVideoZoomFactor, it working on iphone 6s but not wotking on iphone x. Please help me !!!i used to iphone 6x, iphone x, not simulator.And this is my code:- (IBAction)zoom:(id)sender { if(sender == m_pSliderZoom) { AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; NSError *error = nil; if ([device lockForConfiguration:&error]) { CGFloat desiredZoomFactor = m_pSliderZoom.value; [device setVideoZoomFactor:desiredZoomFactor]; NSLog(@"desiredZoomFactor ===> %0.6f", [device videoZoomFactor]); [device unlockForConfiguration]; } else { NSLog(@"error: %@", error); } }}And I receive log when drag slider:2019-07-26 15:06:59.075713+0700 TestZoom[1796:606237] desiredZoomFactor ===> 1.5318632019-07-26 15:06:59.076881+0700 TestZoom[1796:606237] desiredZoomFactor ===> 1.9093142019-07-26 15:06:59.078562+0700 TestZoom[1796:606237] desiredZoomFactor ===> 2.0637252019-07-26 15:06:59.094162+0700 TestZoom[1796:606237] desiredZoomFactor ===> 2.2524512019-07-26 15:06:59.109871+0700 TestZoom[1796:606237] desiredZoomFactor ===> 2.4411762019-07-26 15:06:59.126421+0700 TestZoom[1796:606237] desiredZoomFactor ===> 2.6299022019-07-26 15:06:59.143637+0700 TestZoom[1796:606237] desiredZoomFactor ===> 2.8014712019-07-26 15:06:59.159782+0700 TestZoom[1796:606237] desiredZoomFactor ===> 2.9558822019-07-26 15:06:59.176801+0700 TestZoom[1796:606237] desiredZoomFactor ===> 3.1274512019-07-26 15:06:59.193331+0700 TestZoom[1796:606237] desiredZoomFactor ===> 3.2475492019-07-26 15:06:59.210576+0700 TestZoom[1796:606237] desiredZoomFactor ===> 3.3504902019-07-26 15:06:59.227216+0700 TestZoom[1796:606237] desiredZoomFactor ===> 3.4534312019-07-26 15:06:59.243693+0700 TestZoom[1796:606237] desiredZoomFactor ===> 3.5392162019-07-26 15:06:59.260550+0700 TestZoom[1796:606237] desiredZoomFactor ===> 3.6250002019-07-26 15:06:59.276855+0700 TestZoom[1796:606237] desiredZoomFactor ===> 3.6936272019-07-26 15:06:59.294198+0700 TestZoom[1796:606237] desiredZoomFactor ===> 3.7622552019-07-26 15:06:59.310467+0700 TestZoom[1796:606237] desiredZoomFactor ===> 3.813725.....
Posted Last updated
.