Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ads): ANLSPI-22249 CAID support #336

Merged
merged 2 commits into from
Nov 18, 2024
Merged

feat(ads): ANLSPI-22249 CAID support #336

merged 2 commits into from
Nov 18, 2024

Conversation

YoloMao
Copy link
Collaborator

@YoloMao YoloMao commented Oct 17, 2024

支持广协 CAID 归因,需要在 SDK 初始化时,通过配置项 configuration.CAIDFetchBlock 传入获取 CAID 操作(需保证每次获取最新 CAID),并在 block 最后调用 didCompleteBlock 传入获取到的 CAID JSON 字符串,示例如下:

configuration.CAIDFetchBlock = ^(void (^ _Nonnull didCompleteBlock)(NSString * _Nonnull)) {
    // 模拟异步请求
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        NSString *caid =  @"["
        @"{\"caid\":\"507b36cb169864220bc22a8c522532fa\",\"version\":\"20220111\"},"
        @"{\"caid\":\"e18a100398425c5026591525e844f7a7\",\"version\":\"20230330\"}"
        @"]";
        didCompleteBlock(caid);
    });
};

如果未调用 didCompleteBlock 或超时 5 秒,则此前生成的 ACTIVATE 事件将使用此前获取到的缓存在内存中的 CAID 事件属性(如果有)

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 90.43478% with 11 lines in your changes missing coverage. Please review.

Project coverage is 83.07%. Comparing base (9b668ef) to head (f60ce8d).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
Modules/Advertising/CAID/GrowingCAIDFetcher.m 90.09% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #336      +/-   ##
==========================================
+ Coverage   82.21%   83.07%   +0.85%     
==========================================
  Files         136      137       +1     
  Lines       10182    10297     +115     
==========================================
+ Hits         8371     8554     +183     
+ Misses       1811     1743      -68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@YoloMao YoloMao changed the title feat(ads): CAID support feat(ads): ANLSPI-22249 CAID support Oct 21, 2024
@YoloMao YoloMao merged commit 4c5bbba into master Nov 18, 2024
16 checks passed
@YoloMao YoloMao deleted the feat/caid_support branch November 18, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants