跳过内容

故障排除

GitHub

If App Store Connect reports this error:

ITMS-91056: Invalid privacy manifest - The PrivacyInfo.xcprivacy file from the following path is invalid: …

检查您的应用级别 PrivacyInfo.xcprivacy 文件:

  • 该文件必须是有效的 JSON。
  • 仅使用 Apple 文档中记录的键和值。
  • 不要将隐私清单添加到插件包中;将其添加到您的应用中。

参见 隐私清单和 iOS URL 处理程序 有关示例。

Google Play Console AD_ID 权限错误

标题为“Google Play Console AD_ID 权限错误”

当您将应用程序提交到Google Play后,您可能会看到:

Google Api Error: Invalid request - This release includes the com.google.android.gms.permission.AD_ID permission
but your declaration on Play Console says your app doesn't use advertising ID.

FacebookSDK包含 AD_ID 和其他与广告相关的权限。如果您的应用程序不使用Facebook登录,请在 capacitor.config.ts:

import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
plugins: {
SocialLogin: {
providers: {
google: true,
facebook: false,
apple: true,
},
},
},
};
export default config;

然后运行:

终端窗口
npx cap sync

该插件使用虚拟类而不是真正的FacebookSDK,因此Facebook依赖项和权限不会包含在您的构建中。

Android上的Google Sign-In 28444

Android上Google Sign-In 28444的部分

GetCredentialCustomException: [28444] Developer console is not set up correctly 来自Google Credential Manager,当安装的APK的签名证书、包名或 webClientId 不符合Google Cloud Console.

使用完整的 Android Google故障排查清单. 登录失败后,过滤Logcat以查找 GoogleProvider; 插件打印 package, signingSha1,并且一个掩码 webClientId 以便与您的OAuth客户端进行比较.

Section titled “使用Family Link受管账户的Google Sign-In”

Family Link受管账户可能会出现以下问题:

NoCredentialException: No credentials available

对于需要支持Family Link账户的应用程序,禁用Google登录调用中的授权账户过滤:

import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.login({
provider: 'google',
options: {
style: 'bottom',
filterByAuthorizedAccounts: false,
scopes: ['profile', 'email'],
},
});

关键点:

  • 设置 filterByAuthorizedAccountsfalse;默认值为 true.
  • 插件自动重试 standard 样式如果 bottom 样式失败时 NoCredentialException.
  • 这些选项仅影响Android。 iOS正常处理Family Link账户。
  • 错误消息建议禁用 filterByAuthorizedAccounts 当检测到此故障时

使用 @capgo/capacitor-persistent-account 当您的应用程序需要本机安全存储访问令牌或刷新令牌时使用。

在 Android 上,它将数据存储在 Account Manager 中。 在 iOS 上,它将数据存储在 Keychain 中。