RoadMap : Admob, Getting Started > iOS 요구사항 > Banners 1

Menus : 실습



선행작업

iOS AdMob 요구사항 : http://it-backup.tistory.com/49












https://developers.google.com/mobile-ads-sdk/docs/ 주소에 접속하시면, 구글 애드몹 SDK 관련 문서를 보실 수 있고, 그 속에는 몇몇 예제들이 있습니다. 본 페이지는 그 중 'Banners I' 이라는 예제를 번역하고 따라 해본 페이지 입니다. 예제의 원문서는 https://developers.google.com/mobile-ads-sdk/docs/ 접속 후 좌측 메뉴 'AdMob > Banner Ads I'을 선택하면, 보실 수 있습니다.






Banners I (배너 1)

Google AdMob Ads banners use a small portion of the screen to entice users to "click through" to a richer, full-screen experience such as a website or app store page. This guide shows you how to enable your app to serve a banner ad.

구글 애드몹 광고 배너는 화면의 작은 부분으로 사용자의 '클릭을 통해' 웹사이트 또는 앱 스토어 페이지 같은 전체 화면 경험을 하게 합니다. 이 가이드는 앱활성화를 통해 베너 ad를 제공하는 방법을 보여줍니다.

To display Google AdMob Ads banners in your iOS app, simply add a GADBannerView to your UI.
당신의 iOS 앱에 Google AdMob Ads Banners를 표시하려면, 당신의 UI에 간단히 GADBannerView를 추가합니다.


Adding a GADBannerView

GADBannerView를 추가합니다.

iOS apps are composed of UIView objects, Objective-C instances the user sees as text areas, buttons and other controls.GADBannerView is simply a UIView subclass displaying small HTML5 ads that respond to user touch.

iOS 앱은  UIView 객체, 사용자가 바라보는 텍스트 영역, 버튼과 컨트롤의 Objective-C 인스턴스로 구성됩니다. GADBannerView는  사용자 터치에 반응하는 작은 HTML5광고를 표시하는 간단한 'UIView' 서브 클래스 입니다.

Like any UIView, a GADBannerView is easy to create in code.
UIView와 비슷한, GADBannerView는 코드로 쉽게 만듭니다.

The seven lines of code it takes to add a banner:
7줄의 코드로 배너트를 추가합니다.

  • Import GADBannerView.h
  • Declare a GADBannerView instance in your app's UIViewController
  • Create it
  • Set the ad's unit ID – your AdMob Publisher ID
  • Set the "root view controller"
  • Add the view to the UI
  • Load it with an ad

The best place to do all this is in your app's UIViewController.
당신의 앱에서 가장 좋은 곳은 'UIViewController'입니다.

// BannerExampleViewController.h

// Import GADBannerView's definition from the SDK
#import "GADBannerView.h"

@interface BannerExampleViewController : UIViewController {
 
// Declare one as an instance variable
 
GADBannerView *bannerView_;
}

@end

The following performs banner setup in the view controller's viewDidLoad initialization hook.
view 컨틀롤러의 viewDidLoad 초기화 후크 속 배너설치를 합니다.

// BannerExampleViewController.m

#import "BannerExampleViewController.h"

@implementation BannerExampleViewController

- (void)viewDidLoad {
 
[super viewDidLoad];

 
// Create a view of the standard size at the top of the screen.
 
// Available AdSize constants are explained in GADAdSize.h.
  bannerView_
= [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];

 
// Specify the ad's "unit identifier". This is your AdMob Publisher ID.
  bannerView_
.adUnitID = MY_BANNER_UNIT_ID;

 
// Let the runtime know which UIViewController to restore after taking
 
// the user wherever the ad goes and add it to the view hierarchy.
  bannerView_
.rootViewController = self;
 
[self.view addSubview:bannerView_];

 
// Initiate a generic request to load it with an ad.
 
[bannerView_ loadRequest:[GADRequest request]];
}

- (void)dealloc {

 
// Don't release the bannerView_ if you are using ARC in your project // 오토 릴리즈 카운터 사용시에는 추가 하지 마세요.
 
[bannerView_ release];
 
[super dealloc];
}

@end

You can download an example project containing this code here.
이 코드가 포함된 예제 프로젝트를 다운로드 할 수 있습니다.

The Result (결과)

The outcome should be a banner at the top of your app:
결과는 당신의 앱 상단에 배너가 나와야 합니다. :

Proceed to the next guide to learn more about banner ads.

'Mobile Ads > AdMob iOS' 카테고리의 다른 글

AdMob Banners 2, iOS 예제 실습  (0) 2013.09.12
AdMob Banners 1, iOS 예제 실습  (0) 2013.09.10
iOS AdMob 요구사항  (0) 2013.09.09
Posted by 창업자닉군
,

RoadMap : Admob, Getting Started > iOS 요구사항

Menus : Banners 1,








워낙 발 번역이라, 오류가 있을 수 있습니다. 오류나 이상한 점은 댓글로 남겨주세요.


