Clicky

iOS Dev Nugget 260 Include App Version and Device Name in Feedback/Support Email

.

Need to run a code review on your codebase? Hire me

In my apps, I include a button for users to send me feedback emails. I will pre-fill the email with a line like this:

For info/diagnostic purposes:
    MY_APP_NAME v1.0 build 101 on iPad Pro 9.7 Wifi + Cellular, iOS 10.0

This provides some basic information that can help me understand their issue or feedback better.

I generate this with code like this:

let appVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString")
let buildNumber = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion")
let osVersion = UIDevice.current.systemVersion
if let appVersion=appVersion, let buildNumber=buildNumber {
    let body = "For info/diagnostic purposes:\nMY_APP_NAME v\(appVersion) build \(buildNumber), iOS \(osVersion)"
    //Use body
}

If you want to include the device name (iPhone X, etc) property, you can use https://github.com/InderKumarRathore/DeviceGuru.

Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No

.

.

Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter

.

View archives of past issues