Please find the new Kotlin multiplatform SDK available here: https://github.com/mikepenz/storyblok-mp-SDK
This is the Storyblok Android client for easy access of the publishing api.
implementation "com.mikepenz:storyblok-android-sdk:1.0.0"
Note starting with v1.0.0 this library uses kotlin. See older versions for java only.
val client = Storyblok.init("your-storyblok-token")
client.getStory("fullSlug", object : Storyblok.SuccessCallback<Story> {
override fun onResponse(result: Result<Story>) {
//on success
}
}, object : Storyblok.ErrorCallback {
override fun onFailure(exception: IOException?, response: String?) {
// empty
}
})
client.getStories(startsWith, withTag, sortBy, perPage, page, object : Storyblok.SuccessCallback<List<Story>> {
override fun onResponse(result: Result<List<Story>>) {
//on success
}
}, object : Storyblok.ErrorCallback {
override fun onFailure(exception: IOException?, response: String?) {
// empty
}
})
client.getTags(startsWith, object : Storyblok.SuccessCallback<List<Tag>> {
override fun onResponse(result: Result<List<Tag>>) {
//on success
}
}, object : Storyblok.ErrorCallback {
override fun onFailure(exception: IOException?, response: String?) {
// empty
}
})
client.getLinks(object : Storyblok.SuccessCallback<Map<String, Link>> {
override fun onResponse(result: Result<Map<String, Link>>) {
//on success
}
}, object : Storyblok.ErrorCallback {
override fun onFailure(exception: IOException?, response: String?) {
// empty
}
})
client.getDatasource(datasource, object : Storyblok.SuccessCallback<List<Datasource>> {
override fun onResponse(result: Result<List<Datasource>>) {
//on success
}
}, object : Storyblok.ErrorCallback {
override fun onFailure(exception: IOException?, response: String?) {
// empty
}
})
Mike Penz:
- FastAdapter https://github.com/mikepenz/FastAdapter
- AboutLibraries https://github.com/mikepenz/AboutLibraries
- Android-Iconics https://github.com/mikepenz/Android-Iconics
- MaterialDrawer https://github.com/mikepenz/MaterialDrawer
- Mike Penz
This free, open source software was also made possible by a group of volunteers that put many hours of hard work into it. See the CONTRIBUTORS.md file for details.
Copyright 2019 Mike Penz
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.