0
votes

We are using InApp Purchase Tutorial "http://xcodenoobies.blogspot.in/2012/04/implementing-inapp-purchase-in-xcode.html".We don't no how to create kStoredData @"com.emirbytes.IAPNoobService"

Tell me how to create :-- kStoredData @"com.emirbytes.IAPNoobService"

anybody solve this problem?

Thank You in Advance.

We are using following code:-

@implementation ViewController

@synthesize feature2Btn, featureLabel, statusLabel;

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

}

1
define kStoredData @"com.emirbytes.IAPNoobService" this is your application bundle id.First you create your App Id & bundle id then use there need to in your codeing or application.Shriram Kadam

1 Answers

0
votes

for creating kStoreDate data you need iTunes connect login and then you have to add it from in-app purchase tab of app!

Here is the best tutorial that show how to create kStoreDate Check here with full integration of in-App purchase