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
- GPS状态的广播接收器? 2022-01-01
- UITextView 内容插图 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- URL编码Swift iOS 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01