To run the example project, clone the repo, and run pod install from the Example directory first.
- iOS 8.0 or later
CampaignAdvisor is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CampaignAdvisor'- Read the Campaign-Server README
######다음과 같이 헤더를 추가하고, didFinishLaunchingWithOptions에서 [CampaignManager.sharedManager startCampaignAdvisor:<#(NSString *)#> withServer:<#(NSString *)#>]에 앱에 해당하는 id와 서버주소를 적어줍니다. ######[CampaignManager.sharedManager setFailNetworking:<#^(void)failNetworking#>]에는 서버 접근 하지 못하는 등의 에러가 발생했을때의 처리를 적어줍니다.
#import <CampaignAdvisor/CampaignManager.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[CampaignManager.sharedManager startCampaignAdvisor:@"app_info Table's id" withServer:@"http://url"];
[CampaignManager.sharedManager setFailNetworking:^{
NSLog(@"");
}];
return YES;
}######광고를 가져와야 할 때에 다음과 같은 함수를 호출합니다. [CampaignManager.sharedManager getCampaigns:<#(NSString *)#> onVC:<#(UIViewController *)#>] 이때 첫번째 파라미터는 location_for_app테이블의 location_id이며 두번째 파라미터는 광고를 띄울 뷰컨트롤러입니다.
[CampaignManager.sharedManager getCampaigns:@"location_for_app_ location_id" onVC:viewController];######campaign_info테이블의 redirect_location에 이름을 맞추어 위에 적은 뷰컨트롤러에서 연결된 세그의 이름을 동일하게 하거나 실행될 함수를 작성합니다.
CampaignAdvisor is available under the MIT license. See the LICENSE file for more info.