Firebase邀请说已发送邀请但尚未收到

mab*_*abg 27 android firebase firebase-invites

我试图通过Firebase邀请发送邀请.从联系人中选择一封电子邮件时,Firebase表示已发送邀请,但从未收到该电子邮件.

在控制台上,SHA1认证是可配置的.

返回的错误代码始终为RESULT_OK,并且从AppInviteInvitation.getInvitationIds返回的邀请数正确无误.

SDK在gradle上使用最新版本10.0.1进行更新,如文档中所述.

创建邀请的代码是:

Intent intent = new AppInviteInvitation.IntentBuilder(title)
                .setMessage(msg)
                .setCallToActionText(callToActionText)
                .setOtherPlatformsTargetApplication(AppInviteInvitation.IntentBuilder.PlatformMode.PROJECT_PLATFORM_IOS, IOS_CLIENT_ID)
                .build();
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

Ole*_*kyi 2

我遇到了同样的问题,并且设法解决了它,尽管我不太确定哪个步骤真正有帮助。

值得指出的是,在我的情况下,当我删除方法调用时,电子邮件已完美发送:

.setOtherPlatformsTargetApplication(...)
Run Code Online (Sandbox Code Playgroud)

应用了以下步骤:

  1. Android 和 iOS 项目设置的所有字段均在 Firebase 控制台上填写(包括 App ID 前缀和 App Store ID)。
  2. 为 Firebase Android 项目设置添加了 SHA-256 哈希值(来自调试和发布密钥库):

    keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v
    
    Run Code Online (Sandbox Code Playgroud)
  3. 更新google-services.json已从 Firebase Android 项目设置下载并添加到应用程序根目录(使用 GoogleServicesJson Build Action for Xamarin)。因此该文件包含以下内容:

    ...
    "appinvite_service": {
      "status": 2,
      "other_platform_oauth_client": [
        {
          "client_id": "1234567890-specified_ios_client_id.apps.googleusercontent.com",
          "client_type": 2,
          "ios_info": {
            "bundle_id": "ios.app.bundle.id",
            "app_store_id": "9876543210"
          }
        },
        ...
      ]
    }
    ...
    
    Run Code Online (Sandbox Code Playgroud)

方法调用和方法调用中的指定client_id相同.setOtherPlatformsTargetApplication(...)google-services.json

此外,Firebase Invites 之前已针对 iOS 项目进行了调整,但我不认为它对 Android 是否有帮助。