user1851271
user1851271

Reputation: 61

appirator setSignificantEventsUntilPrompt iOS

Can we use two different setSignificantEventsUntilPrompt within one application?Say for example I have two category(awesome,better)named button.I need to show appRating AFTER FIRST SUCCESSFUL HIT of AWESOMEbutton or 2 SUCCESSFUL HITS OF BETTERbutton.Is this possible?

Upvotes: 0

Views: 299

Answers (1)

Fahad
Fahad

Reputation: 17

You can modify Appirater as per your need. One way of achieving what you are looking for is by creating another routine in Appirater class that increments the significant event by 'X' number

Here is how I do.

In Appirater.h, Declare a new routine for tracking more significant events

  1. (void)userDidMoreSignificantEvent:(BOOL)canPromptForRating;

In Appirater.m Modify the following

  1. Modify - (void)incrementSignificantEventCount to accept a parameter - (void)incrementSignificantEventCount:(int)count

  2. Inside incrementSignificantEventCount, replace sigEventCount++; with sigEventCount = sigEventCount + count;

  3. Modify incrementSignificantEventAndRate:(BOOL)canPromptForRating to accept another parameter -(void)incrementSignificantEventAndRate:(BOOL)canPromptForRating withCount:(int)count

  4. Inside incrementSignificantEventAndRate, replace [self incrementSignificantEventCount]; with [self incrementSignificantEventCount:count];

  5. Replace userDidSignificantEvent: routine with the following code

    • (void)userDidSignificantEvent:(BOOL)canPromptForRating { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ [[Appirater sharedInstance] incrementSignificantEventAndRate:canPromptForRating withCount:1]; }); }
  6. Define new routine to track more significant event

    • (void)userDidMoreSignificantEvent:(BOOL)canPromptForRating { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ [[Appirater sharedInstance] incrementSignificantEventAndRate:canPromptForRating withCount:2]; }); }

Now you will be able to use methods,

[Appirater userDidSignificantEvent:YES] to increment by 1

[Appirater userDidMoreSignificantEvent:YES] to increment by 2

Upvotes: 1

Related Questions