below / MatterSample

A Sample for iOS 16.1 MatterSupport.Framework
MIT License
14 stars 3 forks source link

Compilation failure #2

Closed CodeOcenS closed 1 year ago

CodeOcenS commented 1 year ago

After I modify the bundle ID, the project cannot be compiled. If I want to successfully use MatterSupport, do I have to apply for com.apple.developer.networking.manage-thread-network-credentials? At present, I keep prompting the following error after scanning the code Error Domain=HMFErrorDomain Code=12 "Operation canceled." UserInfo={NSLocalizedDescription=Operation canceled.} or Error Domain=HMErrorDomain Code=18 "Pairing Failed" UserInfo={NSLocalizedDescription=Pairing Failed, NSUnderlyingError=0x280adfe40 {Error Domain=HAPErrorDomain Code=15 "(null)"}}

below commented 1 year ago

Yes, for the sample to work like this you need com.apple.developer.networking.manage-thread-network-credentials. That said, this applies only for the Thead part. The MatterSupport Framework should work without this entitlement

CodeOcenS commented 1 year ago

We don't plan to use Thread, I try to delete com.apple.developer.networking.manage-thread-network-credentials, the project can compile and run. But still got error: Error Domain=HMFErrorDomain Code=12 "Operation canceled." UserInfo={NSLocalizedDescription=Operation canceled.} Is it related to the mobile phone system? I tried both from iOS16.1-iOS16.2, based on this error. But the actual device has been configured into the network.

below commented 1 year ago

You are seeing the precise error I see. The project is meant to demonstrate that issue

GollenGao commented 1 year ago

You can try to use the App Groups to save the onboardingPayload override func commissionDevice(in home: MatterAddDeviceRequest.Home?, onboardingPayload: String, commissioningID: UUID) async throws { let userDefault = UserDefaults(suiteName: "") userDefault?.set(onboardingPayload, forKey: "") } Then,In your APP get it.

CodeOcenS commented 1 year ago

You can try to use the App Groups to save the onboardingPayload override func commissionDevice(in home: MatterAddDeviceRequest.Home?, onboardingPayload: String, commissioningID: UUID) async throws { let userDefault = UserDefaults(suiteName: "") userDefault?.set(onboardingPayload, forKey: "") } Then,In your APP get it.

Thanks! I will try it.