couchbase / couchbase-lite-ios

Lightweight, embedded, syncable NoSQL database engine for iOS and MacOS apps.
Apache License 2.0
1.62k stars 297 forks source link

HTTP protocol only working after call to `internalURL` #217

Closed refractalize closed 10 years ago

refractalize commented 10 years ago

Not sure why this is the case, but, in order to get URLs like http://lite.couchbase./... working I need to make a call to CBLManager.internalURL, which lazily registers the CBL_URLProtocol.

See: https://github.com/couchbase/couchbase-lite-ios/blob/master/Source/API/CBLManager.m#L320

From an API perspective this is a little weird. Perhaps we should have a method to register the HTTP protocol, like CBLManager.registerHTTPProtocol. Or perhaps it should be registered all the time.

snej commented 10 years ago

The idea is that you shouldn’t hardcode that URL in your app. Instead you call internalURL to discover it.

refractalize commented 10 years ago

Hi, yes, what you say makes sense. Cheers.