New delegate protocol for letting the app know what's up #68

Merged
merged 1 commit into from Sep 25, 2012

Projects

None yet

4 participants

@rhaining
Contributor
  • added a delegate protocol to let the app know when things happen: alerts displayed, opted to rate/remind later/decline
Robert Haining added a delegate protocol to let the app know when things happen: ale…
…rt's displayed, opted to rate/remind later/decline
e475e36
@arashpayan arashpayan merged commit 5fba20e into arashpayan:master Sep 25, 2012
@arashpayan
Owner

Thanks, @rhaining.

@kapsolas
kapsolas commented Oct 9, 2012

I've tried to use the delegate, but it constantly fails. I didn't try to debug yet.

The code added to my application is:

[Appirater setDelegate:self];
[Appirater setAppId:APPIRATER_APP_ID_HERE];
[Appirater setDaysUntilPrompt:1];
[Appirater setUsesUntilPrompt:10];
[Appirater setSignificantEventsUntilPrompt:-1];
[Appirater setTimeBeforeReminding:2];
[Appirater appLaunched:YES];
[Appirater setDebug:YES];

The application crashes at in the sharedInstance method at the line where appirater.delegate is set with a SIGABRT.

appirater.delegate = _delegate;

@rhaining
Contributor

Hmm what's the value of _delegate?

I've got it set to my application delegate, which implements the appirater delegate protocol. works on my end at least :-/

-rob

@AvinashP
AvinashP commented Nov 8, 2012

Its not working for me too. I have set delegate to my App delegate object which implements AppiraterDelegate. Crashes with below error.

[Appirater setDelegate:self];
[Appirater setAppId:@"My_APP_ID"];
[Appirater setDaysUntilPrompt:0];
[Appirater setUsesUntilPrompt:3];
[Appirater setSignificantEventsUntilPrompt:-1];
[Appirater setTimeBeforeReminding:2];
[Appirater setDebug:YES];
[Appirater appLaunched:YES];

***Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Appirater setDelegate:]: unrecognized selector sent

@rhaining
Contributor
rhaining commented Nov 8, 2012

@AvinashP make sure you've updated Appirater.h, Appirater.m, & added AppiraterDelegate.h to your project. The 'delegate' is a property on the Appirater class. You'll also need to implement the AppiraterDelegate in your App Delegate object:

@interface MyAppDelegate : UIResponder <UIApplicationDelegate, AppiraterDelegate>{

-rob

@AvinashP

@rhaining I had done all these changes but still it was crashing. I think the issue was related to arc. I changed the delegate property from strong to nonatomic,assign and synthesized it in Appirator.m. It worked after that.

  • avinash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment