我们提供了一个界面代理列表,以便进行自定义和监控。
点击操作通知代理
您可以传入代理实例 (SearchContentClickNotificationDelegate
) 来响应界面点击操作。
Swift
...
class PartnerSearchContentClickNotificationDelegate: SearchContentClickNotificationDelegate {
func searchContentClicked(clickProperties: SearchContentClickProperties) {
...
}
}
...
let delegate: PartnerSearchContentClickNotificationDelegate? = PartnerSearchContentClickNotificationDelegate()
...
let customizationOptions = SearchSuggestionsViewOptions()
customizationOptions.clickNotificationDelegate = delegate
...
Objective-C
/// In the .h header file.
#import "googlemac/iPhone/Shared/SearchInApps/SDK/SourcesLib-Swift.h"
...
@interface PartnerSearchContentClickNotificationDelegate: NSObject<SearchContentClickNotificationDelegate>
@end
/// In the .m file.
#import "googlemac/iPhone/Shared/SearchInApps/SDK/SourcesLib-Swift.h"
...
@interface PartnerSearchContentClickNotificationDelegate () <SearchContentClickNotificationDelegate>
@end
@implementation PartnerSearchContentClickNotificationDelegate
- (void)searchContentClickedWithClickProperties: (SearchContentClickProperties *) properties
{
...
}
@end
...
PartnerSearchContentClickNotificationDelegate *_partnerSearchContentClickNotificationDelegate = [[PartnerSearchContentClickNotificationDelegate alloc] init];
...
SearchSuggestionsViewOptions *customizationOptions = [[SearchSuggestionsViewOptions alloc] init];
customizationOptions.clickNotificationDelegate = _partnerSearchContentClickNotificationDelegate;
...