TAPromotee是一个pod,允许你通过提供其App Store ID向iOS应用展示横幅推广。它会自动使用iTunes API获取关于应用的详细信息
当用户点击安装按钮时,将显示SKStoreProductViewController
TAPromotee通过CocoaPods提供,要安装它,只需将以下行添加到Podfile中
pod 'TAPromotee'
要运行示例项目,请运行pod try TAPromotee
或克隆仓库。
以下是使用TAPromotee的示例。
#import "TAPromotee.h"
[TAPromotee showFromViewController:self
appId:822702909
caption:@"Sun clock in your pocket"
completion:^(TAPromoteeUserAction userAction) {
switch (userAction) {
case TAPromoteeUserActionDidClose:
// The user just closed the add
NSLog(@"User did click close");
break;
case TAPromoteeUserActionDidInstall:
// The user did click on the Install button so here you can for example disable the ad for the future
NSLog(@"User did click install");
break;
}
}];
如果你不想使用App Store的截图作为背景,你可以提供自定义的背景图片
[TAPromotee showFromViewController:self
appId:937151343
caption:@"Your Battlefield soldier's companion"
backgroundImage:[UIImage imageNamed:@"sample-app-background"]
completion:^(TAPromoteeUserAction userAction) {
switch (userAction) {
case TAPromoteeUserActionDidClose:
// The user just closed the add
NSLog(@"User did click close");
break;
case TAPromoteeUserActionDidInstall:
// The user did click on the Install button so here you can for example disable the ad for the future
NSLog(@"User did click install");
break;
}
}];
下面是它的外观
Jan Chaloupecky
TAPromotee可在MIT许可证下使用。请参阅LICENSE文件以获取更多信息。
请参阅版本部分