Git Product home page Git Product logo

feedbackskit's Introduction

FeedbacksKit

A simple user feedback form right into your app.

Submit user feedbacks to your own database, or use the provided Notion service to store feedbacks to a Notion database.

This is an MVP, feel free to improve it.

Media

video.mp4

Usage

Check out the demo project.

View

Simply present the FeedbackForm to the user. The form is already wrapped in a NavigationView.

Button("Send feedback") {
    showFeedbackForm = true
}
.sheet(isPresented: $showFeedbackForm) {
    FeedbackForm(service: notionSubmitService)
}

You can add you own title by passing a config parameter.

FeedbackForm(
    service: notionSubmitService,
    config: .init(title: "My custom title")
)

Submission

Feedbacks are submitted with using a SubmitService. You can define your own SubmitService by providing a object that conforms to the protocol.

public protocol SubmitService {
    func submit(formData: FeedbackFormData) async throws
}

A default implementation using Notion API is also available.

How to use the NotionSubmitService.

  • Create a new integration on your Notion account. This service requires only insert capabilities. Save the Internal Integration Token for later.
  • On your Notion workspace, create a new full page database, with the title property beeing called email

Screenshot 2023-03-04 at 16 31 38

  • Tap the "..." button on the top right of the page, then "+ Add connections". Your new connection should appear here, select it.

Screenshot 2023-03-04 at 16 34 12

  • In your code, instanciate a NotionSubmitService and pass it to the FeedbackForm View. You will need :
    • Your Internal Integration Token from the integration page.
    • Your database ID. To find it, copy your database link from the share button on the Notion page. The database ID is the between your user name and the fist ?: https://www.notion.so/your-name/your-database-id?v=...
    • The current notion API version. You can find it on the Notion API Documentation
let notionSubmitService = NotionSubmitService(
    apiKey: "your-secret",
    databaseId: "your-database-id",
    notionVersion: "2022-06-28"
)

feedbackskit's People

Contributors

kaww avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.