constructor-io / constructorio-client-swift Goto Github PK
View Code? Open in Web Editor NEWConstructor.io Client for iOS Applications
License: MIT License
Constructor.io Client for iOS Applications
License: MIT License
Hello,
We observed that a warning is being emitted when consuming the constructor client as a Swift Package.
<Redacted>/checkouts/constructorio-client-swift/Package.swift The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99.
Would it be possible to bump the Swift Package support up to 9.0? I can even make the change if necessary. This would silence a warning in all consumers of the Swift Package's project.
Thanks!
Hello!
We identified one issue regarding a missing field in the CIOBrowseResponse
object.
The field is called collection
and it is being returned as part of the browse
request for a query.
In order to reproduce the issue it is required to trigger a ConstructorIO.browse(forQuery:)
request with a filtered by "collection_id":
let browseQuery = CIOBrowseQuery(
filterName: "collection_id",
filterValue: "....",
filters: nil,
page: 1,
perPage: 30
)
ConstructorIO.browse(forQuery: browseQuery) { _ }
The response for the previous request would have the following high-level structure:
{
"response": {
"result_sources": { ... },
"facets": [ ... ],
"groups": [ ... ],
"results": [ ... ],
"sort_options": [ ... ],
"total_num_results": ...,
"features": [ ... ],
"collection": {
"id": "...",
"display_name": "...",
"data": ...,
},
},
"result_id": "........"
"request": { ... }
}
The above response would be handled by the BrowseResponseParser
, which reads the JSON object and returns a CIOBrowseResponse
.
public class CIOCollectionData: NSObject {
public let id: String
public let display_name: String
public let data: ...
init?(json: JSONObject?) {
guard let json = json, let id = json["id"] as? String, let display_name = json["display_name"] as? String else {
return nil
}
self.id = id
self.display_name = display_name
}
}
CIOBrowseResponse
giving that the field is not being returned for all type of browse results:public class CIOBrowseResponse {
...
public let collection: CIOCollectionData?
}
BrowseResponseParser
the additional decoder, and add the value to the CIOBrowseResponse initializer let collection: CIOCollectionData = CIOCollectionData(json: response["collection"])
....
return CIOBrowseResponse(
....
collection: collection
)
It's counterpart in Android SDK already includes the collection
field in the BrowseResponseInner.java
:
public class BrowseResponseInner {
....
@SerializedName("collection")
private ItemCollection collection;
}
Trying to install only AutoCompleteClient with Swift package manager but that is prompting username and password. how to fix this?
Swift package manager url : https://github.com/Constructor-io/constructorio-client-swift/tree/master/AutocompleteClien
t
result
data comes back in the overall response JSON from a search query, however this data isn't parsed by the SearchResponseParser
. It contains information such as page
and num_results_per_page
which would be useful in the implementation of pagination. It would be great if results
was parsed by the SearchResponseParser
and at least the page
, num_results_per_page
, and term
data was surfaced by the SDK. Thanks!
We are currently implementing the SDK for an app we are working on. The app is using Swift concurrency via Async/Await. It would be nice if the SDK had support for this alongside closure based callbacks.
We are wrapping the SDK methods with withCheckedContinuation methods to bridge support. This isn't ideal.
https://developer.apple.com/documentation/swift/checkedcontinuation
public func trackBrowserResultsLoaded(filterName: String, filterValue: String, resultCount: Int, customerIDs: [String]?, resultID: String?) async throws {
return try await withCheckedThrowingContinuation { continuation in
constructorIO.trackBrowseResultsLoaded(filterName: filterName, filterValue: filterValue, resultCount: resultCount, customerIDs: customerIDs, resultID: resultID) { result in
if let error = result.error {
continuation.resume(throwing: error)
}
else if let _ = result.data {
continuation.resume()
}
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.