f3
在下载应用程序后未得到调用。从Play商店。
但是我在 BroadcastReceiver
adb.
使用 am broadcast -a com.android.vending.INSTALL_REFERRER -n my.package/my.package.InstallReferrerReceiver --es "referrer" "utm_source=test_source&utm_medium=test_medium&utm_term=test_term&utm_content=test_content&utm_campaign=test_name"
效果很好,但是当从Play商店下载时,它没有调用。
AndroidManifest.xml
adb.
InstallReferrerReceiver.java
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="my.package">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:name="my.package.MyApplication"
android:allowBackup="false"
android:fullBackupContent="false"
android:icon="@mipmap/logo"
android:label="@string/app_name"
android:supportsRtl="false"
android:theme="@style/Theme.DesignDemo"
android:usesCleartextTraffic="true"
tools:replace="allowBackup, supportsRtl, label">
<receiver
android:name="my.package.InstallReferrerReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service android:name="my.package.firebase.MyFirebaseMessagingServices">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<activity
android:name="my.package.SplashActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>