question

Chris Murray avatar image
Chris Murray asked Chris Murray answered

ACTION_V1_ORDER_BUILD_STOP intent is not broadcasted on Station solo

Hey clover team,


So in the final stages of our app development, we've tested our app (which has a broadcast receiver listening for Intent.ACTION_V1_ORDER_BUILD_STOP to be broadcasted in order to launch another activity). The flow works when testing on the Flex 2nd Generation, Mini 2ndGeneration, and the Station 2018. However, the intent is never received when testing on the Station Solo. Could you folks look into this? Please let me know whatever else you need on our end to diagnose this issue.


All the best

Clover Android SDKIntents
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered

Are you using an emulator or a devkit? Can you provide us with a minimal example that reproduces the issue?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Chris Murray avatar image
Chris Murray answered Chris Murray edited

Hello David,

Yes so we're using the emulators (all with their recommended settings). We've confirmed that the Intent.ACTION_V1_ORDER_BUILD_STOP broadcast works when the targetSdkVersion field in the app's build.gradle is set to 25, but when it's set to 27+, the broadcast is not received (targetSdkVersion field for Station Solo is 29, also doesn't work for Flex v2 and Mini v2 if the targetSdkVersion field is set to 27+).

Here's a small reproducible example of a build configuration that works

build.gradle(:app)

android {
    compileSdkVersion 31
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId 'com.small_example.clover'
        minSdkVersion 17
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
}

Here's a small reproducible example of a build configuration that doesn't work

android {
    compileSdkVersion 31
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId 'com.small_example.clover'
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
    }
}


To test this, you can set the following code

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.small_example.clover">

    <application
        {application fields}>

        <receiver
            android:name=".SaleBroadcastReceiver"
            android:enabled="true"
            android:exported="true" >
            <intent-filter>
                <action android:name="clover.intent.action.V1_ORDER_BUILD_STOP" >
                </action>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>
    </application>
</manifest>


SaleBroadcastReceiver.kt


package com.small_example.clover

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.widget.Toast
import com.clover.sdk.v1.Intents

class SaleBroadcastReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        val action = intent.action
        if (action == Intents.ACTION_V1_ORDER_BUILD_STOP) {
            Toast.makeText(context,"Sale broadcast received",Toast.LENGTH_LONG).show()
        }
    }
}


And so with this example, when a you click the "Pay" button when a basket is registered, a toast message should pop up indicating that the Intents.ACTION_V1_ORDER_BUILD_STOP has been received.


Please let me know if you require any more information. For emulator setup, we just followed the recommended settings outlined in the clover docs.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated edited

Hi Chris,

Thank you for the example, the target SDK Version must be 25 or lower, please see https://docs.clover.com/docs/setting-android-sdk-versions#target-sdk

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Chris Murray avatar image
Chris Murray answered

Hey David,

Alright so I've tested with targetSDKVersion set to 25, and the error persists.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered
We've confirmed that the Intent.ACTION_V1_ORDER_BUILD_STOP broadcast works when the targetSdkVersion field in the app's build.gradle is set to 25, but when it's set to 27+, the broadcast is not received

What error? I just reread your post and I don't see any error mentioned. You also confirmed that it works with a target of 25 and now you seem to be saying that it doesn't.


10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Chris Murray avatar image
Chris Murray answered

Sorry for the confusion,. It works when targetSDKVersion is set to 25 on the Flex 2, Mini 2, and Station 2018, whereas with the Station Solo, even when the targetSDKVersion is set to 25, `Intent.ACTION_V1_ORDER_BUILD_STOP` is not broadcasted. And by "error" I mean the fact that this intent is not being broadcasted when it should be.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community