安装应用程序时如何使用应用程序链接将参数传递给要检索的android playstore

how to use app links to pass parameter to android playstore to be retrieved when app is installed(安装应用程序时如何使用应用程序链接将参数传递给要检索的android playstore)

本文介绍了安装应用程序时如何使用应用程序链接将参数传递给要检索的android playstore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款社交安卓问答游戏.当用户向没有安装我的琐事游戏的朋友挑战游戏时,我想向他发送一个自定义 url,以从市场上下载包含邀请用户 ID 参数的应用程序.

I'm developing a social android trivia game. When a user challenges to a game a friend, who doesn't have my trivia game installed, i'd like to send him a custom url to download the app from the market containing a parameter of the inviting user id.

当应用程序第一次运行时,我需要能够接收传递给市场的参数,以便识别用户并向他展示他所挑战的游戏.我不知道如何使用应用链接执行此操作,也没有找到任何合适的示例.

when the app is run for the first time, i need to be able to receive the parameter passed to the market, in order to identify the user and show him the game he was challenged to. i couldn't figure out how to do this with app links and didn't find any appropriate example.

非常欢迎任何帮助!谢谢,伊多

any help would be greatly welcomed! Thanks, Ido

推荐答案

要将数据发送到 Android Market,您必须构建一个像这样的 uri:

To send data to the Android Market, you have to build an uri like this one:

market://details?id=my.package.name&referrer=someDataToTransfer

要取回这些数据,您应该实现一个 INSTALL_REFERRER 接收器.

To get this data back, you should implement an INSTALL_REFERRER Receiver.

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

这里有一个简短的教程,它将向您解释如何全面实施此解决方案.

Here is a short tutorial that will explain you how to fully implement this solution.

如果您想在不编写任何代码的情况下对其进行测试,请查看我的应用程序:GitHub 上的 Install Referrer 或 Play 商店

And if you want to test it without writting any code, checkout my app: Install Referrer on GitHub or on the Play Store

这篇关于安装应用程序时如何使用应用程序链接将参数传递给要检索的android playstore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:安装应用程序时如何使用应用程序链接将参数传递给要检索的android playstore

基础教程推荐