HBSupportController Class Reference

Inherits from NSObject
Declared in HBSupportController.h

Overview

The HBSupportController class in CepheiPrefs provides a factory that configures a TSContactViewController for immediate use. The TSContactViewController class, from TechSupport by ashikase, provides a text box for entering a message, as well as the ability to view or remove pre-defined attachments. After tapping the submit button, the information is provided to the next step, which most commonly is an email composer.

By providing a link instruction, you can have the message sent to a different email address or posted to a website. You can also provide one or more support instructions, which allow more files to be attached. For more information and for examples of TSContactViewController usage, refer to the demos directory in the TechSupport source.

A TSContactViewController should be pushed on your view controller stack; it should not be presented modally.

+ linkInstructionForEmailAddress:

Initialises a TSLinkInstruction for the provided email address.

+ (TSLinkInstruction *)linkInstructionForEmailAddress:(NSString *)emailAddress

Parameters

emailAddress

The email address to send an email to.

Return Value

A pre-configured instance of TSLinkInstruction.

Declared In

HBSupportController.h

+ supportViewControllerForBundle:

Initialises a TSContactViewController by using information provided by a bundle.

+ (TSContactViewController *)supportViewControllerForBundle:(NSBundle *)bundle

Parameters

bundle

A bundle included with the package.

Return Value

A pre-configured instance of TSContactViewController.

Discussion

Refer to supportViewControllerForBundle:preferencesIdentifier:linkInstruction:supportInstructions: for information on how the bundle is used.

Declared In

HBSupportController.h

+ supportViewControllerForBundle:preferencesIdentifier:

Initialises a TSContactViewController by using information provided by a bundle and references identifier.

+ (TSContactViewController *)supportViewControllerForBundle:(nullable NSBundle *)bundle preferencesIdentifier:(NSString *)preferencesIdentifier

Parameters

bundle

A bundle included with the package.

preferencesIdentifier

A preferences identifier that is used by the package.

Return Value

A pre-configured instance of TSContactViewController.

Discussion

Refer to supportViewControllerForBundle:preferencesIdentifier:linkInstruction:supportInstructions: for information on how the bundle and preferences identifier are used.

Declared In

HBSupportController.h

+ supportViewControllerForBundle:preferencesIdentifier:linkInstruction:supportInstructions:

Initialises a TSContactViewController by using information provided by either a bundle or a preferences identifier, and providing it a custom link instruction and support instructions.

+ (TSContactViewController *)supportViewControllerForBundle:(nullable NSBundle *)bundle preferencesIdentifier:(nullable NSString *)preferencesIdentifier linkInstruction:(nullable TSLinkInstruction *)linkInstruction supportInstructions:(nullable NSArray<TSIncludeInstruction*> *)supportInstructions

Parameters

bundle

A bundle included with the package.

preferencesIdentifier

The preferences identifier of the package, if it’s different from the package identifier that contains the bundle.

linkInstruction

The link instruction to use, or nil.

supportInstructions

Support instructions to use in combination with the built-in ones defined by HBSupportController, or nil.

Return Value

A pre-configured instance of TSContactViewController.

Discussion

The bundle may set the key HBPackageIdentifier in its Info.plist, containing the package identifier to gather information from. Otherwise, the dpkg file lists are searched to find the package that contains the bundle. The package’s name, identifier, and author will be used to fill out fields in the information that the user will submit.

Either a bundle or preferences identifier is required. If both are nil, an exception will be thrown. If the linkInstruction argument is nil, a TSLinkInstruction is derived from the Author field of the package’s control file. HBSupportController implicitly adds the user’s package listing (output of dpkg -l) and the preferences plist as attachments. To add more, provide an array of TSIncludeInstructions to the supportInstructions argument.

Declared In

HBSupportController.h