Ios6 INApp购买(ios 6)如何创建kStoredData;com.emirbytes.IAPNoobService“;
我们正在使用InApp购买教程“”。我们不知道如何创建kStoredData@“com.emirbytes.IAPNoobService” 告诉我如何创建:--kStoredData@“com.emirbytes.IAPNoobService” 有人能解决这个问题吗 先谢谢你 我们使用以下代码:- @实现视图控制器 @综合feature2Btn、featureLabel、statusLabel 定义kStoredData@“com.emirbytes.IAPNoobService” -(BOOL)IAPItemPurchased{Ios6 INApp购买(ios 6)如何创建kStoredData;com.emirbytes.IAPNoobService“;,ios6,in-app-purchase,in-app-billing,iphone-5,xcode4.6,Ios6,In App Purchase,In App Billing,Iphone 5,Xcode4.6,我们正在使用InApp购买教程“”。我们不知道如何创建kStoredData@“com.emirbytes.IAPNoobService” 告诉我如何创建:--kStoredData@“com.emirbytes.IAPNoobService” 有人能解决这个问题吗 先谢谢你 我们使用以下代码:- @实现视图控制器 @综合feature2Btn、featureLabel、statusLabel 定义kStoredData@“com.emirbytes.IAPNoobService” -(BOOL
// check userdefaults key
NSError *error = nil;
NSString *password = [SFHFKeychainUtils getPasswordForUsername:@"IAPNoob01" andServiceName:kStoredData error:&error];
if ([password isEqualToString:@"whatever"]) return YES; else return NO;
}
-(无效)产品请求:(SKProductsRequest*)请求接收方响应:(SKProductsResponse*)响应{ } -(无效)alertView:(UIAlertView*)alertView单击按钮索引:(NSInteger)按钮索引{
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];
}
}
}
}要创建kStoreDate数据,您需要iTunes connect登录,然后必须从应用程序的“应用内购买”选项卡添加数据 下面是演示如何使用定义kStoredData@“com.emirbytes.IAPNoobService”创建kStoreDate Check的最佳教程。这是您的应用程序包id。首先创建应用程序id和包id,然后在编码或应用程序中使用它们。
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];
}
}
}