android - 使用自定义参数链接到 Google Play 商店

标签 android ios

是否可以使用自定义参数建立到 Play Store(到我的应用程序)的链接?我希望能够在安装后在我的应用程序中读取此参数。 我找到了 Firebase 动态链接,但它似乎不支持此类功能

最佳答案

您可以使用 Activity 衡量链接。

链接生成器:

https://developers.google.com/analytics/devguides/collection/android/v4/campaigns#google-play-url-builder

您可以通过实现自己的 BroadcastReceiver 而不是使用 com.google.android.gms.analytics.CampaignTrackingReceiver 来读取您定义的参数。

在您的接收器中,您可以执行类似的操作来获取链接中定义的所有参数。

   public class InstallReceiver extends BroadcastReceiver {

        @Override
        public void onReceive(Context context, Intent intent) {
            Bundle extras = intent.getExtras();
            if(extras != null){
              //You will find all of your params under the extra "referrer" like:

              String referrer = extras.getString("referrer");

              //Then you only have to parse it and get the param you need.

            }
       }
   }

文档:https://developers.google.com/analytics/devguides/collection/android/v4/campaigns

关于android - 使用自定义参数链接到 Google Play 商店,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44416853/

相关文章:

android - 如何在 Android 中像 Instagram 一样实现自定义标签

android - device.platform 给出 "device is not defined"phonegap

ios - 关闭从 SideMenu 打开的 ViewController

ios - 将 UIProgressBar 添加到 UITableViewCell

iphone - 使用 UIApplication 共享应用程序时出错?

Android 签名 APK 不显示 Googlemap

带有动态文本的 Android 对话框(API 级别 < 8)在旋转时被杀死

android - chrome 错误中的 react-native 调试

ios - NSPropertyListSerialization propertyListWithData 产生不兼容的转换警告/错误

iphone - 单按钮 UIMenuController