Question

Calling the following method in the Apptentive API is crashing due to an unrecognized selector.

ATAppRatingFlow *ratingFlow = [ATAppRatingFlow sharedRatingFlowWithAppID:kApptentiveAppID];
[ratingFlow appDidLaunch:YES viewController:self.navigationController];

Which produces the following error log:

*2013-10-03 10:32:08.089 YourApp[39841:a0b] -[ATAppRatingFlow appDidLaunch:viewController:]: unrecognized selector sent to instance 0xc5aee60*
*2013-10-03 10:32:08.144 YourApp[39841:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ATAppRatingFlow appDidLaunch:viewController:]: unrecognized selector sent to instance 0xc5aee60'*
**** First throw call stack:*
*(*
* 0 CoreFoundation 0x0257f5e4 __exceptionPreprocess + 180*
* 1 libobjc.A.dylib 0x022ee8b6 objc_exception_throw + 44*
* 2 CoreFoundation 0x0261c903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275*
* 3 CoreFoundation 0x0256f90b ___forwarding___ + 1019 
Was it helpful?

Solution

Previous versions of Apptentive used the following 3 methods to show the ratings flow:

- (void)appDidLaunch:(BOOL)canPromptForRating viewController:(UIViewController *)viewController;

- (void)appDidEnterForeground:(BOOL)canPromptForRating viewController:(UIViewController *)viewController;

- (void)userDidPerformSignificantEvent:(BOOL)canPromptForRating viewController:(UIViewController *)viewController;

They have been replacedby a single method in newer versions of the app:

- (void)showRatingFlowFromViewControllerIfConditionsAreMet:(UIViewController *)viewController;

Call it like so:

[[ATAppRatingFlow sharedRatingFlow] showRatingFlowFromViewControllerIfConditionsAreMet:viewController];

The showRatingFlowFromViewControllerIfConditionsAreMet method will only show the ratings flow if your rating conditions (as set on the Apptentive website) have been met at that point by the user.

  • X days after install
  • Y number of uses
  • Z significant events
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top