加入我们的 Slack 频道 |
在 Beerpay 上支持我们
将以下内容添加到您的 Podfile
pod 'ProntoSDK'
可用的子规范
ProntoSDK/Authentication
ProntoSDK/Notifications
ProntoSDK/Collections
ProntoSDK/AppUpdateCheck
ProntoSDK/Localization
ProntoSDK/RemoteConfig
并运行
pod install
将以下内容添加到您的 Cartfile
github "Pronto-am/MobileCMS-iOS-SDK"
并运行
carthage update
将以下依赖项添加到您的 Package.swift
.package(url: "https://github.com/Pronto-am/MobileCMS-iOS-SDK", .upToNextMajor(from: "2.0.0"))
将以下依赖项添加到您的 Package.swift
.package(url: "https://github.com/Pronto-am/MobileCMS-iOS-SDK", .upToNextMajor(from: "2.0.0"))
并运行
accio install
打开 ProntoSDK.xcodeproj
并开始开发。
在 AppDelegate.swift
中
import ProntoSDK
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let config = ProntoConfig()
// Setup the API client credentials
config.clientID = <#CLIENT_ID#>
config.clientSecret = <#CLIENT_SECRET#>
config.encryptionKey = <#ENCRYPTION_KEY#>
config.domain = "mypronto.site.com"
config.firebaseDomain = "myprontoproject.firebaseio.com"
// Activate each plugin your project uses
config.plugins = [ .notifications, .authentication, .collections, .localization, .updateChecker ]
// Disable logging for non-debug builds
#if DEBUG
config.logger = Logger() // Should conform to `Cobalt.Logger` protocol
#endif
ProntoSDK.configure(config)
// Do the rest of the implementation
return true
→ 📯 阅读通知文档
→ 🔐 阅读身份验证文档
→ 🗂 阅读集合文档
→ 🌟 阅读更新检查器文档
→ 🇪🇺 阅读本地化文档
→ ⚙️ 阅读远程配置文档
几乎每个 ProntoSDK 异步函数都在内部使用 RxSwift
import RxSwift
import RxCocoa
let single = ProntoCollection<Location>().list() // = Single<[Location]>
single.subscribe(onSuccess: { locations in
// ...
}, onError: { error in
print("Error fetching locations: \(error)")
}).disposed(by: disposeBag)