구글 AdMob SDK 첫 페이지(https://developers.google.com/mobile-ads-sdk/docs/)에 들어가면, 플랫폼 별 요구사항을 확인할 수 있습니다. 상단의 Introduction 부분 번역은 'http://it-backup.tistory.com/9'페이지를 참고하시면 됩니다. 첫 페이지에서 요구 사항을 확인합니다.



Requirements(요구사항)

  • iOS version 4.3 or later (iOS 버전 4.3 또는 그 이상)
  • Xcode 4.5 or later (Xcode 4.5 또는 그 이상)

Warning: All new iPad and iPhone apps created after October 14, 2011 will require an AdMob SDK that was released on or after March 15, 2011. This corresponds to version 4.0.2+ for iOS. If you downloaded the library from our official download site, then you're already set. Otherwise you may have an old version of the AdMob SDK that was released prior to March 15, 2011, and your new app will not receive any ad impressions until you update your SDK.

경고 : 2011년 10월 14일 이후 만들어진 모든 새로운 모든 iPad와 iPhone 앱들은 2011년 3월 15일 또는 그 이후에 출시된 AdMob SDK가 요구됩니다. 이 것은 iOS 4.0.2 이상 버전에 해당합니다. 당신이 우리의 공식 다운로드 사이트에서 다운했다면, 실치 준비가 되었습니다. 그렇지 않으면 2011년 3월 15일 배포된 AdMob SDK의 옛 버전을 가지고 있을 지도 모르며 SDK를 업데이트 하기 전 까지 당신의 새로운 앱은 몇몇 광고를 제공 받을 수 없습니다.

Incorporating the SDK (SDK 통합)

For the rest of these instructions, the project shown will be named BannerExample. When going through the exercises, simply replace BannerExample with your project's name.

이 설명외에 다른 것들을 위해, 프로젝트가 BannerExample 이라 이름지어 진 것이 보입니다. 예제를 통해 시작할 때, 당신의 프로젝트 명과 BannerExamle을 간단히 교체 합니다.


The decompressed SDK consists of Objective-C headers, a runtime library and a README.

Objective-C headers, 런타임 라이브러리와 README로 구성된 SDK 압축을 풉니다.

1. Right-click on your project in Xcode, choose Add Files to "BannerExample"...
1. Xcode의 프로젝트 위에 우클릭, Add Files to "BannerExamle"을 선택합니다.

 

2. Add everything except the add-ons folder unless you need something from there. The add-ons folder includes headers for DFP and mediation, as well as the Analytics library. Even if you are adding these in, do not add any other Xcode projects into your project.

2. add-on 폴더의 몇몇이 필요하지 않는 한 이 것을 제외한 모든 것을 추가합니다. add-ons 폴더는 DFP와 메디에이션 헤더, 분석 라이브러리가 있습니다. 만약 이것도 포함한다면, 당신의 프로젝트 속에 다른 프로젝트를 추가하지 마세요.

3. The SDK library references six iOS development frameworks which may not already be part of your project:
3. 당신의 프로젝트에 포함되지 않았을지 모르는 SDK 라이브러리가 참고하는 6개의 iOS 개발 프레임 워크 :

  • StoreKit
  • AudioToolbox
  • MessageUI
  • SystemConfiguration
  • CoreGraphics
  • AdSupport

To add these frameworks, double-click the BannerExample project name. Open the Link Binary With Libraries dropdown under the Build Phases tab. Add the frameworks from the iOS SDK using the + button that becomes visible.

이 프레임워크를 추가하려면, BannerExample 프로젝트 이름을 더블 클릭. 'Build Phases' 탭 속 드랍다운 'Link Binary With Libraries'를 엽니다.  보여지는 '+' 버튼을 이용해 iOS SDK의 프레임워크로 부터 추가합니다.

4. You now need to add -ObjC to the Other Linker Flags of your application target's build setting:
4. 당신의 앱 타겟 'Other Linker Flags' 타겟 빌드 셋팅에 'ObjC'를 추가합니다. :

  1. In Xcode's project navigator, press the blue top-level project icon.
    Xcode의 프로젝트 네비게이터 속, 푸른 top-level 프로젝트 icon을 누릅니다.
  2. Click on your target, then the Build Settings tab.
    당신의 타겟, 'Build Settings'탭을 클릭, 
  3. Under Other Linker Flags, add -ObjC to both Debug and Release.
    'Other Linker Flags'속, 'Debug'와 'Release' -ObjC를 추가합니다.

You should now be able to rebuild your project without any errors.
error없이 다시 빌드되어야 합니다.

After you have incorporated the SDK, proceed to the next guide to learn about enabling banner ads in your app.
SDK를 통합한 후, 다음 가이드 작업으로 당신의 앱에 배너 활성화에 관해 배우세요.

'Mobile Ads > AdMob iOS' 카테고리의 다른 글

AdMob Banners 2, iOS 예제 실습  (0) 2013.09.12
AdMob Banners 1, iOS 예제 실습  (0) 2013.09.10
AdMob 예제 Banners 1, iOS  (0) 2013.09.09
Posted by 창업자닉군
,

사인용 인증서

인증서는 앱을 개발하고 개발 이후 코드의 변화가 없었음을 OS에서 확인하게 하기 위해 빌드 후 바이너리를 암호화 하는 것입니다. 물론 아무 인증서나 암호화 화는 것은 아니고, App 에서 인증한 인증서를 사용해 야합니다.

iOS의 인증서는 2가지 타입 뿐입니다. 개발용 인증서와 배포용 인증서 입니다. 당연히 개발시에는 개발용 인증서를, 배포시에는 배포용 인증서를 사용해야 합니다.


프로비저닝 프로파일

프로비저닝 파일을 앱이 기기에서 돌아 갈 때 필요합니다. 프로비저닝 프로파일은 인증서, 장치, 앱 ID가 포함되며, 개발과 베타 테트스에서 사용된다고 설명되고 있습니다. 프로비저닝 프로파일을 사용할 때, 당연히 포함된 인증서로 사인된 앱과 등록된 장치에서만 동작합니다.


각 생성 및 기기 등록

iOS 개발자 센터에서 모두 등록이 가능합니다.


중요한점

organizer로 관리를 해야 자동으로 인증서, 프로비저닝 프로파일, App ID 모두를 관리합니다.

Posted by 창업자닉군
,