cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Fiori for iOS SDK - Barcode Scanner NOT working

SAPAI
Participant
0 Kudos

SDK 2.0 , Xcode 9.1

Hello,

trying to implement the barcode functionality as mentioned in the opensap course for fiori for ios sdk(CourseLink) but barcode scanner is not opening with button touch. Camera Scanner view does not open up.

Privacy permission assigned and also debug in console log shows camera is authorized.

I can filter the list using the search field with text but when I tap on the scanner icon nothing happens, the scanner view is not displayed.

Issue is same as asked by Barcode Scanning Not working but does not work for me.

Please suggest how to debug or fix it.

Console Log:

2017-12-05 15:04:54.322683-0500 hehe[34026:6147789] [general] # SAP.Fiori.Search.FUISearchBar - DEBUG - (Main) - FUISearchBar.swift.isCameraAvailable() - use camera is authorized

2017-12-05 15:05:37.401076-0500 hehe[34026:6147789] [general] # SAP.Fiori.Search.FUISearchController - INFO - (Main) - FUISearchController.swift.searchBarBookmarkButtonClicked - open barcode scanner

2017-12-05 15:05:37.551127-0500 hehe[34026:6147789] [general] # SAP.Fiori.BarcodeScanner.FUIBarcodeScanViewController - DEBUG - (Main) - FUIBarcodeScanViewController.swift.checkCameraAvailable() - use camera is authorized

View did load has code:

SAPAI
Participant
0 Kudos

Hello experts,

please provide any inputs.

Thanks.

jan-hua_chu
Explorer
0 Kudos

Hi Asif,

There is not enough info here. Could you send your project here?

I have a simple test view controller and the scan view did show up when the scan icon is tapped.

import UIKit

import SAPFiori

class CustomerSearchViewController: UIViewController, UISearchResultsUpdating {

    @IBOutlet var searchBarContainer: UIView!
    var searchController: FUISearchController!
    var productSearchBar: FUISearchBar!

    override func viewDidLoad() {

        super.viewDidLoad()
        searchBarContainer = UIView(frame: view.frame)
        self.view.addSubview(searchBarContainer)

        configureSearchBar()
    }
 
    func configureSearchBar() {
        searchController = FUISearchController()
        searchController.hidesNavigationBarDuringPresentation = true
        searchController.searchResultsUpdater = self

        productSearchBar = searchController.searchBar
        self.productSearchBar.isBarcodeScannerEnabled = true
        self.searchBarContainer.addSubview(searchController.searchBar)
    }

    func updateSearchResults(for searchController: UISearchController) {
        print("search result")
    }

}



Accepted Solutions (0)

Answers (0)