Poly
public class Poly
Poly, Unofficial Google Poly SDK
-
Poly API Key, https://developers.google.com/poly/develop/api
Declaration
Swift
public var apiKey: String?
-
Auth token for ‘me’ requests, https://developers.google.com/identity/protocols/OAuth2
Declaration
Swift
public var authToken: String? { get set }
-
Network reachability status of poly.googleapis.com
Declaration
Swift
public var networkReachable: Bool { get }
-
CompletionHandler for managing background transfers
Declaration
Swift
public var backgroundCompletionHandler: (() -> Void)? { get set }
-
Initializer for Poly
Declaration
Swift
public init()
-
Reset client configuration
Declaration
Swift
public func reset()
-
Cancel all data transfers
Declaration
Swift
public func cancelAllDataTasks()
-
UIApplication integration support for background transfers
Declaration
Swift
public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?) -> Bool
-
Undocumented
Declaration
Swift
public typealias ProgressHandler = (_ progress: Float) -> Void
-
Undocumented
Declaration
Swift
public typealias CompletionHandler = (_ data: Data?, _ error: Error?) -> Void
-
Undocumented
Declaration
Swift
public typealias AssetsCompletionHandler = (_ assets: [PolyAssetModel]?, _ totalAssetCount: Int, _ nextPage: Int, _ error: Error?) -> Void
-
Returns detailed information about an asset given its name.
Declaration
Swift
public func get(assetWithIdentifier assetIdentifier: String, completionHandler: AssetsCompletionHandler? = nil)
-
Lists all public, remixable assets.
Declaration
Swift
public func list(assetsWithKeywords keywords: [String], curated: Bool = false, category: String? = nil, complexity: PolyComplexity = .unspecified, format: PolyFormat = .obj, pageToken: String? = nil, completionHandler: AssetsCompletionHandler? = nil)
-
Returns detailed information about an asset given its name, in raw data.
Declaration
Swift
public func get(assetWithIdentifier assetIdentifier: String, completionHandler: CompletionHandler? = nil)
-
Lists all public, remixable assets, in raw data.
Declaration
Swift
public func list(assetsWithKeywords keywords: [String], curated: Bool = false, category: String? = nil, complexity: PolyComplexity = .unspecified, format: PolyFormat = .obj, pageToken: String? = nil, completionHandler: CompletionHandler? = nil)
-
Undocumented
Declaration
Swift
public typealias DownloadCompletionHandler = (_ rootFile: URL?, _ resourceFiles: [URL]?, _ error: Error?) -> Void
-
Downloads the specified asset by identifier.
Declaration
Swift
public func download(assetWithIdentifier assetIdentifier: String, cachePolicy: PolyRequest.CachePolicy = .returnCacheDataElseFetch, progressHandler: ProgressHandler? = nil, completionHandler: DownloadCompletionHandler? = nil)
Parameters
assetIdentifier
Asset identifier
cachePolicy
Cache policy
progressHandler
Handler for progress updates
completionHandler
Handler for task completion
-
Downloads the specified asset by model.
Declaration
Swift
public func download(asset: PolyAssetModel, cachePolicy: PolyRequest.CachePolicy = .returnCacheDataElseFetch, progressHandler: ProgressHandler? = nil, completionHandler: DownloadCompletionHandler? = nil)
Parameters
asset
Poly asset to download
cachePolicy
Cache policy
progressHandler
Handler for progress updates
completionHandler
Handler for task completion