是否有任何Appentive回调方法可以通知我们发生了什么?
例如,
[[ATConnect sharedConnection] engage:@"completed_level" fromViewController:viewController];
告诉Appentive发生了事件,现在Appentive可能会显示交互。
在事件被记录后,我想知道是否:
- 将显示一个交互
- 正在显示交互
- 交互已完成
目前有办法做到这一点吗?
engage:fromViewController:
的返回值指示是否为事件显示交互:
BOOL interactionShown = [[ATConnect sharedConnection] engage:@"event" fromViewController:vc];
if (interactionShown) {
// Interaction (Survey, Rating Prompt, etc) was shown.
} else {
// No interaction was shown.
}
您还可以使用方法willShowInteractionForEvent:
来了解下次参与活动时是否会显示交互:
BOOL availableSurvey = [[ATConnect sharedConnection] willShowInteractionForEvent:@"show_survey_event"];
if (availableSurvey) {
// Show "Show Survey" button.
} else {
// Hide "Show Survey" button.
}
Appentive还发布了一些通知,您可以通过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;
最后,我们正在这个领域开发一些新功能。我将在这些答案可用时更新此答案。