简体   繁体   中英

appirator setSignificantEventsUntilPrompt iOS

我们可以用两种不同的setSignificantEventsUntilPrompt一个应用程序中?例如说我有两个类别(真棒,更好)命名button.I需要出示appRating后的第一次成功的HIT AWESOME按钮或2次成功命中BETTER button.Is这可能吗?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM