diff --git a/SimpleSurvey/Simple Survey/ViewController.m b/SimpleSurvey/Simple Survey/ViewController.m index 940fb74..eaf4615 100644 --- a/SimpleSurvey/Simple Survey/ViewController.m +++ b/SimpleSurvey/Simple Survey/ViewController.m @@ -11,8 +11,8 @@ #define SAMPLE_APP @"Sample App" #define SURVEY_HASH @"LBQK27G" -//Set to Angry Birds -- change to your app -#define APP_ID @"343200656" +//Set to Angry Birds 2 -- change to your app +#define APP_ID @"880047117" @interface ViewController () @property (nonatomic, strong) SMFeedbackViewController * feedbackController; @@ -25,20 +25,29 @@ @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; - /* - * Initialize your SMFeedbackViewController like this, pass the survey code from your Mobile SDK Collector on SurveyMonkey.com - */ - _feedbackController = [[SMFeedbackViewController alloc] initWithSurvey:SURVEY_HASH]; - /* - * Setting the feedback controller's delegate allows you to detect when a user has completed your survey and to - * capture and consume their response in the form of an SMRespondent object - */ - _feedbackController.delegate = self; + [self getFeedbackController]; [[UINavigationBar appearance] setTintColor:[UIColor greenColor]]; [_feedbackController scheduleInterceptFromViewController:self withAppTitle:SAMPLE_APP]; } + - (IBAction)didTapTakeSurvey:(id)sender { - [_feedbackController presentFromViewController:self animated:YES completion:nil]; + SMFeedbackViewController *feedbackViewController = [self getFeedbackController]; + [feedbackViewController presentFromViewController:self animated:YES completion:nil]; +} + +- (SMFeedbackViewController *)getFeedbackController { + if (_feedbackController == nil) { + /* + * Initialize your SMFeedbackViewController like this, pass the survey code from your Mobile SDK Collector on SurveyMonkey.com + */ + _feedbackController = [[SMFeedbackViewController alloc] initWithSurvey:SURVEY_HASH]; + /* + * Setting the feedback controller's delegate allows you to detect when a user has completed your survey and to + * capture and consume their response in the form of an SMRespondent object + */ + _feedbackController.delegate = self; + } + return _feedbackController; } - (void)respondentDidEndSurvey:(SMRespondent *)respondent error:(NSError *) error { diff --git a/SurveyMonkeyiOSSDK.framework/Versions/A/Headers/JSONSerializable.h b/SurveyMonkeyiOSSDK.framework/Versions/A/Headers/JSONSerializable.h deleted file mode 100644 index fb59bad..0000000 --- a/SurveyMonkeyiOSSDK.framework/Versions/A/Headers/JSONSerializable.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (C) SurveyMonkey - */ - -#import -/** Protocol that describes behavior for Json serialization. */ -@protocol JSONSerializableProtocol - -/** Retrieves the relevant info from the dictionary. */ -- (void)readFromJsonDictionary:(NSDictionary *) dictionary; - - -@optional -/** Turn this object into a JSON Dictionary */ -- (NSDictionary *)toJson; - -@end diff --git a/SurveyMonkeyiOSSDK.framework/Versions/A/SurveyMonkeyiOSSDK b/SurveyMonkeyiOSSDK.framework/Versions/A/SurveyMonkeyiOSSDK index 394af00..3355f17 100644 Binary files a/SurveyMonkeyiOSSDK.framework/Versions/A/SurveyMonkeyiOSSDK and b/SurveyMonkeyiOSSDK.framework/Versions/A/SurveyMonkeyiOSSDK differ diff --git a/surveymonkey-ios-sdk.podspec b/surveymonkey-ios-sdk.podspec index 9a24c7e..1176d68 100644 --- a/surveymonkey-ios-sdk.podspec +++ b/surveymonkey-ios-sdk.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "surveymonkey-ios-sdk" - s.version = "2.0.5" + s.version = "2.0.6" s.summary = "The SurveyMonkey Mobile Feedback SDK for iOS" s.homepage = "https://github.com/SurveyMonkey/surveymonkey-ios-sdk" s.license = 'MIT'