Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 14 problem - initialization broadcast intent with MParticle.ServiceProviders.BROADCAST_ACTIVE should set package too #478

Open
fada21 opened this issue Mar 25, 2024 · 0 comments

Comments

@fada21
Copy link

fada21 commented Mar 25, 2024

We had a problem that kit activated broadcast (MParticle.ServiceProviders.BROADCAST_ACTIVE_xx) were not received on devices on Android 14.

It turns out that our registered receiver used recommended flag Context.RECEIVER_NOT_EXPORTED and that requires package set on intent.

Here sdk code from v5.55.2

Intent intent = new Intent(MParticle.ServiceProviders.BROADCAST_ACTIVE + activeKit.getConfiguration().getKitId());
getContext().sendBroadcast(intent);

We suggest change like:

        Intent intent = new Intent(MParticle.ServiceProviders.BROADCAST_ACTIVE + activeKit.getConfiguration().getKitId());
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
            intent.setPackage(getContext().getPackageName())
        }
        getContext().sendBroadcast(intent); 

See external tracked issue here: https://issuetracker.google.com/issues/293487554#comment14
and stackoverflow: https://stackoverflow.com/a/76920719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant