AQSEvent 的聚合器
首先,派生 AQSEventAggregator
类,
@interface AppEventAggregator
@end
@implementation
// @override
- (NSArray *)whiteListForEvents {
return @{
@"app/run_at_first",
@"app/did_become_active",
@"app/permission/photo_library/granted"
};
}
- (void)didReceiveEvent:(NSString *)eventName args:(NSDictionary *)eventArgs {
// Do something when it receives AQSEvent.
// Typically, send the event to tracking services such as Google Analytics, MixPanel etc.
}
@end
然后按照以下步骤开始聚合。
[[AQSEventAggregator sharedAggregator] startAggregation];
为了更精细地处理事件,覆盖以下方法。 (这些功能目前不受支持。)
// @optional
- (NSArray *)blackListForEvents;
// @optional
- (BOOL)testForEvent:(NSString *)eventName args:(NSDictionary *)eventArgs;