Giter Club home page Giter Club logo

algoliasearch-client-swift's Issues

watchOS

Hi!
Is there any reason why your library couldn't work on watchOS?

Remove admin API key-only operations

It does not make sense to have client methods for requests requiring an admin API key, as this key should remain on the back-end.

So we should remove:

  • Global API keys management
  • Per-index API keys management
  • Logs retrieval

Offline Cache

It would be great to be able to customize the cache to use things like NSURLRequestReturnCacheDataElseLoad which allows me to at least show something to the user when their device is offline, regardless of age or expiration. For example, my app shows a list of movie reviews. If the user starts reading a review but leaves and comes back later to finish reading (this time their device is offline), I would love to still be able to show them the same content they were viewing last time they were online. Is this something you would consider adding as an option?

Issue with Carthage

Hi,

Config

  • Xcode 7.2.1 (7C1002)
  • Carthage 0.15

Cartfile

github "algolia/algoliasearch-client-swift" == 2.1.0

Carthage command

carthage update --platform iOS

The issue

When I build and run my project on the device everything is ok
If I try to build my project on the simulator it's generate some errors:

ld: warning: ignoring file .../Build/Products/Debug-iphonesimulator/AlgoliaSearch.framework/AlgoliaSearch, file was built for i386 which is not the architecture being linked (x86_64): .../Build/Products/Debug-iphonesimulator/AlgoliaSearch.framework/AlgoliaSearch
...
Undefined symbols for architecture x86_64:
"AlgoliaSearch.Client.(init (AlgoliaSearch.Client.Type) -> (appID : Swift.String, apiKey : Swift.String, queryParameters : Swift.String?, tagFilters : Swift.String?, userToken : Swift.String?, hostnames : [Swift.String]?) -> AlgoliaSearch.Client).(default argument 4)", referenced from:
      TestAlgolia.Test.init (TestAlgolia.Test.Type)() -> TestAlgolia.Test in Test.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Unit tests in Objective-C

Since the Swift client is meant to be called from Objective-C, unit tests in Objective-C seem necessary to confirm that the bridging works properly.

Gives compilation error while migrating from swift 1.2 to 2.0

I am using pod 'AlgoliaSearch-Client-Swift', '~> 1.4', all working well with swift 1.2. But as soon as I shifted to Xcode 7, it raised error in "Network.swift" and "Index.swift". Is anyone facing the same problem? or could anyone guide me to resolve this issue?

Xcode 7.3: lot of warnings

Hi,
After installed Xcode 7.3 when I build with Carthage I have a lot of warnings:

warning: 'var' parameters are deprecated and will be removed in Swift 3
warning: '++' is deprecated: it will be removed in Swift 3
warning: keyword 'protocol' does not need to be escaped in argument list
warning: use of 'typealias' to declare associated types is deprecated; use 'associatedtype' instead

numericFilters?

I am having difficulty finding numericFilters in the 3.0 SDK..
I used to be able to do a query with a numericFilter to find an record with a specific number.

Refactor the way to cancel network request

  • We should be able to cancel any request, not just searches.
  • We should return an object that can be acted upon, rather than providing a separate cancelQueries() method.
  • Caution: think about the synchronous methods.
  • Caution: think about the offline mode.

Strategy parameter not working

Hi,

I contacted support today about strategy parameter in multiple query, I didn't understand its behavior because it's actually not working as expected and documentation was wrong apparently.

It's should be passed as POST parameter. Here is the temp fix I did on my side:
#87

You can reproduce by setting the strategy to "stopIfEnoughMatches", if you reach the number of hits of the first query for example, you'll also get hits for other queries, so the parameter is not taken.

Thanks !

Migrate `User-Agent` header to new conventions

The new conventions being an array of components separated by semicolons:

Algolia for $LANGUAGE ($VERSION1); Library X ($VERSION2); Library Y ($VERSION2)

We should make it easily configurable, so that the future helpers can easily add their version to the list without destroying anything.

ld: warning: embedded dylibs/frameworks only run on iOS 8 or later

Hi,
Following Algolia Search with Carthage:

  • carthage version: 0.16.2
  • xcodebuild -version: Xcode 7.3.1 Build version 7D1014
  • Are you using --no-build? No
  • Are you using --no-use-binaries? No
  • Are you using --use-submodules? No

Cartfile

github "algolia/algoliasearch-client-swift" == 3.2.1

Cartage Output

$ carthage update --platform iOS
*** Cloning algoliasearch-client-swift
*** Checking out algoliasearch-client-swift at "3.2.1"
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later

I don't have those warnings with Algolia Search version 2.3. Something must be wrong configured in your project.

Cancel a search request

Hi there,

Is there a way to cancel requests?
I could only find the following internal method in the Client:

