PlutoSDK 1.0

PlutoSDK 1.0

[Meng Li]维护。



  • 作者
  • lm2343635

Pluto Swift Client SDK

CI Status Version License Platform

Pluto 登录微服务 Swift SDK,简化了使用电子邮件、Google 和 Apple 登录的实现。

安装

Pluto 的 Swift SDK 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中即可。

pod 'PlutoSDK'

文档

要使用 Pluto 进行身份验证,请首先在您的 AppDelegate 类中设置它。

Pluto.shared.setup(server: "[server url]", appId: "[app id]")

登录、注册和注销

使用以下方法实现登录和注册:

  • Pluto.shared.register()
  • Pluto.shared.resendValidationEmail()
  • Pluto.shared.loginWithAccount()
  • Pluto.shared.loginWithGoogle()
  • Pluto.shared.loginWithApple()
  • Pluto.shared.resetPassword()
  • Pluto.shared.logout()

令牌管理

登录后,可以通过以下方法获取令牌或带令牌的头部

  • Pluto.shared.getToken()
  • Pluto.shared.getHeaders()

使用以下方式获取和更新用户信息

  • Pluto.shared.currentUser
  • Pluto.shared.myInfo()
  • Pluto.shared.updateName()
  • Pluto.shared.uploadAvatar()

使用以下方式从JWT令牌中获取作用域

  • Pluto.shared.getScopes()

账户绑定

绑定和解绑账户

  • Pluto.shared.bind()
  • Pluto.shared.unbind()

获取可用的登录类型和绑定

  • Pluto.shared.availiableLoginTypes
  • Pluto.shared.availiableBindings

调试

支持以下调试方法用于DEBUGADHOC模式

  • Pluto.shared.simulateInvalidRefreshToken
  • Pluto.shared.simulateInvalidAccessToken
  • Pluto.shared.resetExpire

作者

lm2343635, [email protected]

许可证

Pluto Swift客户端SDK在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。