Swiftpack.co -  MartinMetselaar/vragen-sdk as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
MartinMetselaar/vragen-sdk
iOS SDK of Vragen. A way to survey your users while staying owner of the data.
.package(url: "https://github.com/MartinMetselaar/vragen-sdk.git", from: "1.0.0")

Vragen SDK

The easiest way to ask your users a few questions.

Example screenshot of a question

Installation

Swift Package Manager

Add the following as a dependency to your Package.swift.

.package(url: "https://github.com/MartinMetselaar/vragen-sdk.git", from: "1.0.0"),

Usage

The vragen-api contains a way to retrieve a survey and submit answers.

Setup

We first need to let the SDK know what the server of your vragen-api is and the token. This could for example be done in the application(_:didFinishLaunchingWithOptions:) or scene(_:willConnectTo:options:).

let server = URL(string: "https://vragenapi.example.org")!
let token = "customer-token-from-your-server"

VragenSDK.set(server: server, token: token)

NOTE: This token should be the CONSUMER_TOKEN. You should not publish (by using) your ADMIN_TOKEN because people could use it to edit and download your data.

The next step is to present the SurveyViewController which displays the survey.

let surveyId = UUID(uuidString: "your-uuid-survey-identifier")!
let userId = "user19302"
let controller = SurveyViewController(identifier: surveyId, userId: userId)
present(controller, animated: true, completion: nil)

NOTE: The userId parameter in SurveyViewController is optional. If you provide the userId you can connect multiple surveys from the same user together. If you only care about the answers and want the users to stay anonymous a nil provided userId will generate a new UUID for every time the user will answer a survey. Even when it is done twice.

You are done.

Custom interface

Want to create your own visual interface? You can use the vragen-sdk-network to implement your own interface.

GitHub

link
Stars: 1
Last commit: 49 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

Ask around
49 weeks ago

Releasing a visual interface to display users a survey

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics