iphone - How to add survey monkey ios sdk inside my ios application? -
how integrate surveymonkey ios sdk inside ios app?
viewcontroller.h have tried following code in project;
#import <uikit/uikit.h> #import <surveymonkeyiossdk/surveymonkeyiossdk.h> @interface viewcontroller : uiviewcontroller @property (nonatomic, strong) smfeedbackviewcontroller * feedbackcontroller; @end viewcontroller.m #import "viewcontroller.h" //static nsstring *sample_survey_hash=@"e7bvbydjgchg6vyr2qyrzxkq"; //#define sample_survey_hash @"43w3ikqgkvjcvrlvko8bxt_2frxe_2bvhergqp5w2r5tc2c_3d" #define feedback_question_id @"813797519" #define feedback_five_stars_row_id @"9082377273" #define feedback_four_stars_row_id @"9082377274" #define sample_app @"survey_sample" #define survey_hash @"lbqk27g" #define app_id @"dh9k6dy" @interface viewcontroller () <smfeedbackdelegate, uialertviewdelegate> @property (weak, nonatomic) iboutlet uibutton *takesurveybutton; @property (weak, nonatomic) iboutlet uilabel *statuslabel; //#define sample_survey_hash e7bvbydjgchg6vyr2qyrzxkq; @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; _feedbackcontroller = [[smfeedbackviewcontroller alloc] initwithsurvey:survey_hash]; _feedbackcontroller.delegate = self; [_feedbackcontroller scheduleinterceptfromviewcontroller:self withapptitle:@"survey_sample"]; [_feedbackcontroller presentfromviewcontroller:self animated:yes completion:nil]; // additional setup after loading view, typically nib. } - (ibaction)didtaptakesurvey:(id)sender { } - (void)respondentdidendsurvey:(smrespondent *)respondent error:(nserror *) error { if (respondent != nil) { nslog(@"val %@",respondent); smquestionresponse * questionresponse = respondent.questionresponses[0]; nslog(@"val new %@",questionresponse.questionid); nsstring * questionid = questionresponse.questionid; if ([questionid isequaltostring:feedback_question_id]) { smanswerresponse * answerresponse = questionresponse.answers[0]; nsstring * rowid = answerresponse.rowid; if ([rowid isequaltostring:feedback_five_stars_row_id] || [rowid isequaltostring:feedback_four_stars_row_id]) { [self showalertwithbody:nslocalizedstring(@"please rate in app store!", @"") hasratebutton:yes]; } else { [self showalertwithbody:nslocalizedstring(@"we'll address issues encountered possible!", @"") hasratebutton:no]; } } } else { nslog(@"error %@",error); } } #pragma mark - uialertviewdelegate - (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { if (buttonindex == 0) { } else if(buttonindex == 1) { nsstring *appstoreurl = [nsstring stringwithformat:@"itms-apps://itunes.apple.com/app/id%@?mt=8", app_id]; [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:appstoreurl]]; } } - (void) showalertwithbody:(nsstring *)body hasratebutton:(bool)hasratebutton { uialertview * alert =[[uialertview alloc ] initwithtitle:nslocalizedstring(@"thanks feedback!", @"heading feedback prompt") message:body delegate:self cancelbuttontitle: nslocalizedstring(@"cancel", @"title of cancel button on app store rating prompt") otherbuttontitles: nil]; if (hasratebutton) { [alert addbuttonwithtitle:nslocalizedstring(@"rate us", @"title of rate button on app store rating prompt")]; } [alert show]; } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } @end still not able customize code provided in github. please if have implemented in ios app.
apologies swati & horizon_net -- surveymonkey ios sdk has not been officially released yet -- it's available in private beta. i'm developer android , ios sdks , love feedback. so, if you'd in beta, fill out this form.
we'll update thread when sdk has been publicly released, patience.
Comments
Post a Comment