NotionDrive - A swift package that can upload files to Notion.so or download files from Notion.so

Overview

NotionDrive

NotionDrive is a swift package that can upload files to Notion.so or download files from Notion.so.

Prepare

To use NotionsDrive. You need have a account at Notion.so. And than create a root page and create a sub page in the root page. After this, open Settings & Members. Open the Integrations option, and click the Develop your own integrations button. Click Create new integration button. Input a random name or other. Select a workspace that you have create a page recently. And add all Content Capabilities. Also select Read user information including email addresses. Back to the root page. Click share, and click invie, and choose the integrations that you created. Open the sub page, repeat the opreations above.

Start

  1. Use print(try await NotionDrive.getAllPages(token)) get all pages.
  2. Find a NotionSwift.Page item whose name is the name of sub page.
  3. Copy 7afbab54-72b5-4d7f-9939-d7f2d34e5bae in the id: ID<Page>:7afbab54-72b5-4d7f-9939-d7f2d34e5bae of the item above (Just for a example)

Create NotionDrive

father = The id that you got at Start (String)
token = The Integrations token (String)
let drive = NotionDrive(.init(father), token: token)

Upload

I don't think uploading big files is a good choice.

data = The file's data (Data)
guard let uuid = try await drive.upload(data, name: UUID().uuidString) else { return }

You will use this uuid to donwload file.

Download

Sometimes, you cannot download the file. Try again.

uuid = The uuid you saved at Upload (UUID)
let data = try await drive.download(uuid)
You might also like...
This is my attempt to make this repo available on swift package manager

Parse LiveQuery Client for iOS/OSX PFQuery is one of the key concepts for Parse. It allows you to retrieve PFObjects by specifying some conditions, ma

Swift package for adding API Key requirement to vapor backends.

APIKeyMiddleware Swift package for adding API Key requirement to vapor backends. Features ✅ Supports an array of keys ✅ Supports overriding thrown err

Create xcframework zip archive for Swift binary package.

xczip xczip - create xcframework zip archive for swift binary package. Creates an xcframework archive with a stable checksum that does not change when

MultiPeer-Progress-iOS - Swift project to demo the use of the MultiPeer framework to send files between iOS devices and show the progress
UDPReader : a simple package for reading udp packets

UDPReader is a simple package for reading udp packets

AsyncWebSocketClient - A package that contains a client behaving as a wrapper for the URLSessionWebSocketTask

(WORK IN PROGRESS) AsyncWebSocketClient This is a package that contains a client

APIProvider - API Provider Package for easier API management inspired by abstraction

APIProvider Using APIProvider you can easily communicate with all API endpoints

SwiftCANLib is a library used to process Controller Area Network (CAN) frames utilizing the Linux kernel open source library SOCKETCAN.

SwiftCANLib SwiftCANLib is a library used to process Controller Area Network (CAN) frames utilizing the Linux kernel open source library SOCKETCAN. Th

ADVANCED APP DESIGN The main goal of this mini project is to inspire you on what we can accomplish with the SwiftUI framework.
ADVANCED APP DESIGN The main goal of this mini project is to inspire you on what we can accomplish with the SwiftUI framework.

Restart-App.0.2 ADVANCED APP DESIGN The main goal of this mini project is to inspire you on what we can accomplish with the SwiftUI framework. COMPLEX

Owner
Underthestars-zhy
iOS software developer
Underthestars-zhy
Little project I wrote a while ago I decided to clean up and upload.

ImageSearch About The project uses the Pixabay (https://pixabay.com/) API to show images relating to entered text. The app is built using an MVVM arch

Jay Bennett 0 Dec 7, 2021
ServiceData is an HTTP networking library written in Swift which can download different types of data.

ServiceData Package Description : ServiceData is an HTTP networking library written in Swift which can download different types of data. Features List

Mubarak Alseif 0 Nov 11, 2021
A modern download manager based on NSURLSession to deal with asynchronous downloading, management and persistence of multiple files.

TWRDownloadManager TWRDownloadManager A modern download manager for iOS (Objective C) based on NSURLSession to deal with asynchronous downloading, man

Michelangelo Chasseur 407 Nov 19, 2022
Native ios app to download tiktoks localy made in swift with SwiftUI

sequoia Native ios app to download tiktoks localy made in swift with SwiftUI without external dependencies. features save video localy view saved vide

fleur 9 Dec 11, 2022
A progressive download manager for Alamofire

ALDownloadManager A progressive download manager for Alamofire (Alamofire下载器) The default support breakpoint continues. Sequential Download(顺序下载 ) Dow

null 48 May 1, 2022
Snap Scraper enables users to download media uploaded to Snapchat's Snap Map using a set of latitude and longitude coordinates.

Snap Scraper Description Snap Scraper is an open source intelligence tool which enables users to download media uploaded to Snapchat's Snap Map using

Dr Richard Matthews 58 Dec 12, 2022
This package is meant to make http request of an easy way inspiren in the architecture of Moya package

NetworkAgent This package is meant to make http request of an easy way inspiren in the architecture of Moya package. This package is 100% free of depe

Angel Rada 19 Sep 8, 2022
UnsplashProvider - A package that can use the Unsplash API. It was developed as a SwiftUI

UnsplashProvider It is a package that can use the Unsplash API. It was developed

jasu 12 Dec 20, 2022
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.

BlueSocket Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. Prerequisites Swift Swift Open Source swift-5.1

Kitura 1.3k Dec 26, 2022
A Swift Package that allows iOS apps to communicate with AltServer.

AltKit allows apps to communicate with AltServers on the same WiFi network and enable features such as JIT compilation.

Riley Testut 45 Sep 8, 2022