In-app feedback for Windows apps
In-app feedback allows you to include feedback, attach and annotate images/screenshots, include logs and diagnostics, and report a bug. Before you start integrating In-app Feedback, make sure that you have already integrated Apptics with your app.
Add WinUIAppticsFeedback(WinUI) / AppticsFeedback(UWP) library reference (dll) into your project from the downloaded Apptics dlls.
Show the feedback pop-up
You can show the default feedback pop-up using the below code.
For UWP apps
Copied await AppticsFeedBack.FeedbackHelper.ShowFeedbackPopup(Window.Current);
For WinUI apps
Copiedawait WinUIAppticsFeedback.FeedbackHelper.ShowFeedbackPopup(Window window);
You can customize the feedback pop-up by applying style to each element of the pop-up.
CopiedcustomStyle.PopupEntireBackground = new SolidColorBrush(Color.FromArgb(230, 167, 255, 123));
FeedbackHelper.FeedbackPopupCustomStyle = customStyle;
For UWP apps
CopiedAppticsFeedBack.UI.CustomStyle customStyle = new AppticsFeedBack.UI.CustomStyle();
For WinUI apps
CopiedWinUIAppticsFeedback.UI.CustomStyle customStyle = new WinUIAppticsFeedback.UI.CustomStyle();
Send the feedback API
If you want to use a custom feedback pop-up, build your own UI, and call the below function to send feedback using Apptics.
Copied bool result = await FeedbackHelper.SendFeedback("This is test feedback from Demo app, sending silent feedback from test app", FeedbackType.Report, true, true, files.ToList(), logStorageFiles);
Params:
- string - feedback message
- type - feedback type
- bool - should include diagnostic info
- bool - should include log
- list<StorageFiles> - bug images/screenshots
- list<StorageFiles> - log files
Set sender email id
You can set the sender email id for the feedback, if you want. If you do not set the sender email id, the feedback will be received as anonymous feedback in Apptics.
CopiedFeedbackHelper.SetSenderEmailId("abc@def.com");
To allow anonymous feedback
Enable the anonymous option so that the users can share their feedback anonymously.
CopiedFeedbackHelper.AllowAnonymousFeedBack = true;
Set support email id
Use the below to set the support email id.
CopiedFeedbackHelper.SetSupportEmailid("abc@def.com");
Set diagnose info
Use the below to set the diagnostic info.
CopiedDictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("BatteryPercentage", PowerManager.RemainingChargePercent.ToString());
keyValuePairs.Add("InternetAvailable", NetworkInterface.GetIsNetworkAvailable().ToString());
FeedbackHelper.SetDiagnoseInfo(keyValuePairs.FromDictionaryToJson());
Alert anonymous feedback
You can alert the users if they choose to share the feedback anonymously.
CopiedFeedbackHelper.AlertUserIfAnonymous = true;
Set log location
By default, feedback logs are written in "AppData\Local\Packages\your.package.name\LocalState\Apptics\AppticsFeedbackLogs".
You can change the location where the feedback logs should be written. You can set your folder/location.
For example - "AppData\Local\Packages\your.package.name\LocalState\DemoFolder\AppticsFeedbackLogs"
CopiedFeedbackHelper.SetLogLocation("DemoFolder/Feedbacklogs");
Clear log / diagnose info
You can clear the diagnose info or the log files by the using below.
CopiedFeedbackHelper.ClearDiagnoseInfo();
await FeedbackHelper.ClearFeedbackLogs();
Write log
Use the below to write feedback logs directly to Apptics.
CopiedFeedbackHelper.AddFeedbackLog("some log printed for reference");