Migration to v5.X

This guide will assist developers to move from Flagship 4.X to Flagship 5.X.

The main breaking changes are:

  • fetchStatus status

  • requiredFetchReason status

  • Rename Visitor Callbacks

See the full change log on Github.

fetchStatus

The fetchStatus attribut changed the type from FSFetchStatus to FSFlagStatus

  public internal(set) var fetchStatus: FSFlagStatus = .FETCH_REQUIRED 
 public internal(set) var fetchStatus: FSFetchStatus = .FETCH_REQUIRED 

requiredFetchReason

The requiredFetchReason attribut for the visitor instance changed the type from FSFetchReasons to FetchFlagsRequiredStatusReason

public internal(set) var requiredFetchReason: FetchFlagsRequiredStatusReason = .FLAGS_NEVER_FETCHED

public internal(set) var requiredFetchReason: FSFetchReasons = .VISITOR_CREATE

Values for FetchFlagsRequiredStatusReason:

Value
Description

FLAGS_NEVER_FETCHED

Indicates that the visitor is created for the first time or without cache

VISITOR_CONTEXT_UPDATED

Indicates that a context has been updated or changed.

VISITOR_AUTHENTICATED

Indicates that the XPC method 'authenticate' has been called.

VISITOR_UNAUTHENTICATED

Indicates that the XPC method 'unauthenticate' has been called.

FLAGS_FETCHING_ERROR

Indicates that fetching flags has failed.

FLAGS_FETCHED_FROM_CACHE

Indicates that flags have been fetched from the cache.

NONE

No Reason, the state should be FETCHED, FETCHING, PANIC

Visitor Callback(s)

onFlagStatusChanged

The callback withFetchFlagsStatus changed to onFlagStatusFetched .Called every time when the FlagStatus is equals to FETCHED.

  • public func withOnFlagStatusFetched (\_ onFlagStatusFetched: OnFlagStatusFetched)->FSVisitorBuilder

public func withOnFlagStatusFetched (_ onFlagStatusFetched: OnFlagStatusFetched)->FSVisitorBuilder
public func withFetchFlagsStatus(_ pCallback: OnFetchFlagsStatusChanged)->FSVisitorBuilder 

Last updated

Was this helpful?