how to use app links to pass parameter to android playstore to be retrieved when app is installed(安装应用程序时如何使用应用程序链接将参数传递给要检索的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
基础教程推荐
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
