-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
It seems we need to instantiate the SDK using:
public static func shared(token: String? = nil,
onUpdateStartCallback: StartClosureSignature? = nil,
onUpdateAvailableCallback: UpdateAvailableClosureSignature? = nil,
onUpdateProgressCallback: ProgressClosureSignature? = nil,
onUpdateSuccessCallback: SuccessClosureSignature? = nil,
onUpdateFailureCallback: FailureClosureSignature? = nil) throws -> ActiveLookSDK
Which for normal development purposes is useless, as we can leave the entire update responsibility to the ActiveLook app.
Because a normal developer does not have the token nor the possibility to download firmware updates, the only solution is to pass bogus parameters and return false in onUpdateAvailableCallback. This however stops the SDK from functioning returning:
discoveredGlasses.connectionErrorCallback?(ActiveLookError.sdkUpdateFailed)
self.updateParameters.notify(.updateFailed)
The error originates in:
guard httpResponse.statusCode != 403 else {
self.failed(with: GlassesUpdateError.invalidToken)
return
}
which makes sense since we don't have the right token to check for updates.
I forked the repo and I fixed it by putting this in the code:
glasses.fixInDeviceCmdStack {
glasses.cfgSet(name: "ALooK")
// parent.updateInitializedGlasses(glasses) --> this is not needed for 3rd party devs!
discoveredGlasses.connectionCallback?(glasses)
}
sw5813
Metadata
Metadata
Assignees
Labels
No labels