|
云编译的 Xcode 版本是 12.0,SKAdImpression 是12.5 版本的才支持。你可以先使用动态的方式来使用该类。比如建一个 UZSKAdImpression 协议,协议里面包含 SKAdImpression 所有属性。
- @protocol UZSKAdImpression <NSObject>
- /// The App Store item identifier for the source app.
- @property (nonatomic, strong) NSNumber *sourceAppStoreItemIdentifier;
- /// The App Store item identifier for the app being advertised.
- @property (nonatomic, strong) NSNumber *advertisedAppStoreItemIdentifier;
- /// The identifier for the ad network.
- @property (nonatomic, strong) NSString *adNetworkIdentifier;
- /// The ad campaign identifier.
- @property (nonatomic, strong) NSNumber *adCampaignIdentifier;
- /// The nonce used to generate the signature.
- @property (nonatomic, strong) NSString *adImpressionIdentifier;
- /// The type of ad being presented.
- @property (nonatomic, strong, nullable) NSString *adType;
- /// The description of the ad.
- @property (nonatomic, strong, nullable) NSString *adDescription;
- /// Name of entity that purchased the ad being presented.
- @property (nonatomic, strong, nullable) NSString *adPurchaserName;
- /// The timestamp of the start and end call.
- @property (nonatomic, strong) NSNumber *timestamp;
- /// The signature of the impression.
- @property (nonatomic, strong) NSString *signature;
- /// The version of SKAdNetwork being used.
- @property (nonatomic, strong) NSString *version;
- @end
复制代码
创建 SKAdImpression 对象时用动态方式,这样就可以使用了。
- Class cls = NSClassFromString(@"SKAdImpression");
- id<UZSKAdImpression> ad = [[cls alloc] init];
- ad.adDescription = @"";
复制代码
|
|