Features
Real-time notifications (SSE)
After setUser, server events are streamed. The connection drops in background and reconnects in foreground.
By default the SDK shows its own notification UI. Return true from onSSEEffectsReceived to handle effects yourself:
override fun onSSEEffectsReceived(effects: List<KLPSSEEffect>): Boolean {
// process effects
return true
}For each KLPSSEEffect, only one of giveLoyaltyProgramPoint, increaseMissionProgress, or increaseLevelProgress under detail is set.
The loaded page is notified via message events without reload:
window.addEventListener('message', (event) => {
let data;
try { data = JSON.parse(event.data); } catch { return; }
if (data.__klp === 'sseEffect') {
const effects = data.body;
// refresh affected UI
}
});Event logging
KLP.logEvent("LogIn")
KLP.logEvent("MoneyTransfer", mapOf(
"Quantity" to 10,
"TransferAmount" to 1250.75
))Requires KLP.initialize and setUser. Otherwise silently ignored. attributes: Map<String, Any>?.
Deeplinks
WebView links can use your custom URL scheme. The SDK forwards them via onDeepLinkReceived instead of loading the URL.
WebView tap → onDeepLinkReceived(uri) → return true → host navigates, WebView closes
Manifest (launchMode="singleTop"):
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp" />
</intent-filter>override fun onDeepLinkReceived(uri: String): Boolean {
val parsed = Uri.parse(uri)
if (parsed.scheme != "myapp") return false
// navigate to target screen
return true
}Handle external deeplinks the same way in onNewIntent. Prefer reverse-domain schemes (e.g. com.company.product).
<a href="myapp://dashboard">Go to Home</a>Updated about 2 months ago
