IAP-Guide



Similar documents
iOS4_13

05-06( )_¾ÆÀÌÆù_ÃÖÁ¾

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V

Microsoft PowerPoint - 4-UI 애플리케이션

K&R2 Reference Manual 번역본

2ndWeek_Introduction to iPhone OS.key

API STORE 키발급및 API 사용가이드 Document Information 문서명 : API STORE 언어별 Client 사용가이드작성자 : 작성일 : 업무영역 : 버전 : 1 st Draft. 서브시스템 : 문서번호 : 단계 : Docum

- 목차 - - ios 개발환경및유의사항. - 플랫폼 ios Project. - Native Controller와플랫폼화면연동. - 플랫폼 Web(js)-Native 간데이터공유. - 플랫폼확장 WN Interface 함수개발. - Network Manager clas

시편강설-경건회(2011년)-68편.hwp

<C1D6BFE4BDC7C7D0C0DA5FC6EDC1FDBFCF28B4DCB5B5292E687770>

untitled

정 관

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

PowerPoint 프레젠테이션

untitled

Remote UI Guide

Modern Javascript

소개 TeraStation 을 구입해 주셔서 감사합니다! 이 사용 설명서는 TeraStation 구성 정보를 제공합니다. 제품은 계속 업데이트되므로, 이 설명서의 이미지 및 텍스트는 사용자가 보유 중인 TeraStation 에 표시 된 이미지 및 텍스트와 약간 다를 수

USB USB DV25 DV25 REC SRN-475S REC SRN-475S LAN POWER LAN POWER Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl C

자바 웹 프로그래밍

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