/// Cancel a queries. Only the last ten queries can be cancelled.
    func cancelQueries(method: HTTPMethod, path: String) {
        for request in requestBuffer {
            if request.request.URL!.path! == path {
                if request.request.HTTPMethod == method.rawValue {
                    request.cancel()
                }
            }
        }
    }

Is there or are there plans to implement public methods for cancelling requests?

Thank you for your help.

index.getObject Content Result Cast issue

Hi!
I am using the public func getObject(objectID: String, block: CompletionHandler)
my "content" result is a JSON result, however, I am getting a compiler warning with Swift 2.1

let foundObject = content as! NSDictionary
"Cast from '[String: AnyObject]?' to unrelated type 'NSDictionary' always fails"

Any ideas?

Provide a synchronous flavour of query methods

That's something we do in other clients. It can be useful when the user already has a background thread which she uses to perform operations. In this case, synchronous calls lead to more straightforward code while not degrading end-user performance.

Rename `fullTextQuery` to `query`

I think we should rename fullTextQuery to query to fit the other API clients & the REST API.
Is it possible to deprecate it and to be backward compliant?

Run completion handlers in a background thread

Currently, completion handlers are run on the main thread. This eases the implementation in simple cases, but when the completion handler performs costly computation, it actually makes things more complicated. In those cases, it would be easier if the completion handler ran on a background queue, and it were up to the client code to dispatch to the main thread. (By the way, this is what system-provided asynchronous methods do; e.g. NSURLSession.dataTaskWithURL(_:completionHandler:).)

Unfortunately, we cannot change the default behavior without breaking client code. But what about providing an option (at the client level) to run completion handlers in the background?

Searching on index with spaces on its name crashes app

There is an exception thrown when searching on an index with spaces on its name (e.g. "Index with space").

The solution is correctly implementing Helpers class's urlEncode() function:

Current implementation:

func urlEncode() -> String {
        let customAllowedSet = NSCharacterSet(charactersInString: "!*'();:@&=+$,/?%#[]").invertedSet
        return stringByAddingPercentEncodingWithAllowedCharacters(customAllowedSet)!
    }

Proposed solution:

func urlEncode() -> String {
        return stringByAddingPercentEncodingWithAllowedCharacters(.URLHostAllowedCharacterSet())!
    }

Clarify Objective-C bridging

It would be nice to have optionals for every parameter... but value types optionals are not bridgeable to Objective-C. We should therefore maybe use NSNumber, but it's not as nice for Swift clients. Should we provide two flavours of each value type property?

Swift 2.3 / 3.0

Hi!
What is the roadmap / plan for Swift 2.3 & 3 conversion?

tvOS not supported in pod file

I've added the pod to my pod file and when I try to do a pod install I get the following error message in terminal.

[!] The platform of the target AppName-tvOS (tvOS 9.0) is not compatible with AlgoliaSearch-Client-Swift (3.3), which does not support tvos.

Support iOS 7

The only non-iOS 7 compliant part of the code seems to be setting the underlyingQueue on the Client's operation queue... which appears to be unused.

WARNING: Simulators below iOS 8.1 are not provided by Xcode 7.3, so the iOS 7 code will remain untested.

Refs #62.

Shuffle the default host arrays at client init time

The goal is to systematically avoid overloading the first non-DSN host upon failure. Shuffling should be done once and for all, as retrying a different host every time would likely imply opening a new connection, therefore incur a big overhead. Randomization across all users should be enough to guarantee proper load balancing.

Improve type safety of `Client.multipleQueries`'s arguments

Currently, we are passing the queries as a completely untyped array, but we still require each item to be a dictionary with two keys: index name and query object. A more strongly typed argument would be welcome, for example like the IndexQuery class used on Android.

iTunes connect submission issue

Invalid Info.plist value. The value for the key 'MinimumOSVersion' in bundle MyApp.app/Frameworks/AlgoliaSearch.framework is invalid. The minimum value is 8.0

It's currently not possible to submit an app that uses algoliasearch-client-swift via Carthage, because when the the framework is built via Carthage minimumosversion is set to 7.0, however it must be 8.0 or higher.

Batch requests (generic method)

Batch requests are used behind the scenes in a few methods, but there is currently no generic way to issue a batch request. -> Implement it.

Can't import in Vc - Cannot import module being compiled

I have tried installing via Cocapods and get the following error when trying to import Algolia.
Any ideas how to get it working?

Have tried cleaning the project.

Here is the Pod file:

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'Algolia' do
pod 'AlgoliaSearch-Client-Swift', '~> 1.4'
end

X-Algolia-QueryParameters is missing

We can set the X-Algolia-TagFilters and the X-Algolia-UserToken header, but the new X-Algolia-QueryParameters is missing.

We could probably create something like:

let client = AlgoliaSearch.Client(appID: "xxxxxxx", apiKey: "xxxxxxxxxxxxx", queryParameters:"tagFilters=xxxxxxxx")

tvOS Target

Would you mind adding a tvOS target? I was able to and it seem to work fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.