2013-03-19 2 views
0

Мы используем InApp Покупка Учебник «http://xcodenoobies.blogspot.in/2012/04/implementing-inapp-purchase-in-xcode.html» Мы не в настоящее время нет, как создать kStoredData @ «com.emirbytes.IAPNoobService»InApp Покупка (ИОС 6), как создать kStoredData @ «com.emirbytes.IAPNoobService»

Сообщите мне, как создать: - kStoredData @ "com.emirbytes.IAPNoobService"

любой человек решает эту проблему?

Благодарим вас в Advance.

Мы используем следующий код: -

@implementation ViewController

@synthesize feature2Btn, featureLabel, statusLabel;

определяют kStoredData @ "com.emirbytes.IAPNoobService"

- (BOOL) IAPItemPurchased {

// check userdefaults key 

NSError *error = nil; 
NSString *password = [SFHFKeychainUtils getPasswordForUsername:@"IAPNoob01" andServiceName:kStoredData error:&error]; 


if ([password isEqualToString:@"whatever"]) return YES; else return NO; 

}

- (Недействительными) productsRequest: (SKProductsRequest *) запрос didReceiveResponse :(SKProductsResponse *) Ответ
{

// remove wait view here 
statusLabel.text = @""; 

SKProduct *validProduct = nil; 
int count = [response.products count]; 

if (count>0) { 
    validProduct = [response.products objectAtIndex:0]; 

    SKPayment *payment = [SKPayment paymentWithProductIdentifier:@"com.emirbytes.IAPNoob.01"]; 
    [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; 
    [[SKPaymentQueue defaultQueue] addPayment:payment]; 


} else { 
    UIAlertView *tmp = [[UIAlertView alloc] 
         initWithTitle:@"Not Available" 
         message:@"No products to purchase" 
         delegate:self 
         cancelButtonTitle:nil 
         otherButtonTitles:@"Ok", nil]; 
    [tmp show]; 
    [tmp release]; 
} 

}

- (Недействительными) alertView: (UIAlertView *) alertView clickedButtonAtIndex: (NSInteger) buttonIndex {

if (alertView==askToPurchase) { 
    if (buttonIndex==0) { 
     // user tapped YES, but we need to check if IAP is enabled or not. 
     if ([SKPaymentQueue canMakePayments]) { 

      SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers: 
      [NSSet setWithObject:@"com.emirbytes.IAPNoob.01"]]; 

      request.delegate = self; 
      [request start]; 


     } else { 
      UIAlertView *tmp = [[UIAlertView alloc] 
           initWithTitle:@"Prohibited" 
           message:@"Parental Control is enabled, cannot make a purchase!" 
           delegate:self 
           cancelButtonTitle:nil 
           otherButtonTitles:@"Ok", nil]; 
      [tmp show]; 
      [tmp release]; 
     } 
    } 
} 

}

+0

определяет kStoredData @ «com.emirbytes.IAPNoobService» это приложение расслоение id.First создать свой App Id & расслоение идентификатор затем использовать вам нужно в коде или приложении. –

ответ

0

для создания данных kStoreDate вам нужно ITunes подключить логин, а затем у вас есть чтобы добавить его с вкладки для покупки приложения в приложении!

Вот лучший учебник, который показывает, как создать kStoreDate Проверьте здесь с full integration of in-App purchase

Смежные вопросы