首页 > 解决方案 > 在 Android 中未收到带有 android plaid sdk 的成功回调

问题描述

我在我的 android 应用程序中实现了 plaid sdk 版本 - 0.3.0

单击最后一个屏幕“继续”按钮后,我没有收到成功或任何回调。

单击“继续”后,我得到了 onActivityResult() 的回调,结果代码=0,但与任何格子结果代码无关。

我只创建了一个 Activity 作为 MainActivity 并将其用作 Redirected Activity。

===== AndroidManifest.xml =====

    <activity android:name=".MainActivity" android:launchMode="singleInstance">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>

                <intent-filter android:autoVerify="true">
                    <action android:name="android.intent.action.VIEW" />
                    <category android:name="android.intent.category.DEFAULT" />
                    <category android:name="android.intent.category.BROWSABLE" />
                    <data
                        android:host="plaid-redirect"
                        android:scheme="plaidtestapp" />
                </intent-filter>
            </activity>
<activity android:name="com.plaid.link.LinkActivity" />

===== MainActivity.kt =====

val intent = Intent(this, LinkActivity::class.java)
intent.putExtra( Plaid.LINK_CONFIGURATION,
LinkConfiguration(
// required
clientName = "Plaid Test App",
products = listOf(PlaidProduct.TRANSACTIONS),
webviewRedirectUri = "plaidtestapp://plaid-redirect",
// optional
environment = PlaidEnvironment.SANDBOX, // Defaults to plaid options value if set or SANDBOX
language = Locale.ENGLISH.language, // Defaults to English
countryCodes = listOf(Locale.US.country), // Defaults to US
webhook = "https://requestb.in",
userEmailAddress = "{registered email id}",
userLegalName = "{registered email id}",
userPhoneNumber = "{phone number}") )
startActivityForResult(intent, LINK_REQUEST_CODE)

参考 Github 链接 https://github.com/plaid/plaid-link-android

在此先感谢,请帮助。

标签: androidkotlincallbackonactivityresultplaid

解决方案


它通过将格子 sdk 版本更新到 0.3.1 来解决

dependencies {
  implementation 'com.plaid.link:sdk-core:0.3.1'
}

在 Plaid 文档网站上,他们仍然保留旧版本,请将版本更新到 0.3.1。

使用新版本,它接收所有回调


推荐阅读