简体   繁体   English

匹配类型在 Android Firebase 动态链接 SDK

[英]MatchType in Android Firebase Dynamic Link SDK

I'm implementing a Firebase dynamic link mechanism in Android.我在 Android 中实现了 Firebase 动态链接机制。 We wanted to use Android SDK but to match users only when there is a one-to-one identification between users who clicks the link and user, which opened the app.我们想使用 Android SDK 但仅在单击链接的用户与打开应用程序的用户之间存在一对一标识时才匹配用户。 In iOS there is MatchType.Unique that serves this purpose:在 iOS 中有 MatchType.Unique 用于此目的:

The match between the Dynamic Link and this device is exact, hence you may reveal personal information related to the Dynamic Link.动态链接与此设备之间的匹配是精确的,因此您可能会泄露与动态链接相关的个人信息。 https://firebase.google.com/docs/reference/swift/firebasedynamiclinks/api/reference/Enums/DLMatchType#unique https://firebase.google.com/docs/reference/swift/firebasedynamiclinks/api/reference/Enums/DLMatchType#unique

Unfortunately, I can't find anything close in Android SDK.不幸的是,我在 Android SDK 中找不到任何接近的东西。 I will appreciate any help here to find how to distinguish deep links of the unique match type in Android我将感谢您在此处找到如何区分 Android 中唯一匹配类型的深层链接的任何帮助

Thanks谢谢

From Android Firebase Dynamic Links Documentation 来自Android Firebase动态链接文档

When a dynamic link is clicked by the user, in most cases it is captured when clicked and stored until accessed by getDynamicLink(Intent) and returned as the PendingDynamicLinkData of the Task. 当用户单击动态链接时,在大多数情况下,当单击并存储动态链接时会捕获该动态链接,直到由getDynamicLink(Intent)访问该动态链接并作为Task的PendingDynamicLinkData返回。 If the dynamic link was not captured, as is the case when App Links launches launches the app, then the dynamic link is provided in the getData(). 如果未捕获动态链接(例如启动App Links时启动应用程序),则将在getData()中提供动态链接。 The intent data is then processed to retrieve the dynamic link data. 然后处理意图数据以检索动态链接数据。 If the dynamic links is both captured and is present in the intent, then the captured data will take precedence. 如果动态链接既被捕获又存在于意图中,则捕获的数据将优先。 The captured data will be removed after first access. 首次访问后,捕获的数据将被删除。

This indicates the one-to-one identification between users who clicks the link and user, which opened the app is matched(for android) if PendingDynamicLinkData doesn't return null. 如果PendingDynamicLinkData不返回null,则表明单击链接的用户与打开应用程序的用户之间的一对一标识是匹配的(对于android)。

In the callback the PendingDynamicLinkData is returned in addOnSuccessListener(OnSuccessListener) or addOnCompleteListener(Activity, OnCompleteListener) which returns the most recently clicked dynamic link, or null if a dynamic link was not pending as captured data or in the intent. 在回调中,将在addOnSuccessListener(OnSuccessListener)或addOnCompleteListener(Activity,OnCompleteListener)中返回PendingDynamicLinkData,这将返回最近单击的动态链接;如果动态链接没有作为捕获的数据或意图而未挂起,则返回null。

It seems from this part of documentation that the matchType parameter exists only in Swift. 从这部分文档看来,matchType 参数仅存在于 Swift 中。

Personally, what I did is creating an array saved in the SharedPreferences, of all the DynamicLink already handled.就个人而言,我所做的是创建一个保存在 SharedPreferences 中的数组,其中包含已处理的所有 DynamicLink。 Then, I just need to check for all the DynamicLinks entering if they are part of this array, and ignoring them in such a case.然后,我只需要检查所有输入的 DynamicLinks 是否是该数组的一部分,并在这种情况下忽略它们。

Seems that even after an hour, the last DynamicLink handled still remains kind of "active".似乎即使一个小时后,最后处理的 DynamicLink 仍然保持“活动”状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase - 动态链接不适用于 Android 12 - Firebase - Dynamic Link not working with Android 12 深层链接/Firebase 动态链接 - Deeplinking/Firebase dynamic link 收不到firebase动态链接 - Not receiving firebase dynamic link Firebase 动态链接 Android iosParameters setFallbackUrl ('ifl') 未设置 - Firebase Dynamic Link Android iosParameters setFallbackUrl ('ifl') doesn't set 将 Firebase 动态链接中的网址列入白名单 - Whitelisting URLs in Firebase Dynamic Link Firebase 动态链接在 IOS 上不起作用 - Firebase dynamic link is not working on IOS google-services.json Google Cloud out-login和Firebase动态链接同一个项目android - google-services.json Google Cloud outh login and Firebase dynamic link same project android 安装后我们无法从 Play 商店打开应用程序,动态链接 (firebase) Android 会发生这种情况 - we can't open apps from play store after an install, this happens with dynamic link (firebase) Android Firebase 控制台动态链接OFL参数 - Firebase Console Dynamic Link OFL Parameter 对于 Firebase 动态链接,utmParameters 始终为空 - utmParameters is always empty for a Firebase Dynamic Link
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM