LinkCreator
public class LinkCreator
A class that is used to create URLs that will invoke App actions.
Flint Routes support multiple custom app URL schemes and multiple associated domains for deep linking.
A LinkCreator will only create links for one app scheme or domain - typically apps do not need to generate different kinds of URLs for the same app, but you may need to handle multiple legacy URLs or domains.
As such, Flint will create a default link creator for the first App URL scheme and Associated Domain that you define
in your Info.plist (for app URLs) and the domain you pass when calling Flint.quickSetup
.
This will be used for the automatic link creation for Activities and other system integrations. You can
change this behaviour by creating a new LinkCreator
for the scheme and domain you prefer, and assign it to
Flink.linkCreator
.
You can create your own instances to produce links with specific schemes and domains. Links can only be created
for actions that have routes defined in your Feature’s urlMappings
.
-
Undocumented
Declaration
Swift
public let defaultScheme: String?
-
Undocumented
Declaration
Swift
public let defaultDomain: String?
-
Instantiate a link creator for the given scheme and domain. Note that you cannot use just any scheme or domain. They must be correctly configured in your app’s
Info.plist
and Associated Domains entitlements.Declaration
Swift
public init(scheme: String?, domain: String?)
-
Create an app custom URL scheme link to the specified static feature action, passing the input provided.
Note
the input must conform toQueryParametersEncodable
, and anything output from that protocol will be user-visible in the URL generated.Declaration
Swift
public func appLink<FeatureType, ActionType>(to actionBinding: StaticActionBinding<FeatureType, ActionType>, with input: ActionType.InputType?) -> URL where FeatureType : FeatureDefinition, ActionType : Action, ActionType.InputType : RouteParametersEncodable
-
Create an app custom URL scheme link to the specified conditional feature action, passing the input provided.
Note
the input must conform toQueryParametersEncodable
, and anything output from that protocol will be user-visible in the URL generated.Declaration
Swift
public func appLink<FeatureType, ActionType>(to actionBinding: ConditionalActionBinding<FeatureType, ActionType>, with input: ActionType.InputType?) -> URL where FeatureType : ConditionalFeature, ActionType : Action, ActionType.InputType : RouteParametersEncodable
-
Create a universal/domain URL linking to the specified static feature action, passing the input provided.
Note
the input must conform toQueryParametersEncodable
, and anything output from that protocol will be user-visible in the URL generated.Declaration
Swift
public func universalLink<FeatureType, ActionType>(to actionBinding: StaticActionBinding<FeatureType, ActionType>, with input: ActionType.InputType?) -> URL where FeatureType : FeatureDefinition, ActionType : Action, ActionType.InputType : RouteParametersEncodable
-
Create a universal/domain URL linking to the specified conditional feature action, passing the input provided.
Note
the input must conform toQueryParametersEncodable
, and anything output from that protocol will be user-visible in the URL generated.Declaration
Swift
public func universalLink<FeatureType, ActionType>(to actionBinding: ConditionalActionBinding<FeatureType, ActionType>, with input: ActionType.InputType?) -> URL where FeatureType : ConditionalFeature, ActionType : Action, ActionType.InputType : RouteParametersEncodable