Migration to 5.X

Overview

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 

❗️

FSFetchStatus enum removed

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:

ValueDescription
FLAGS_NEVER_FETCHEDIndicates that the visitor is created for the first time or without cache
VISITOR_CONTEXT_UPDATEDIndicates that a context has been updated or changed.
VISITOR_AUTHENTICATEDIndicates that the XPC method 'authenticate' has been called.
VISITOR_UNAUTHENTICATEDIndicates that the XPC method 'unauthenticate' has been called.
FLAGS_FETCHING_ERRORIndicates that fetching flags has failed.
FLAGS_FETCHED_FROM_CACHEIndicates that flags have been fetched from the cache.
NONENo Reason, the state should be FETCHED, FETCHING, PANIC

❗️

FSFetchReasons enum removed

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