• This repository has been archived on 11/Dec/2020
  • Stars
    star
    39
  • Rank 693,563 (Top 14 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Swift SDK for WeTransfer’s public API

This project is now archived as the Public WeTransfer API is no longer maintained.

WeTransfer-Swift-SDK

A Swift SDK for WeTransfer’s public API

Build Status License Carthage compatible CocoaPods Compatible Platform

For your API key and additional info please visit our developer portal.

Features

  • Create and upload a transfer from a single method call
  • Seperate methods for each seperate step in the process
  • Cancelling and resuming uploads

Requirements

  • iOS 9.0+ / macOS 10.10+
  • Xcode 9.4+
  • Swift 4.2+

Installation

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate WeTransfer into your Xcode project using Carthage, specify it in your Cartfile:

github "WeTransfer/WeTransfer-Swift-SDK" ~> 2.0

Run carthage update to build the framework and drag the built WeTransfer.framework into your Xcode project.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding the WeTransfer SDK as a dependency is as easy as adding it to the dependencies value of your Package.swift.

Swift 4

dependencies: [
    .package(url: "https://github.com/Alamofire/WeTransfer-Swift-SDK.git", from: "2.0")
]

Note: Running swift test doesn’t work currently as Swift packages can’t have resources in their test targets.

Cocoapods

CocoaPods is a dependency manager for Cocoa projects.

To integrate the WeTransfer Swift SDK into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'WeTransfer-Swift-SDK', '>= 2.0'
end

Then, run the following command:

$ pod install

Usage

Before the SDK can do anything with the WeTransfer API, it needs to be authenticated with an API key. You can create an API key at the developer portal

  1. Configure the client Create a configuration with your API key
let configuration = WeTransfer.Configuration(apiKey: "YOUR_API_KEY")
WeTransfer.configure(with: configuration)
  1. Uploading files with a new transfer Creating a transfer and uploading files to it can be done with one method call, WeTransfer.uploadTransfer. Files in the SDK are represented by File objects, but this convenience methods expects an array of URLs pointing to files on your device. In the stateChanged closure you’re updated about things like the upload progress or whether is has completed or failed
let files = [...]
WeTransfer.uploadTransfer(saying: "Transfer Name", containing: files) { state in
    switch state {
    case .created(let transfer):
        print("Transfer created")
    case .uploading(let progress):
        print("Transfer uploading")
    case .completed(let transfer):
        print("Upload completed")
    case .failed(let error):
        XCTFail("Transfer failed: \(error.localizedDescription)")
    }
}

Sample Application

WeTransfer Swift SDK Sample Application

Included with the project is a neat little sample application that shows a possible use case for the SDK. It allows for photos and videos to be added to a transfer and shows the upload progress for the whole transfer, aAfter which the URL can be shared.

Communication

We recommend checking out the contribution guide for a full run-through of how to get started, but in short:

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

License

The WeTransfer Swift SDK is available under the MIT license. See the LICENSE file for more info.

Code of Conduct

Everyone interacting in the WeTransfer Swift SDK project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct

More Repositories

1

WeScan

Document Scanning Made Easy for iOS
Swift
2,825
star
2

Mocker

Mock Alamofire and URLSession requests without touching your code implementation
Swift
1,096
star
3

Diagnostics

Allow users to easily share Diagnostics with your support team to improve the flow of fixing bugs.
Swift
939
star
4

UINotifications

Present custom in-app notifications easily in Swift
Swift
394
star
5

zip_tricks

[DEPRECATED] Compact ZIP file writing/reading for Ruby, for streaming applications
Ruby
349
star
6

GitBuddy

Your buddy in managing and maintaining GitHub repositories, and releases. Automatically generate changelogs from issues and merged pull-requests.
Swift
240
star
7

WeTransfer-iOS-CI

Containing all the shared CI logic for WeTransfer repositories
Swift
223
star
8

prorate

Redis-based rate limiter (with a leaky bucket implementation in Lua)
Ruby
86
star
9

wt_activerecord_index_spy

A gem to spy queries running with Active Record and report missing indexes
Ruby
77
star
10

format_parser

file metadata parsing, done cheap
Ruby
62
star
11

wt-js-sdk

A JavaScript SDK for WeTransfer's Public API
JavaScript
47
star
12

Sketch-Plugin

Plugin to share artboards directly via WeTransfer. Share the link easily with your colleagues and friends.
Objective-C
39
star
13

sqewer

SQS queue processor engine
Ruby
30
star
14

wt_s3_signer

Fast S3 key urls signing
Ruby
26
star
15

cr_zip_tricks

Alternate ZIP writer for Crystal, ported from zip_tricks for Ruby
Crystal
25
star
16

image_vise

Image processing proxy that works via signed URLs
Ruby
20
star
17

ghost_adapter

Run ActiveRecord migrations through gh-ost
Ruby
19
star
18

concorde.js

A sexy pinnacle of engineering that’s nonetheless incredibly inefficient and expensive and goes out of business because it can’t find enough use. It also provides some tools to deal with the browser.
JavaScript
17
star
19

fast_send

Send very large HTTP responses via file buffers
Ruby
16
star
20

apiculture

Honey-tasting REST API toolkit for Sinatra
Ruby
12
star
21

WeScanAndroid

The Android Implementation of WeScan https://github.com/wetransfer/wescan
11
star
22

wetransfer_ruby_sdk

A Ruby SDK for WeTransfer's Public API
Ruby
11
star
23

richurls

Service which enriches URLs fast and cheap
Ruby
10
star
24

measurometer

Minimum viable API for ⏱📈 in 💎 libraries
Ruby
10
star
25

interval_response

Serve partial (Range) HTTP responses from 💎 applications
Ruby
9
star
26

activerecord_autoreplica

Simple read replica proxy for ActiveRecord
Ruby
7
star
27

wt-api-docs

Official documentation for WeTransfer's Public API
Ruby
7
star
28

product-engineering-career-framework

This repo holds discussion and the permalink to WeTransfer's internal Product Engineering Career Framework.
7
star
29

hash_tools

Do useful things to Ruby Hashes, without monkey-patches
Ruby
5
star
30

rational_choice

A fuzzy logic gate
Ruby
4
star
31

Xperiments

Simple A/B testing tool. Includes CMS and an experimentation engine.
JavaScript
4
star
32

amplitude-client-node

Node.js client for the Amplitude API
TypeScript
4
star
33

Danger

Contains our global Danger file.
Ruby
3
star
34

very_tiny_state_machine

For when you need it even smaller than you think you do
Ruby
3
star
35

eslint-config-wetransfer

ESLint shareable config used for WeTransfer JS projects.
JavaScript
3
star
36

wetransfer_style

At WeTransfer we code in style. This is our coding style for Ruby development.
Ruby
3
star
37

runaway

Controls child process execution, with hard limits on maximum runtime and heartbeat timings
Ruby
2
star
38

megabytes

Tiny byte size formatter
Ruby
1
star
39

Actions-Experiment

A Repo to experiment with github actions to build previews for the frontend.
JavaScript
1
star
40

strict_request_uri

Truncate and cleanup URLs with junk in Rack
Ruby
1
star
41

tdd-workshop

Repo to host the code for the TDD workshop
Kotlin
1
star
42

departure

WeTransfer's fork of departurerb/departure, to accelerate Rails 5.2 support. See the link for the original repo:
Ruby
1
star
43

sanitize_user_agent_header

Ensure User-Agent gets correctly UTF-8 encoded
Ruby
1
star
44

ks

Keyword-initialized Structs
Ruby
1
star
45

format_parser_pdf

file metadata parsing, for PDF
Ruby
1
star
46

EmbedExamples

Examples on how to use WeTransfer Embed
Ruby
1
star
47

simple_compress

GZIP compression to and from a String
Ruby
1
star