Before cutting our first release I'd love to see a couple people try it in their own apps! This way any issues can be surfaced and the Readme can be polished up with real integration steps.
How can you help?
- Add this to a project of yours, or if you have nothing to add it to, use the example project.
- Use something like Licecap to create an animated GIF of you using it in the simulator or a real device.
- Create a PR adding the file to the repo. Feel free to add it to the web site (docs folder) or the Readme as well.
To install it, simply add the following line to your Podfile:
pod 'GitYourFeedback', :git => 'https://github.com/gabek/GitYourFeedback'
Or, if you’re using Carthage, add GitYourFeedback to your Cartfile:
github "gabek/GitYourFeedback"
- Generate a Personal Access Token for the GitHub user who will be saving the issues in your repo.
- In your project's
Info.plist
add a key of NSPhotoLibraryUsageDescription
with a string explaining that your use of the photo library is for submitting screenshots. This is user-facing so use your own judgement.
- In your AppDelegate, or some other long-lived controller:
Create a struct that adheres to the FeedbackOptions
protocol. You can put whatever you want in here, but really it should be as simple as:
struct MyFeedbackReportingOptions: FeedbackOptions {
// The GitHub personal access token for the below user
var token: String = "abc123"
/// The user that generated the above Personal Access Token and has access to the repository.
var user: String = "repoMan"
/// The Github repository in username/repo format where the issue will be saved.
var repo: String = "repoman/myRepository"
}
And then you can use it in the FeedbackReporter
let feedbackReporter = FeedbackReporter(options: MyFeedbackReportingOptions())
You also need to implement FeedbackManagerDatasource
in order to tell the FeedbackManager where to upload screenshots. The simplest implementation would be something like:
func uploadUrl(_ completionHandler: (String) -> Void) {
let filename = String(Date().timeIntervalSince1970) + ".jpg"
let url = "https://www.googleapis.com/upload/storage/v1/b/mybucketname.appspot.com/o?name=\(filename)"
completionHandler(url)
}