|
JubeatPlus 3.9.11
|
The recommend network's advert-cache store. More...
#include <RecommendAdCache.h>


Class Methods | |
| (void) | + getAllAdStatus |
| Refresh the aggregated advert-status table. | |
| (void) | + getAllAdDataWithCallBack: |
| Fetch every advert-data record through the recommend session, then report completion. | |
| (void) | + clearAllAdData |
Clear the cached aggregated advert-data record from NSUserDefaults. | |
| (nullable NSDate *) | + getAllAdDataInfoExpire |
| The cached advert-data expiry date. | |
| (void) | + clearAllAdDataInfoExpire |
| Clear the in-memory expiry record for the cached advert data. | |
| (void) | + getBannerDataWithList:max: |
| Pre-load the banner images for a list of advert records, up to a success quota. | |
| (BOOL) | + getResourceDataWithList: |
| Fetch and cache every resource file in a list. | |
| (void) | + getCacheDataWithList:max: |
| Pre-load the cached-data (movie) files for a list, up to a success quota. | |
| (void) | + getTemplateFiles |
| Download and cache every advert template file listed in the SDK template list. | |
| (void) | + saveTemplateData:path:file: |
Write template data into the contents folder, creating the intermediate directories named by path. | |
| (nullable NSError *) | + createHtmlWithAdModel:adLocation:verticalAlign:impressionId: |
| Create the cached HTML advert body for an advert model, writing it to the contents folder. | |
| (nullable NSString *) | + convertHtmlWithAdModel:adLocation:adType:verticalAlign:bannerList:impressionId:selfList:comResData: |
| Fill the advert-type HTML template with the banner list, self list, common-resource payload, and environment placeholders. | |
| (void) | + setTargetUrl:adType:adModel:adLocation: |
| Build and store the click-through target URL on every banner record. | |
| (void) | + setAdDisplayCountWithAdId: |
| Increment both the daily and the total display counters for an advert identifier. | |
| (void) | + setAdDisplayCountDailyWithAdId: |
| Increment the daily display counter for an advert identifier, resetting it at the start of a new local day. | |
| (void) | + setAdDisplayCountTotalWithAdId: |
| Increment the lifetime total display counter for an advert identifier. | |
| (void) | + clearAdDisplayCount |
| Clear both the daily and the total display counters. | |
| (void) | + setHtmlAdDataWithAdModel:adLocation:bannerList: |
| Store the cached HTML advert records for an advert model at an ad location. | |
| (nullable NSArray *) | + getHtmlAdDataWithAdModel:adLocation: |
| The cached HTML advert records for an advert model at an ad location. | |
| (BOOL) | + getMoviePlayerIcon |
| Pre-load the movie-player icon resource files. | |
| (nullable id) | + getMoviewQuaryWithAdModel:adLocation:verticalAlign:impressionId:errorObj: |
| Build the interstitial movie query records, or report why none is available. | |
The recommend network's advert-cache store.
| + (void) clearAdDisplayCount |
Clear both the daily and the total display counters.
| + (void) clearAllAdData |
Clear the cached aggregated advert-data record from NSUserDefaults.
| + (void) clearAllAdDataInfoExpire |
Clear the in-memory expiry record for the cached advert data.
| + (nullable NSString *) convertHtmlWithAdModel: | (int) | adModel | |
| adLocation: | (nullable NSString *) | adLocation | |
| adType: | (int) | adType | |
| verticalAlign: | (int) | verticalAlign | |
| bannerList: | (nullable id) | bannerList | |
| impressionId: | (nullable NSString *) | impressionId | |
| selfList: | (nullable id) | selfList | |
| comResData: | (nullable id) | comResData |
Fill the advert-type HTML template with the banner list, self list, common-resource payload, and environment placeholders.
| adModel | The advert-model identifier. |
| adLocation | The ad-location identifier. |
| adType | The advert-type identifier, selecting the ad_type<adType>.html template. |
| verticalAlign | The vertical-alignment identifier. |
| bannerList | The banner records to embed. |
| impressionId | The impression identifier, embedded only when non-nil. |
| selfList | The self advert records to embed. |
| comResData | The common-resource payload to embed. |
| + (nullable NSError *) createHtmlWithAdModel: | (int) | adModel | |
| adLocation: | (nullable NSString *) | adLocation | |
| verticalAlign: | (int) | verticalAlign | |
| impressionId: | (nullable NSString *) | impressionId |
Create the cached HTML advert body for an advert model, writing it to the contents folder.
| adModel | The advert-model identifier. |
| adLocation | The ad-location identifier. |
| verticalAlign | The vertical-alignment identifier. |
| impressionId | The impression identifier embedded in the rendered HTML. |
nil. | + (NSDate *) getAllAdDataInfoExpire |
The cached advert-data expiry date.
The expiry archive is held in a process-lifetime global, not in NSUserDefaults.
nil when no valid date is cached. | + (void) getAllAdDataWithCallBack: | (RecommendAdCacheAllAdDataCallback) | callBack |
Fetch every advert-data record through the recommend session, then report completion.
| callBack | The completion callback. Its first argument is always nil; only the error ever carries a value. |
| + (void) getAllAdStatus |
Refresh the aggregated advert-status table.
If the cached advert-data expiry date is still in the future the call returns early; otherwise it recreates the cache folder and requests a fresh layout index from the web API, then refreshes the templates, wipes the on-disk caches, and kicks off a full advert-data fetch.
| + (void) getBannerDataWithList: | (nullable NSArray *) | list | |
| max: | (int) | max |
Pre-load the banner images for a list of advert records, up to a success quota.
| list | The advert-image URLs whose files should be cached. |
| max | The maximum number of successful downloads before stopping. |
| + (void) getCacheDataWithList: | (nullable NSArray *) | list | |
| max: | (int) | max |
Pre-load the cached-data (movie) files for a list, up to a success quota.
| list | The data-file URLs whose files should be cached. |
| max | The maximum number of successful downloads before stopping. |
| + (nullable NSArray *) getHtmlAdDataWithAdModel: | (int) | adModel | |
| adLocation: | (nullable NSString *) | adLocation |
The cached HTML advert records for an advert model at an ad location.
| adModel | The advert-model identifier. |
| adLocation | The ad-location identifier. |
| + (BOOL) getMoviePlayerIcon |
Pre-load the movie-player icon resource files.
YES when every resource fetch succeeded. | + (nullable id) getMoviewQuaryWithAdModel: | (int) | adModel | |
| adLocation: | (nullable NSString *) | adLocation | |
| verticalAlign: | (int) | verticalAlign | |
| impressionId: | (nullable NSString *) | impressionId | |
| errorObj: | (NSError *_Nullable *_Nullable) | errorObj |
Build the interstitial movie query records, or report why none is available.
On success the first interstitial record (with its target URL filled and its display counter incremented) is returned. On failure nil is returned and errorObj is set to a localised error. The selector keeps the binary's misspellings "Moview" and "Quary" verbatim, and the verticalAlign and impressionId arguments are accepted but never read.
| adModel | The advert-model identifier. |
| adLocation | The ad-location identifier. |
| verticalAlign | Ignored. The body never reads it. |
| impressionId | Ignored. The body never reads it. |
| errorObj | On failure, set to the localised error. |
nil on failure. | + (BOOL) getResourceDataWithList: | (nullable NSArray *) | list |
Fetch and cache every resource file in a list.
| list | The resource-image URLs to cache. |
YES when every fetch succeeded, NO as soon as one fails. | + (void) getTemplateFiles |
Download and cache every advert template file listed in the SDK template list.
| + (void) saveTemplateData: | (nullable NSData *) | data | |
| path: | (nullable NSString *) | path | |
| file: | (nullable NSString *) | file |
Write template data into the contents folder, creating the intermediate directories named by path.
| data | The template data to write. |
| path | The slash-separated relative directory path. |
| file | The template file name. |
| + (void) setAdDisplayCountDailyWithAdId: | (nullable NSString *) | adId |
Increment the daily display counter for an advert identifier, resetting it at the start of a new local day.
| adId | The advert identifier. |
| + (void) setAdDisplayCountTotalWithAdId: | (nullable NSString *) | adId |
Increment the lifetime total display counter for an advert identifier.
| adId | The advert identifier. |
| + (void) setAdDisplayCountWithAdId: | (nullable NSString *) | adId |
Increment both the daily and the total display counters for an advert identifier.
| adId | The advert identifier. |
| + (void) setHtmlAdDataWithAdModel: | (int) | adModel | |
| adLocation: | (nullable NSString *) | adLocation | |
| bannerList: | (nullable id) | bannerList |
Store the cached HTML advert records for an advert model at an ad location.
| adModel | The advert-model identifier. |
| adLocation | The ad-location identifier. |
| bannerList | The advert records to cache. |
| + (void) setTargetUrl: | (nullable NSArray *) | targetUrl | |
| adType: | (int) | adType | |
| adModel: | (int) | adModel | |
| adLocation: | (nullable NSString *) | adLocation |
Build and store the click-through target URL on every banner record.
| targetUrl | The mutable banner records to annotate with their target URLs. |
| adType | The advert-type identifier. |
| adModel | The advert-model identifier. |
| adLocation | The ad-location identifier. |