Skip to content

Releases: aferodeveloper/AferoSwiftSDK

Bump Softhub to 1.6.3

02 Aug 23:08
Compare
Choose a tag to compare

Release 1.2.3 is a maintenance release which bumps the softhub prereq version to 1.6.3, which resolves a potential crash in connection handling.

There are no user-facing changes.

Support Password Reset Flow, Expose Softhub Mode

22 May 23:42
Compare
Choose a tag to compare

This release introduces calls to support password reset, and exposes the Softhub mode startup parameter.

Password Recovery/Reset

Release 1.2.2 supports password recovery/reset via three new APIClient calls:

  • sendPasswordRecoveryEmail(for:appId:) -> Promise<Void> sends a request to the Afero service to send a password reset code to the email address associated with an account.

  • updatePassword(with:shortCode:appId:) -> Promise<Void> provides a means to reset a user's password while unauthenticated, using a code obtained from a recovery email sent in response to sendPasswordRecoveryEmail(...).

  • updatePassword(with:credentialId:accountId:) -> Promise<Void> provides a means to change a password while authenticated, without the need for a recovery email to be sent.

The AferoLab sample app has been updated with example code and UI that exercises these methods.

Softhub Mode Parameter

While this is now publicly available, it should only be changed at the explicit direction of Afero. Otherwise, its default setting is correct.

Release 1.2.1: softhub version bump

22 May 22:42
Compare
Choose a tag to compare

This release simply updates the softhub prerequisite to 1.6.2.

Swift 4.2 / Swift 5

16 Apr 00:56
Compare
Choose a tag to compare

Overview

AferoSwiftSDK 1.2.0 introduces full Swift 4.2/Swift 5 support, and drops support for Swift 3.

Migration

No post-install hooks required

Prior releases of the SDK required a cocoapods post-install hook in the app Podfile it explicitly set the Swift version to 3.2, if the the toolchain defaulted to Swift 4. This is no longer the case; AferoSwiftSDK compiles under both Swift 4.2 and Swift 5.

Breaking Change: ReactiveSwift 5.0 Observer Type

AferoSwiftSDK 1.2.0 updates its ReactiveSwift prerequisite to version 5, which introduces an updated signature for the Observer type. While it's not necessary to implement an Observer in the course of using AferoSwiftSDK, developers who have done so will have to adapt their code to conform.

Emits Error Reactive <5 Type Reactive 5 Type
Yes Observer<EventType, ErrorType> Signal<EventType, ErrorType>.Observer
No Observer<EventType, NoError> Signal<EventType, NoError>.Observer

The following is the single patch required in AferoLab to affect this change (see f08441e):

-    fileprivate typealias CollatorEventSink = Observer<CollatorEvent, NoError>
+    fileprivate typealias CollatorEventSink = Signal<CollatorEvent, NoError>.Observer

Reporting issues

Please report issues to your Afero Customer Enablement representative with any issues you encounter. In your report, please indicate:

  • Development Environment OS and Toolchain Versions
  • Host environment (phone/tablet) hardware and OS versions
  • A description of the problem, with expected and observed results
  • Your Podfile and Podfile.lock, and
  • If possible, test code exhibiting the issue.

AferoSwiftSDK 1.0.15: Pin to AferoSofthub 1.4.5

16 May 21:30
Compare
Choose a tag to compare

This release of AferoSwiftSDK pins to AferoSofthub 1.4.5 only; there are no other changes from 1.0.14.

Pin to AferoSofthub 1.4.4

04 Apr 18:03
Compare
Choose a tag to compare

This release simply pins AferoSwiftSDK to AferoSofthub 1.4.4, to pick up support for app thinning on 32-bit architectures.

AferoSwiftSDK 1.0.9

27 Mar 20:04
Compare
Choose a tag to compare

AferoSwiftSDK 1.0.9

AferoSwiftSDK 1.0.9 is a maintenance release.

New Features

Softhub

AferoSwiftSDK 1.0.9 introduces the Softhub class, vended via the Afero module. This is the supported public interface for interacting with the Afero softhub.

IMPORTANT

As of this release, direct third-party interaction with the AferoSofthub module is no longer supported.

Users of this release should remove references to AferoSofthub from application Podfiles. Instead, pod "AferoSwiftSDK", "1.0.9" will implicitly pull in the appropriate Softhub version. Additionally, import AferoSofthub statements should be removed from Swift source files.

See Softhub.md for details.

Bug Fixes

(These are included in AferoSofthub 1.4.3, implicitly imported)

  • HUB-841: Softhub OOB crash when connecting to peripherals
  • HUB-798/ACE-170/ACE-173: Softhub crashes when quickly starting/stopping

1.0.1 Fix setTimeZone() symbol visibility

04 Jan 22:41
Compare
Choose a tag to compare

This is a maintenance release that fixes availability of DeviceModelable.setTimeZone(as:isUserOverride:)->Promise<SetTimezoneResult>. The symptom of this problem in AferoSwiftSDK 1.0.0. is that the link phase of RELEASE builds fails, therefore failing builds for archiving and profiling.

