← ClaudeAtlas

bmob-database-ioslisted

Use when implementing Bmob NoSQL database CRUD in an iOS native project — both Objective-C and Swift / SwiftUI / UIKit. Triggers: BmobSDK, BmobSDK.xcframework, pod 'BmobSDK', #import <BmobSDK/Bmob.h>, Bmob registerWithAppKey, [Bmob register(withAppKey:)], BmobObject objectWithClassName, BmobQuery queryWithClassName, BmobUser, BmobInstallation, BmobFile, BmobGeoPoint, BmobRelation, saveInBackgroundWithResultBlock, getObjectInBackgroundWithId, findObjectsInBackground, Bridging-Header.h. NOT for cross-platform JavaScript / WeChat Mini Program (use bmob-database-javascript), Android (use bmob-database-android), Flutter / Dart (use bmob-database-flutter), or any other language via REST (use bmob-database-restful). If Bmob MCP is configured, call get_project_tables via bmob-mcp before writing code.
bmob/agent-skills · ★ 3 · API & Backend · score 79
Install: claude install-skill bmob/agent-skills
# Bmob Database — iOS Native SDK iOS SDK 名为 `BmobSDK`,是 **Objective-C 编写**的 framework,Swift 项目通过 **Bridging Header** 桥接使用。SDK 数据模型以 `BmobObject` 为核心,不需要为每个表写子类(与 Android 不同)。 ## 核心原则 **1. 安装 SDK — 强推 CocoaPods**: ```ruby # Podfile target "你的项目名称" do platform :ios, "15.6" use_frameworks! pod 'BmobSDK' end ``` ```bash pod install ``` > 装完后**只打开 `.xcworkspace`**,不要再打开 `.xcodeproj`,否则找不到 Pod 引入的库。 也可手动导入 `BmobSDK.xcframework`,并链接以下系统库(详见 [`references/install.md`](references/install.md))。 **2. Swift 必须桥接:** 新建任意 `.m` 文件让 Xcode 弹"Create Bridging Header",然后在生成的 `项目名-Bridging-Header.h` 加: ```objc #import <BmobSDK/Bmob.h> ``` **3. 初始化(OC)** — `AppDelegate.m`: ```objc - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // release 上线时启用备案域名,必须在 registerWithAppKey 之前 // [Bmob resetDomain:@"https://你的备案域名"]; [Bmob registerWithAppKey:@"你的Application ID"]; return YES; } ``` **3. 初始化(Swift / SwiftUI)** — `AppApp.swift`: ```swift @main struct MyApp: App { init() { Bmob.register(withAppKey: "你的Application ID") } var body: some Scene { WindowGroup { ContentView() } } } ``` **4. 域名重置(上线必做):** 工信部要求正式上线必须用备案域名: ```swift Bmob.resetDomain("https://sdk.yourapp.com") // 必须在 register 前 Bmob.register(withAppKey: "...") ``` OC 端用 `[Bmob resetDomain:@"https://sdk.yourapp.com"];`。 **5. 不要硬编码 Master Key** 到 App bundle。客户端只用 Application ID(必要时配 Secret Key + 加密授权)。 ## 安全清单 - [ ] **rele