Where the BMLTiOSLib Fits In
The BMLTiOSLib acts as an abstraction layer between the JSON Semantic Interface to the BMLT Root Server and your app. You throw it into your app development project, just like any of the other frameworks, and import it. You will need to establish a context in your app that responds to the BMLTiOSLibDelegate protocol to receive messages.
Licensing and Reuse
The BMLTiOSLib is a 100% open source project. Unlike most BMLT projects, which use the GPL, the BMLTiOSLib uses the more permissive MIT License, as we actively encourage people to use it in closed-source or commercial projects, if they wish.
Where to get the BMLTiOSLib
The source code (all of it) is available in this GitHub repo.
Using the BMLTiOSLib Framework in Your Project
Example of a BMLTiOSLib Interaction
Here’s a perfect example of how the BMLTiOSLib makes your life infinitely easier, when communicating with a BMLT Root Server:
Let’s walk through the actions illustrated above:
- First, the app creates a new instance of BMLTiOSLib, giving it a URI to a valid (HTTPS, 2.8.10 or greater, and with a full set of default fields) Root Server, and the app itself as a delegate (will receive messages returned from the BMLTiOSLib).
- The first thing the BMLTiOSLib does, is invoke the JSON Semantic Interface command to get the basic Server info.
- The server responds (or doesn’t, if it is severely out of date) with a JSON object containing the various essential Root Server parameters, such as its version, default language, available data fields and center location.
- Assuming the BMLTiOSLib is satisfied with the response, it then asks the Server to send it a list of the Service bodies on the Server.
- The Server returns a JSON object containing the data on all the Service bodies it contains.
- The BMLTiOSLib then asks the Server to send a list of all possible format codes.
- The Server responds with a JSON object with all the formats possible.
- The BMLTiOSLib then asks the Server to send back all of the languages it supports.
- The Server responds with a JSON object containing all of its supported languages, highlighting the default language.
- At this point, the BMLTiOSLib has enough information. It calls the
serverIsValidset to true, if the server is considered valid and connected, or false, if otherwise.
During this process, if a program error occurs, the
bmltLibInstance(_:,errorOccurred:) could be called to report an error. Invalid servers are considered errors, so bad URIs will result in error calls.
If the last step reported success, then a session to the server is now open, and will be maintained for the lifetime of the BMLTiOSLib instance. In order to terminate the session, the program merely has to delete the instance.
See how much work the BMLTiOSLib just saved you? And you’ve barely started.
Now that we have an idea of what the BMLTiOSLib is about, let’s see what we need to do in order to use it.
- Other Topics
- An Illustration of the BMLT System
- BMLT Roles
- Is Your Server Set Up Correctly?
- Test Site Links
- The BMLT Satellite Base Class
- The BMLTiOSLib iOS Framework
- Configuration Management And Release