NotionClient: a Notion SDK for iOS & macOS
Unofficial Notion API SDK for iOS & macOS. This is an alpha version and still work in progress.
- Create new pages in a database
- Add filters & sorts for database query
- Make all objects copyable
- Add Foundation objects for blocks / modifying page contents
- Add documentation for all methods
- Add sample project for Objective-C
- Add sample project for Swift
- Add support for macOS
- Add support for tvOS
- Add support for watchOS?
- Add OAuth2 authorization support? (currently not possible due to limitations in redirect URI)
NotionClient is a native iOS & macOS SDK for Notion's official API. NotionClient converts all API JSON objects to native Foundation objects. API responses are automatically converted to Foundation objects making it a lot easier to read the data coming from Notion. Those same Foundation objects can then be modified and sent back to the API to update the objects. Several objects also have convenience initializers for the most common use cases, e.g. setting a text property with just 1 string in 1 color.
This way, there is never any need to deal with Notion's complex JSON structure directly.
- iOS 11 or above
NotionClient does not use any external dependencies.
- Open NotionClient.xcodeproj
- Build the NotionClient-iOS scheme
- Copy the generated NotionClient.framework file to your project
Add NotionClient to your Podfile and run
# Podfile platform :ios, '11.0' target 'YOUR_TARGET_NAME' do # Dynamic frameworks is supported but not required use_frameworks! pod 'NotionClient', '0.0.1' end
Import Notion.h in the implementation files (or in a Prefix header):
Import Notion.h in the Objective-C Bridging Header:
// Bridging header #import <NotionClient/Notion.h>
Creating a NotionClient
All communication with the Notion API happens using the NotionClient object. To initialize it you'll need a token, see the official Authorization guide for more info.
let client = NotionClient.init(token: "NOTION_INTEGRATION_TOKEN")
NotionClient *client = [NotionClient clientWithToken:@"NOTION_INTEGRATION_TOKEN"];
More documentation coming soon!
NotionClient is released under an MIT License. See LICENSE for details.