ios - 如何将 Google 登录与 Realm iOS SDK 集成
问题描述
在遵循https://docs.mongodb.com/realm/ios/quick-start/上的步骤后,我已经构建了我的大部分应用程序,之前指示我们使用 cocoa-pod RealmSwift 版本 10.0.0-beta.2
我试图在这里实现示例代码https://docs.mongodb.com/realm/ios/authenticate/#ios-login-google 并注意到许多函数和类名不同(不确定它是否引用 5.3. 6)。
我正在研究 Github 上的 repo 并注意到 10.0.0-beta.4 具有用于集成“使用 Apple 登录”的新代码和示例,因此 RealmSwift 可能并不完全支持 Mongo 中支持的所有身份验证方法阿特拉斯
我的登录快速入门教程中的代码是
app.login(withCredential: AppCredentials(username: username!, password: password!)) { [weak self](user, error) in
当然运行良好,但是下面的代码
let gToken = GIDSignIn.sharedInstance()?.currentUser.authentication.idToken
app.login(withCredential: AppCredentials.init(googleToken: gToken!)) { [weak self](user, error) in
抱怨它无法编译,因为它期待AppCredentials(username: username!, password: password!)
即使 AppCredentials.init(googleToken 是返回 RLMCredentials 对象的有效调用
解决方案
推荐阅读
- datatables - 在javascript中将Datatable父子数据导出为excel
- express - 为什么我的环境变量没有通过 ConfigMap 在 Kubernetes Pod 中设置?
- sql - 如何按 Sum(qty) 获得 TOP 5 项目?
- adonis.js - 有没有办法删除 Rocketseat adonis Bull 中的预定工作?
- javascript - 如何在不同的场合在一个函数中传递两个参数?
- c# - 如何转换 Ienumerable
到 Generic.List ? - azure - Microsoft Azure 管道错误:“未购买或授予托管并行性”
- java - Android Studio 中使用 CountDownTimer 的定时器
- .net-5 - 在 ASP.NET Core 5 Web 应用程序中禁用 DOTNET_STARTUP_HOOKS
- python - Python:识别重复的 JSON 值并生成包含重复输入行集的输出文件,每组重复一行