Skip to content

Commit

Permalink
inline URLQueryRegistration
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineDominion committed Dec 5, 2023
1 parent c5680ef commit 468ea2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
13 changes: 9 additions & 4 deletions Sources/TrialLicense/AppLicensing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,22 @@ public class AppLicensing {
///
/// ```
/// if let urlString = event.paramDescriptor(forKeyword: AEKeyword(keyDirectObject))?.stringValue,
/// let url = URL(string: urlString) {
/// AppLicensing.register(fromURL: url)
/// let urlComponents = URLComponents(string: urlString) {
/// AppLicensing.register(urlComponents: urlComponents)
/// }
/// ```
///
/// - parameter url: Complete query URL.
/// - parameter urlComponents: URL components from the URL scheme.
@inlinable
@inline(__always)
public static func register(urlComponents: Foundation.URLComponents) {

URLQueryRegistration().register(urlComponents: urlComponents)
let queryParser = URLQueryLicenseParser()
guard urlComponents.host == TrialLicense.URLComponents.host,
let queryItems = urlComponents.queryItems,
let license = queryParser.parse(queryItems: queryItems)
else { return }
register(payload: license.payload)
}

/// Unregisters from whatever state the app is in;
Expand Down
23 changes: 0 additions & 23 deletions Sources/TrialLicense/URLQueryRegistration.swift

This file was deleted.

0 comments on commit 468ea2b

Please sign in to comment.