nstack-io / nstack-ios-sdk

MIT License
5 stars 10 forks source link

Shake to give feedback #39

Open chriscombs opened 4 years ago

chriscombs commented 4 years ago

The feedback feature needs to be implemented. The DOT project implemented it manually, but it should be added as a feature to the SDK.

Users should be able to shake the phone to display a dialogue that allows them to enter feedback, which is then sent to the backend.

We should be able to disable this after the first prompt, in case the user doesn't want to send feedback.

chriscombs commented 4 years ago

To be added:

FeedbackManager, similar to ContentManager and ValidationManager etc. Ideally this would be a public protocol named FeedbackManager, with an internal class that conforms to it (similar to how we do Dependencies in our apps):

public protocol FeedbackManager { } internal class APIFeedbackManager: FeedbackManager { }

And in NStack.swift: public fileprivate(set) var feedbackManager: FeedbackManager?

in the start() function: feedbackManager = APIFeedbackManager(repository: repository)

This manager needs to be able to send feedback to the NStack API. This API call is already done in the DOT app, so it can mostly be copied from there. The API call should go into the Repository as a FeedbackRepository protocol (similar to the others).

From the Feedback manager, we should be able to send feedback manually by programmatically calling a sendFeedback function or something like that. Part 2 will be to also be able to shake the device to send feedback. This may interfere with the shake to edit translations feature, so we will need to come up with a solution for deciding which feature to use when shaking the device.