Skip to content
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

Question re: MdocReader #51

Open
warren-gallagher opened this issue Nov 28, 2024 · 1 comment
Open

Question re: MdocReader #51

warren-gallagher opened this issue Nov 28, 2024 · 1 comment

Comments

@warren-gallagher
Copy link

warren-gallagher commented Nov 28, 2024

Are the MdocReader and related Ble and BleConnection classes intended to support the creation of an mdL Verifier on iOS?

I have attempted to get this working by scanning a QR code presented by the EUDI wallet. Here is an example of what the EUDI wallet QR code provides:

mdoc:owBjMS4wAYIB2BhYS6QgAQECIVgg86qzNIr2qiktlGI2oGyEykvPWsIzZAgjQkKthPBlp88iWCB2YHkb-xvYQOwW6sqi5mRFBQ6OXnp6-nZTNsmZPvYhuwKBgwIBowD1AfQKUAAAY3EAABAAgAAAgF-bNPs

When I run my App (SwiftUI code shown below) an error:
Generic(value: "the device did not transmit a central client uuid")

The EUDI wallet always goes into peripheral mode and thus it will not provide a central client uuid. It would appear that the mobile-sdk-swift implementation assumes that it will be the peripheral.

Am I understanding things correctly? Is there a plan to support Central mode for the MdocReader?

import SwiftUI
import MobileSdkFramework

class MyBleReaderSessionStateDelegate : BLEReaderSessionStateDelegate {
    func update(state: BLEReaderSessionState) {
        print("bleSessionStateDelegate: \(state)")
    }
}
struct ContentView: View {
    
    @State var path: [String] = []
    
    var body: some View {
        NavigationStack(path: $path) {
            ZStack {
                VStack {
                    Button("Scan QR Code") {
                        path.append("Scan QR Code")
                    }
                 }
             }
            .navigationDestination(for: String.self) { value in
                QRCodeScanner(
                    onRead: { qrCode in
                        print("QR Code: \(qrCode)\n")
                        path.removeAll()
                        let requestedItems: [String: [String: Bool]] = ["org.iso.18013.5.1": ["given_name": true]]
                        MDocReader(callback: MyBleReaderSessionStateDelegate(), uri: qrCode,requestedItems: requestedItems, trustAnchorRegistry: nil);
                    },
                    onCancel: {
                        print("QR Code Scan cancelled\n")
                        path.removeAll()
                    }
                )
                .navigationBarBackButtonHidden()

            }
            .navigationTitle("mDoc Reader")
        }
    }
}

My App's Info.plist file has:

	<key>NSBluetoothAlwaysUsageDescription</key>
	<string>Secure transmission of mobile DL data</string>

I never see a prompt asking for permission for BlueTooth.
The app's settings does not show a switch for BlueTooth.
I expect that the app never prompts for permission because it fails parsing the URI from the qrCode and never actually attempts bluetooth communications.

@sbihel
Copy link
Member

sbihel commented Dec 9, 2024

You are correct. We have an internal tracking issue for this but it hasn't been prioritised yet.

sprucekit-mobile-monorepo bot pushed a commit that referenced this issue Dec 13, 2024
Add funding notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants