KeenClient-iOS icon indicating copy to clipboard operation
KeenClient-iOS copied to clipboard

Clean up KeenClient interface

Open baumatron opened this issue 7 years ago • 4 comments

There are a few items on KeenClient that shouldn't be exposed in KeenClient.h:

  • -runQuery, which is marked as for testing only, so should be in a test category
  • -runMultiAnalysisWithQueries, also should be in a test category
  • +clearAllQueries
  • +getDBStore
  • +clearAllEvents

They should be removed for the next major release.

baumatron avatar Apr 20 '17 02:04 baumatron

runAsyncQuery:block: should be renamed runAsyncQuery:completion: or something better. Same goes for runAsyncMultiAnalysisWithQueries:block:.

baumatron avatar Apr 20 '17 02:04 baumatron

Should evaluate how shared client initialization is done and look for ways to improve it. Configuration and fetching of the shared client object should be separate things. Perhaps the client should provide a configuration object to be used for the shared client, or maybe implement a delegate object that provides a shared client configuration.

baumatron avatar Jun 12 '17 20:06 baumatron

This documentation is wrong in KeenClient.h, sharedClient:

@return A managed instance of KeenClient, or nil if you haven't called [KeenClient
 sharedClientWithProjectID:andWriteKey:andReadKey:].

If ID's and keys haven't been provided, it'll return a client that doesn't have any of those values set.

baumatron avatar Jun 12 '17 20:06 baumatron

As mentioned in #226, would be nice to have overloads of KeenClient int that don't require nil passed in for optional parameters. Obj-C doesn't make this very fun, though maybe there's a way to mark the parameters as optional for Swift only?

baumatron avatar Jun 19 '17 20:06 baumatron