1

Are there any Apptentive callback methods which inform us what is happening?

For example,

[[ATConnect sharedConnection] engage:@"completed_level" fromViewController:viewController];

tells Apptentive an event has occured, and now Apptentive might display an interaction.

After an event is logged, I would like to know whether:

  • an interaction will be displayed
  • an interaction is displaying
  • interaction has been completed

Is there currently a way to do this?

amit
  • 1,373
  • 2
  • 16
  • 29

1 Answers1

1

The return value of engage:fromViewController: indicates whether or not an interaction was shown for the event:

BOOL interactionShown = [[ATConnect sharedConnection] engage:@"event" fromViewController:vc];
if (interactionShown) {
    // Interaction (Survey, Rating Prompt, etc) was shown.
} else {
    // No interaction was shown.
}

You can also use the method willShowInteractionForEvent: to know if an interaction will be shown the next time you engage an event:

BOOL availableSurvey = [[ATConnect sharedConnection] willShowInteractionForEvent:@"show_survey_event"];
if (availableSurvey) {
    // Show "Show Survey" button.
} else {
    // Hide "Show Survey" button.
}

Apptentive also posts some notifications that you can listen for and respond to via NSNotificationCenter:

/** Notification sent when Message Center unread messages count changes. */
extern NSString *const ATMessageCenterUnreadCountChangedNotification;

/** Notification sent when the user has agreed to rate the application. */
extern NSString *const ATAppRatingFlowUserAgreedToRateAppNotification;

/** Notification sent when a survey is shown. */
extern NSString *const ATSurveyShownNotification;

/** Notification sent when a survey is submitted by the user. */
extern NSString *const ATSurveySentNotification;

Finally, we are working some new features in this area. I will update this answer when those are available.

pkamb
  • 33,281
  • 23
  • 160
  • 191
  • It would be useful for me to know when an interaction is complete and the Apptentive rate dialog has closed. Awaiting your update to this answer. Thanks. – amit Oct 08 '14 at 06:23
  • @amit Would you mind emailing me? `peter & apptentive.com`. We'd like to discuss these upcoming features with some of the customers who will be using them to make sure they will meet your needs. – pkamb Oct 08 '14 at 18:19
  • @pkamb: I need to check if event dialog is currently on screen and based on this i will check some conditions. Is there any way to know instead of didShown or will show kind of functions? – Tarun Apr 09 '15 at 11:13