Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install referrer not working in some redmi devices

I need to track install referrals for my android app. It's working fine in most of the devices. But in Redmi device, the broadcast is not getting triggered. I tested it with Redmi Note 4

I have tested it both from via ADB as well as play store. Both don't trigger the broadcast in Redmi device

Below is the code that I am using

public class ReferrerReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
           Log.d("Broadcast", "RECEIVED!");
        }
}


<receiver
    android:name=".receiver.ReferrerReceiver"
    android:exported="true">
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER"/>
    </intent-filter>
</receiver>

Please suggest if someone faced the same issue and got some solution??

like image 650
Sachin Avatar asked Jul 27 '17 13:07

Sachin


People also ask

Why can't I install apps on xiaomi?

It might be that your storage is full. Try deleting useless apps/photos. If you are trying to install an app downloaded from an untrusted source(downloaded from internet) you will need to go settings ->additional settings->privacy->allow installation from unknown sources and turn ON the option.


1 Answers

Is your app in the list of "protected apps" that are allowed to run in the background? If not, it won't get automatically started. This is a problem on devices like Xiaomi, Huawei and others. There should be a settings page in "Settings->Apps-Security" that allows you to add your app to a list of apps that are allowed to autostart, run in the background, etc. Each device manufacturer does this a bit differently, but in general we see this on Chinese devices as a way to preserve battery life.

See also:

  • How to get MIUI Security app auto start permission programmatically?
  • How to enable AutoStart option for my App in Xiaomi phone Security App programmatically in android
  • GCM push notifications for android devices are not working on MI and Letv mobiles
like image 83
David Wasser Avatar answered Dec 29 '22 00:12

David Wasser