DeviceTags and WifiSetup

22 Dec 00:27
Compare
Choose a tag to compare

AferoSwiftSDK 1.0.0: DeviceTags and Wifi Setup

WARNING: AferoSwiftSDK 1.0.0 contains an issue in which the link phase of RELEASE builds fails, therefore failing builds for archiving and profiling, when DeviceModelable.setTimeZone(as:isUserOverride:)->Promise<> is referenced. The problem is fixed in AferoSwiftSDK 1.0.1.

AferoSwiftSDK introduces a new API, DeviceTags, which allows arbitrary tags (optionally grouped by keys) on a DeviceModel object. It also introduces Wifi Setup functionality in the AferoLab app.

DeviceTags API

AferoSwiftSDK introduces the DeviceTags API for all devices. The API is available via the DeviceTagCollection class, accessible via deviceTagCollection on a DeviceModel. For an example of usage, see DeviceInspectorViewController.swift, specifically:

  • DeviceInspectorViewController.swift:379 provides an example of tag collection content observation.
  • EditTagViewController.swift provides an example of editing tags in a collection.

DeviceTagCollection instances support the following operations:

    /// The set of all `DeviceTag` instances for the device. This value is KVO-compliant.
    @objc private(set) public dynamic var deviceTags: Set<Afero.DeviceTagCollection.DeviceTag> { get set }

    /// The number of tags in the collection.
    internal var count: Int { get }

    /// Get a deviceTag for the given identifier.
    /// - parameter id: The `UUID` of the tag to fetch.
    /// - returns: The matching `DeviceTag`, if any.
    public func deviceTag(forIdentifier id: DeviceTag.Id) -> DeviceTag?

    /// Get all `deviceTag` for the given `key`.
    /// - parameter key: The `DeviceTag.Key` to match.
    /// - returns: All `DeviceTag`s whose key equals `key`
    public func deviceTags(forKey key: DeviceTag.Key) -> Set<DeviceTag>

    /// Get the last `deviceTag` for the given key.
    /// - parameter key: The key to filter by.
    /// - returns: The last `DeviceTag` matching the key, if any.
    /// - warning: There is no unique constraint on device tags in the Afero
    ///            cloud as of this writing, so it is possible that more than
    ///            one tag for a given key could exist (however, creating duplicate
    ///            keys is not supported by this API. If you would like to see
    ///            *all* keys that match the given key, use `deviceTags(forKey:)`.
    internal func getTag(for key: DeviceTag.Key) -> DeviceTag?


    /// Add or update a DeviceTag instance on the DeviceModel.
    ///  - parameter tag: A `deviceTag` instance. If an `id` is present on the tag, an attempt will be made
    ///     to update the tag; otherwise a new tag will be added.
    /// - parameter onDone: A closure to handle the result of the `addOrUpdate` operation.
    public func addOrUpdate(tag: DeviceTag?, onDone: @escaping AddOrUpdateTagOnDone)

    /// Add or update a DeviceTag instance on the DeviceModel.
    /// - parameter value: A `String` value to add for the tag.
    /// - parameter key: An optional `String` under which to group the tag. Multiple `values` can have the same key.
    /// - parameter id: The `id` of the tag, assigned by the Afero cloud. If present, it's assumed that this call is an update; otherwise a new tag will be added. Unrecognized `id`s will cause the call to fail.
    /// - parameter localizationKey: This parameter, while available, is not currently used and can be ignored.
    /// - parameter onDone: A closure to handle the result of the `addOrUpdate` operation.
    public func addOrUpdateTag(with value: DeviceTag.Value, groupedUsing key: DeviceTag.Key?, identifiedBy id: DeviceTag.Id? = default, using localizationKey: DeviceTag.LocalizationKey? = default, onDone: @escaping AddOrUpdateTagOnDone)

    /// Type for response handler for `deleteTag`
    public typealias DeleteTagOnDone = (DeviceTag.Id?, Error?) -> Void

    /// Delete a tag with the given `id`.
    /// - parameter id: The id of the tag to delete.
    /// - parameter onDone: A closure to handle the result of the `deleteTag` operation.
    public func deleteTag(identifiedBy id: DeviceTag.Id, onDone: @escaping DeleteTagOnDone)

Wifi Setup

Wifi setup is now supported in the AferoLab app, with the following prerequisites:

  • The softhub (accessible via the root VewController) is running.
  • The app is not running in a simulator.
  • The device being configured supports wifi configuration.

Wifi setup is accessible via the Wifi Config section in the DeviceInspector.

Switch to Binary Softhub

14 Nov 18:59
Compare
Choose a tag to compare
Pre-release

AferoSwiftSDK 0.8.5 is a patch release.

Bug fixes

  • Fixes an crash when DeviceCollection.hasVisibleDevices: Bool! is accessed after having been subsequently cleared (IOS-1557)

  • Updates AferoSofthub to 1.1.0, which is a dynamic framework, hosted in a new repo. See aferodeveloper/AferoIOSSofthub#1.1.0 (IOS-1512)