PMPpcEventPayloadReceiver

class PMPpcEventPayloadReceiver(val delegate: PMPpcEventPayloadIfc) : BroadcastReceiver

Android broadcast receiver of PPC Events without decoding message from flatbuffer bytearray

Samples

import android.content.Context
import android.content.IntentFilter
import com.sygic.profi.sdk.ifc.PMConstants
import com.sygic.profi.sdk.party.ppc.PMPpcEventPayload
import com.sygic.profi.sdk.party.ppc.PMPpcEventPayloadIfc
import com.sygic.profi.sdk.party.ppc.PMPpcEventPayloadReceiver
fun main() { 
   //sampleStart 
   class PPCProxy: PMPpcEventPayloadIfc {

    private val receiver = PMPpcEventPayloadReceiver(this)

    fun register(context: Context) {
        context.registerReceiver(receiver, IntentFilter(PMConstants.FILTER_PPC))
    }

    fun unregister(context: Context) {
        context.unregisterReceiver(receiver)
    }

    override fun broadcast(ppc: PMPpcEventPayload) {
        assert(ppc.payload.size > 0)
        assert(ppc.metadata.size > 0)
        // feel free to change this logic
        TODO("Allways send metadata to transport layer for small messages")
        if (ppc.bigFlag) {
            TODO("Send ppc.payload to trasport layer for big messages")
        }
    }

} 
   //sampleEnd
}

Constructors

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getResultExtras(p0: Boolean): Bundle
Link copied to clipboard
fun goAsync(): BroadcastReceiver.PendingResult
Link copied to clipboard
Link copied to clipboard
open override fun onReceive(context: Context, intent: Intent)

Android broadcast receiver which decode Intent.extra and call delegate object

Link copied to clipboard
open fun peekService(p0: Context, p1: Intent): IBinder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setResult(p0: Int, p1: String, p2: Bundle)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setResultExtras(p0: Bundle)

Properties

Link copied to clipboard