【问题标题】:INApp Purchase (ios 6) how to create kStoredData @"com.emirbytes.IAPNoobService"INApp购买(ios 6)如何创建kStoredData@“com.emirbytes.IAPNoobService”
【发布时间】:2013-03-07 18:42:48
【问题描述】:

我们正在使用 InApp 购买教程“http://xcodenoobies.blogspot.in/2012/04/implementing-inapp-purchase-in-xcode.html”。我们不知道如何创建 kStoredData @“com.emirbytes.IAPNoobService”

告诉我如何创建:-- kStoredData @"com.emirbytes.IAPNoobService"

有人解决这个问题吗?

提前致谢。

我们正在使用以下代码:-

@implementation 视图控制器

@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;

}

-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{

// 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];
}

}

-(void)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];
        }
    }
}

}

【问题讨论】:

  • define kStoredData @"com.emirbytes.IAPNoobService" 这是您的应用程序包 ID。首先您创建应用程序 ID 和包 ID,然后在您的编码或应用程序中使用。

标签: ios6 in-app-purchase in-app-billing iphone-5 xcode4.6


【解决方案1】:

要创建 kStoreDate 数据,您需要 iTunes 连接登录,然后您必须从应用的应用内购买选项卡中添加它!

这里是展示如何创建 kStoreDate 的最佳教程 使用full integration of in-App purchase查看此处

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多