The SlackFeedback Framework is a Swift package that makes it easy for iOS app users to send feedback to a specific Slack channel. It uses Slack's Incoming Webhooks API to send feedback as a message to a designated channel.
You can easily install SlackFeedback using Swift Package Manager. Follow these steps to add it to your Xcode project:
- Open your Xcode project and navigate to File -> Swift Packages -> Add Package Dependency...
- In the search bar, enter
https://github.com/vikram-86/SlackFeedback
. - Select the latest version of the package and click Next.
- Select the target where you want to use the framework and click Finish.
Before you can use SlackFeedback, you need to create a Slack Webhook URL. Follow these steps to create a Webhook URL:
- Go to your Slack account and navigate to the channel where you want to receive feedback.
- Click the gear icon next to the channel name and select "Add apps".
- Search for "Incoming Webhooks" and click "Add to Slack".
- Follow the instructions to configure the Webhook URL. Make sure to select the channel where you want to receive feedback.
In the Swift file where you want to use SlackFeedback, import the package:
import SlackFeedback
Configure it with the webhook URL
let webhookURL = "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
let config = SlackConfiguration(webhook: webhookURL)
let slackFeedback = SlackFeedback(configuration: config)
To send feedback from your app to Slack, use the sendFeedback
function:
let feedback = "I found a bug in the app!"
slackFeedback.sendFeedback(feedback: feedback)
The result of the feedback sent using SlackFeedback will appear in your designated Slack channel as a message with the following format: For example:
For a sample implementation of SlackFeedback, check out our demo app. The demo app demonstrates how to use SlackFeedback to send feedback to a Slack channel.
To run the demo app, follow these steps:
- Clone the repository.
- Open the
SlackFeedbackDemo.xcodeproj
file in Xcode. - Build and run the app on a simulator or device.
- Enter your Webhook URL and send feedback.
We welcome contributions to the SlackFeedback Framework. To contribute, please follow these steps:
- Fork the repository and create a new branch for your changes.
- Make your changes and test them thoroughly.
- Create a pull request describing your changes.
The SlackFeedback Framework is released under the MIT license. See LICENSE
for details.