Inherits from UIViewController
Declared in SMFeedbackViewController.h
SMFeedbackViewController.m

Overview

Use the SMFeedbackViewController class to present a survey to the user.

Use the properties and methods defined in this class to set the URL and delegate. You must set a delegate in order to respond to the respondentDidEndSurvey event. The delegate should conform to the FeedbackDelegate protocol.

Other implementation details, such as how and when to display the SMFeedbackViewController, are left up to you.

Properties

cancelButtonTintColor

The color of the cancel button on the SMFeedbackViewController

@property (nonatomic, strong) UIColor *cancelButtonTintColor

Declared In

SMFeedbackViewController.h

delegate

The receiver’s delegate or nil if it doesn’t have a delegate.

@property (nonatomic, weak) id<SMFeedbackDelegate> delegate

Declared In

SMFeedbackViewController.h

Instance Methods

initWithSurvey:

Initialize the feedback view controller with the collectorHash from your Mobile SDK Collector

- (id)initWithSurvey:(NSString *)collectorHash

Parameters

collectorHash

The collector hash that points to your Mobile SDK Collector

Declared In

SMFeedbackViewController.h

initWithSurvey:andCustomVariables:

PLATINUM ONLY: Initialize the feedback view controller with the collectorHash from your Mobile SDK Collector and any custom variables you’ve set up in Create

- (id)initWithSurvey:(NSString *)collectorHash andCustomVariables:(NSDictionary *)customVariables

Parameters

collectorHash

The collector hash that points to your Mobile SDK Collector

customVariables

The dictionary of custom variables you wish to supply along with the user’s response to your survey

Declared In

SMFeedbackViewController.h

presentFromViewController:animated:completion:

Display the SMFeedbackViewController to the user.

- (void)presentFromViewController:(UIViewController *)viewController animated:(BOOL)flag completion:(void ( ^ ) ( void ))completion

Parameters

viewController

The view controller from which to launch the SMFeedbackViewController

flag

Pass YES to animate the presentation; otherwise, pass NO.

completion

The block to execute after the presentation finishes. This block has no return value and takes no parameters. You may specify nil for this parameter.

Declared In

SMFeedbackViewController.h

scheduleInterceptFromViewController:alertTitle:alertBody:positiveActionTitle:cancelTitle:afterInstallInterval:afterAcceptInterval:afterDeclineInterval:

Display the intercept UIAlertView to the user - asking them to give feedback on your app. Supply an alert title and body for the UIAlertView prompt, as well as time intervals (in seconds) to wait before displaying the prompt (i.e. after app install, after consents to take the survey, and after the user declines to take the survey)

- (void)scheduleInterceptFromViewController:(UIViewController *)viewController alertTitle:(NSString *)alertTitle alertBody:(NSString *)alertBody positiveActionTitle:(NSString *)positiveActionTitle cancelTitle:(NSString *)cancelTitle afterInstallInterval:(double)afterInstallInterval afterAcceptInterval:(double)afterAcceptInterval afterDeclineInterval:(double)afterDeclineInterval

Parameters

viewController

The view controller from which to launch the SMFeedbackViewController

alertTitle

The title of the UIAlertView prompt

alertBody

The body of the UIAlertView prompt

positiveActionTitle

The title of the positive action button on the UIAlertView prompt

cancelTitle

The title of the cancel button on the UIAlertView prompt

afterInstallInterval

The amount of time (in seconds) to delay before first prompting the user to give feedback after they install your app.

afterAcceptInterval

The amount of time (in seconds) to wait before prompting the user to give feedback again after they consent to take your survey.

afterDeclineInterval

The amount of time (in seconds) to wait before prompting the user to give feedback again after they decline to take your survey.

Declared In

SMFeedbackViewController.h

scheduleInterceptFromViewController:withAppTitle:

Display the intercept UIAlertView to the user - asking them to give feedback on your app. By default, the UIAlertView prompt will display 3 days after app install. If the user declines to take the survey, they will be prompted again in 3 weeks. If the user consents to take the survey, they’ll be prompted again in 3 months.

- (void)scheduleInterceptFromViewController:(UIViewController *)viewController withAppTitle:(NSString *)appTitle

Parameters

viewController

The view controller from which to launch the SMFeedbackViewController

appTitle

The title of your app – used in the title of the UIAlertView (e.g. Are you enjoying the [App Title] app?)

Declared In

SMFeedbackViewController.h