PWR PWR HDD HDD USB USB Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl Cable PC PC DDNS (

<303220C1BEC7D528C1DFB1B9B1B3BCF6BED5B1EEC1F6292E687770>

휠세미나3 ver0.4

PowerChute Personal Edition v3.1.0 에이전트 사용 설명서

Polly_with_Serverless_HOL_hyouk

C H A P T E R 2

PowerPoint 프레젠테이션

편의점 리플렛.indd

Hi-MO 애프터케어 시스템 편 5. 오비맥주 카스 카스 후레쉬 테이블 맥주는 천연식품이다 편 처음 스타일 그대로, 부탁 케어~ Hi-MO 애프터케어 시스템 지속적인 모발 관리로 끝까지 스타일이 유지되도록 독보적이다! 근데 그거 아세요? 맥주도 인공첨가물이

03장.스택.key

untitled

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

final_thesis


6주차.key

5.스택(강의자료).key

IAEA

Microsoft PowerPoint - 2-Objective-C 기초

UNIST_교원 홈페이지 관리자_Manual_V1.0

서강대학원123호

untitled

No Slide Title

교육2 ? 그림

03¼ºÅ°æ_2

1.기본현황 연 혁 m 본면은 신라시대 ~고려시대 상주목에 속한 장천부곡 지역 m 한말에 이르러 장천면(76개 리동),외동면(18개 리동)으로 관할 m 행정구역 개편으로 상주군 장천면과 외동면이 병합하여 상주군 낙동면 (17개 리,25개

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f…

<32382DC3BBB0A2C0E5BED6C0DA2E687770>

신림프로그래머_클린코드.key

이명숙초고.hwp

분 후 가구수 현 행 조 후 가구수 가구수 비 장호원 진암5 468 부 발 무촌3 579 백 사 현방 증포1 448 증 포 갈산1 769 진암5 281 기존 자연마을 진암 코아루아파트 369세대 무촌3 271 기존 자연마을 무촌 효

PRO1_04E [읽기 전용]

슬라이드 1

untitled

Microsoft Word - Automap3

목차 BUG offline replicator 에서유효하지않은로그를읽을경우비정상종료할수있다... 3 BUG 각 partition 이서로다른 tablespace 를가지고, column type 이 CLOB 이며, 해당 table 을 truncate

<B1E2C8B9BEC828BFCFBCBAC1F7C0FC29322E687770>

CD-RW_Advanced.PDF

ETL_project_best_practice1.ppt

09-interface.key

untitled

<B3EDB9AEC1FD5F3235C1FD2E687770>

Microsoft Word - FunctionCall

Microsoft PowerPoint - G3-2-박재우.pptx

BH의 아이폰 추천 어플

03.Agile.key

목 차 지역사회 홍보 및 조직화 방안 사례로 보는 복지마을만들기 7 - 이 근 호 (수원시 마을르네상스센터 대표) 지역사회와 효과적으로 소통하는 홍보 기술 - 프레지(Prezi) 21 - 유 장 휴 (AG브릿지 대표)

슬라이드 1

Week5

about_by5

81-05.PDF

초보자를 위한 C# 21일 완성

본책- 부속물

rmi_박준용_final.PDF

( )부록

Buy one get one with discount promotional strategy

SRC PLUS 제어기 MANUAL

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

NoSQL

학습영역의 Taxonomy에 기초한 CD-ROM Title의 효과분석

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

인천광역시의회 의원 상해 등 보상금 지급에 관한 조례 일부개정조례안 의안 번호 179 제안연월일 : 제 안 자 :조례정비특별위원회위원장 제안이유 공무상재해인정기준 (총무처훈령 제153호)이 공무원연금법 시행규칙 (행정자치부령 제89호)으로 흡수 전면 개

Microsoft Word - FS_ZigBee_Manual_V1.3.docx

PCServerMgmt7

PRO1_16E [읽기 전용]

chap01_time_complexity.key

삼교-1-4.hwp

Chapter 4. LISTS

3항사가 되기 위해 매일매일이 시험일인 듯 싶다. 방선객으로 와서 배에서 하루 남짓 지내며 지내며 답답함에 몸서리쳤던 내가 이제는 8개월간의 승선기간도 8시간같이 느낄 수 있을 만큼 항해사로써 체질마저 변해가는 듯해 신기하기도 하고 한편으론 내가 생각했던 목표를 향해

13주-14주proc.PDF

歯김병철.PDF

12-file.key

13 Who am I? R&D, Product Development Manager / Smart Worker Visualization SW SW KAIST Software Engineering Computer Engineering 3

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not,

大学4年生の正社員内定要因に関する実証分析

Page 2 of 6 Here are the rules for conjugating Whether (or not) and If when using a Descriptive Verb. The only difference here from Action Verbs is wh

Journal of Educational Innovation Research 2017, Vol. 27, No. 2, pp DOI: : Researc

歯두산3.PDF

歯Writing_Enterprise_Applications_2_JunoYoon.PDF

Journal of Educational Innovation Research 2018, Vol. 28, No. 3, pp DOI: NCS : * A Study on

Transcription:

M2US52D6AA.com.yourcompany.yourapp M2US52D6AA.com.yourcompany.*

M2US52D6AA.com.yourcompany.yourapp com.yourcompany.yourapp

InAppPurchaseManager.h #import <StoreKit/StoreKit.h> #define kinapppurchasemanagerproductsfetchednotification @"kinapppurchasemanagerproductsfetchednotification"

@interface InAppPurchaseManager : NSObject <SKProductsRequestDelegate> SKProduct *proupgradeproduct; SKProductsRequest *productsrequest; InAppPurchaseManager.m - (void)requestproupgradeproductdata NSSet *productidentifiers = [NSSet setwithobject:@"com.runmonster.runmonsterfree.upgrade topro" ]; productsrequest = [[SKProductsRequest alloc] initwithproductidentifiers:productidentifiers]; productsrequest.delegate = self; [productsrequest start]; we will release the request object in the delegate callback #pragma mark - #pragma mark SKProductsRequestDelegate methods (void)productsrequest:(skproductsrequest *)request didreceiveresponse:(skproductsresponse *)response NSArray *products = response.products; proupgradeproduct = [products count] == 1? [[products firstobject] retain] : nil; if (proupgradeproduct) NSLog(@"Product title: %@", proupgradeproduct.localizedtitle); NSLog(@"Product description: %@", proupgradeproduct.localizeddescription); NSLog(@"Product price: %@", proupgradeproduct.price); NSLog(@"Product id: %@", proupgradeproduct.productidentifier);

for (NSString *invalidproductid in response.invalidproductidentifiers) NSLog(@"Invalid product id: %@", invalidproductid); finally release the reqest we alloc/init ed in requestproupgradeproductdata [productsrequest release]; [[NSNotificationCenter defaultcenter] postnotificationname:kinapppurchasemanagerproductsf etchednotification object:self userinfo:nil]; SKProduct+LocalizedPrice.h #import <Foundation/Foundation.h> #import <StoreKit/StoreKit.h> @interface SKProduct (LocalizedPrice) @property (nonatomic, readonly) NSString *localizedprice; @end SKProduct+LocalizedPrice.m #import "SKProduct+LocalizedPrice.h" @implementation SKProduct (LocalizedPrice) - (NSString *)localizedprice

NSNumberFormatter *numberformatter = [[NSNumberFormatter alloc] init]; [numberformatter setformatterbehavior:nsnumberformatterbehavior10_4]; [numberformatter setnumberstyle:nsnumberformattercurrencystyle]; [numberformatter setlocale:self.pricelocale]; NSString *formattedstring = [numberformatter stringfromnumber:self.price]; [numberformatter release]; return formattedstring; @end SKProduct

StoreKit InAppPurchaseManager.h add a couple notifications sent out when the transaction completes #define kiaptransactionfailednotification @"kiaptransactionfailednotification" #define kiaptransactionsucceedednotification @"kiaptransactionsucceedednotification" @interface InAppPurchaseManager : NSObject <SKProductsRequestDelegate, SKPaymentTransactionObserver> public methods - (void)loadstore; - (BOOL)canMakePurchases; - (void)purchaseproupgrade; @end InAppPurchaseManager.m #define kiapproupgradeproductid @"com.yourcompany.yourapp.product"

#pragma - #pragma Public methods call this method once on startup - (void)loadstore restarts any purchases if they were interrupted last time the app was open [[SKPaymentQueue defaultqueue] addtransactionobserver:self]; get the product description (defined in early sections) [self requestproupgradeproductdata]; call this before making a purchase - (BOOL)canMakePurchases return [SKPaymentQueue canmakepayments]; kick off the upgrade transaction - (void)purchaseproupgrade SKPayment *payment = [SKPayment paymentwithproductidentifier:kiapproupgradeproductid] ; [[SKPaymentQueue defaultqueue] addpayment:payment]; #pragma - #pragma Purchase helpers

saves a record of the transaction by storing the receipt to disk - (void)recordtransaction:(skpaymenttransaction *)transaction if ([transaction.payment.productidentifier isequaltostring:kiapproupgradeproductid]) save the transaction receipt to disk [[NSUserDefaults standarduserdefaults] setvalue:transaction.transactionreceipt forkey:@"proupgradetransactionreceipt" ]; [[NSUserDefaults standarduserdefaults] synchronize]; enable pro features - (void)providecontent:(nsstring *)productid if ([productid isequaltostring:kiapproupgradeproductid]) enable the pro features [[NSUserDefaults standarduserdefaults] setbool:yes forkey:@"isproupgradepurchased" ]; [[NSUserDefaults standarduserdefaults] synchronize]; removes the transaction from the queue and posts a notification with the transaction result - (void)finishtransaction:(skpaymenttransaction *)transaction wassuccessful:(bool)wassuccessful

remove the transaction from the payment queue. [[SKPaymentQueue defaultqueue] finishtransaction:transaction]; NSDictionary *userinfo = [NSDictionary dictionarywithobjectsandkeys:transaction, @"transaction", nil]; if (wassuccessful) send out a notification that we ve finished the transaction [[NSNotificationCenter defaultcenter] postnotificationname:kiaptransactionsucceedednotifica tion object:self userinfo:userinfo]; else send out a notification for the failed transaction [[NSNotificationCenter defaultcenter] postnotificationname:kiaptransactionfailednotificatio n object:self userinfo:userinfo]; called when the transaction was successful - (void)completetransaction:(skpaymenttransaction *)transaction [self recordtransaction:transaction]; [self providecontent:transaction.payment.productidentifier] ; [self finishtransaction:transaction wassuccessful:yes];

called when a transaction has been restored and and successfully completed - (void)restoretransaction:(skpaymenttransaction *)transaction [self recordtransaction:transaction.originaltransaction]; [self providecontent:transaction.originaltransaction.paymen t.productidentifier]; [self finishtransaction:transaction wassuccessful:yes]; called when a transaction has failed - (void)failedtransaction:(skpaymenttransaction *)transaction if (transaction.error.code!= SKErrorPaymentCancelled) error! [self finishtransaction:transaction wassuccessful:no]; else this is fine, the user just cancelled, so don t notify [[SKPaymentQueue defaultqueue] finishtransaction:transaction]; #pragma mark - #pragma mark SKPaymentTransactionObserver methods

called when the transaction status is updated - (void)paymentqueue:(skpaymentqueue *)queue updatedtransactions:(nsarray *)transactions for (SKPaymentTransaction *transaction in transactions) switch (transaction.transactionstate) case SKPaymentTransactionStatePurchased: [self completetransaction:transaction]; break; case SKPaymentTransactionStateFailed: [self failedtransaction:transaction]; break; case SKPaymentTransactionStateRestored: [self restoretransaction:transaction]; break; default: break;