Fetch live-content in your app
This article provides steps on how to use the SDK to fetch live-content in your Android app.
Wait. Are you ready for this part?
In this article, we'll show you how to fetch live content from our platform and show it to your app's users when they are using your app. However, this cannot work until you have the SDK in your project and you can use it in your app. If not, then we suggest that you do those things first and then come back here to use the SDK to fetch live-content in your app.
It's absolutely not complicated. And, if you've come this far, you know that this works. βΊοΈ
The SDK provides three methods to fetch live-content from the Blueshift platform. You need to provide a slot name (for example, Editors_Picks_Json
) and the context to get the corresponding content.
Here's how to use the live-content methods from the Android SDK:
Blueshift
.getInstance(context)
.getLiveContentByEmail(slotName, new LiveContentCallback() {
@Override
public void onReceive(String response) {
// deal with the response
}
});
Blueshift
.getInstance(context)
.getLiveContentByCustomerId(slotName, new LiveContentCallback() {
@Override
public void onReceive(String response) {
// deal with the response
}
});
Blueshift
.getInstance(context)
.getLiveContentByDeviceId(slotName, new LiveContentCallback() {
@Override
public void onReceive(String response) {
// deal with the response
}
});
Updated over 4 years ago