Ha ii,everybody.I have a reader application which has a database downloading option through inapp,that is,the user can download the diffrent languages of databse(Sqlite) through inapp.I i added the classes from MugunthKumar classes and added it into the project.I have 5 buttons hindiDB,HebrewDB,japaneseDB,portuguesDB etc,etc.If the user tap any of the button above it will automatically connect to in-app and if the payment done ,it need to download that DB to my app.I write this code in one of my button click:
-(IBAction)_clickbtnhindilang:(id)sender
{
[[MKStoreManager sharedManager] buyFeature:kFeatureAId
onComplete:^(NSString* purchasedFeature)
{
NSLog(#"Purchased: %#", purchasedFeature);
}
onCancelled:^
{
NSLog(#"User Cancelled Transaction");
}];
}
and the console shows that it cannot built in ios stumulator and ned to build in realdevise,so i build it with a real devise and the console shows
Review request cannot be checked now: (null)
2011-12-06 14:39:33.958 Bible[965:707] User cancelled transaction: <SKPaymentTransaction: 0x373110>
2011-12-06 14:39:33.961 Bible[965:707] error: Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo=0x3dc4d0 {NSLocalizedDescription=Cannot connect to iTunes Store}
I didnt know how to do a inapp purchase.How can done this with MukunthKumar storekit class.
Thanks in advance.
Look here
http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/
And slow down a little bit, your rush will prevent you from learning.
Shani
Related
So I have tried to add Aviary's IAP purchases and have had little luck getting them to show up in my application. I have not made sure that following has happening
My Provisioning Profile being used to build the application has IAP's turned on
I have uploaded all of Aviary's IAP's to itunes connect
I have added the required code for IAP's in my app delegate:
[[AFPhotoEditorController inAppPurchaseManager] startObservingTransactions];
[AFPhotoEditorCustomization enableInAppPurchases:#YES];
Before I start my photo editor session I add the following code
AFPhotoEditorController* photoEditor = [[AFPhotoEditorController alloc] initWithImage:imgToBeEdited];
[AFPhotoEditorCustomization enableInAppPurchases:#YES];
mPhotoEditorSession = [photoEditor session];
editorController = photoEditor;
[photoEditor setDelegate:self];
They are not showing up at all and I am uncertain of what Aviary is taking care of and what I should be taking care of
I think it might have to do with this line in the documentation:
Add the following lines to your app delegate's -applicationFinishedLaunchingWithOptions: method before invoking any StoreKit framework methods:
[[AFPhotoEditorController inAppPurchaseManager] startObservingTransactions];
This line adds the in-app purchase manager singleton as an observer of the StoreKit payment queue returned by [SKPaymentQueue defaultQueue], and sets a flag enabling in-app purchase code throughout the SDK.
Has anyone added this to their application and let me know what Storekit methods I need to invoke? Any sample code is helpful.
thanks in advance!
Here i am trying to add a post to facebook using following code.
FBAppCall *appCall = [FBDialogs presentShareDialogWithLink:urlToShare
name:#"Title"
caption:nil
description:#"description"
picture:nil
clientState:nil
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if (error) {
NSLog(#"Error: %#", error.description);
} else {
NSLog(#"Success!");
}
}];
But this isn't working. It give following error.
Error Domain=com.facebook.Facebook.platform Code=102 "The operation couldn’t be completed. (com.facebook.Facebook.platform error 102.)" UserInfo=0x1cde3340 {error_code=102, action_id=E780C3AA-1387-4B9C-9A3A-9A16FB54BC59, error_message=An error occurred during publishing., app_id=558567750859724}
Here i am working on cocos2d, is this can be the reason.
Go to your app's settings under the Facebook developer portal.
Go to open graph > types
Choose the action type using and turn on "User Generated Images" for that action type. Save these settings and try again. It will work.
I encountered this error as well, make sure you disable the sandbox mode in Facebook admin panel before distributing to any other user :P
I recently encountered this error when the link I tried to post did not load correctly (was loading a 404 page). Not sure why, but maybe Facebook requires the link work.. Either way they need to make their error messaging more specific.
I want to add in-app purchases to my app, but I can't make it work. I'm using MKStoreKit 4.2.
Here is the buying code:
- (IBAction)onPayButtonPressed:(id)sender {
[[MKStoreManager sharedManager] buyFeature:#"com.flowrower.TestApp.0.99.item"
onComplete:^(NSString* purchasedFeature, NSData* receiptData)
{
NSLog(#"Purchased: %#", purchasedFeature);
}
onCancelled:^
{
NSLog(#"Cancelled");
}];
NSLog (#"END");
}
In output I'm always getting "END" only. So buyFeature doesn't work at all.
Testing on iPhone 4S with iOS 6.0.
Using Provision Profile with In-App Purchases support.
There is Product ID "com.flowrower.TestApp.0.99.item" in iTunes Connect with status "Ready to submit"
This product is consumble and I have added it to MKSoreKitConfigs.plist
Everything's OK with Contacts, Bank and Taxes in iTunes Connect
Logged off from iTunes and App Store on my device.
Getting this message at app start: "NSUbiquitousKeyValueStore error: user.TestApp has no valid com.apple.developer.ubiquity-kvstore-identifier entitlement". I don't know is it related or not.
if its not approved, you need to test in the sandbox. I don't know MKStoreKit but I think you need an adhoc certificate!?
The problem was with iOS 6. 12 days ago new version of MKStoreKit released and it work like a charm in iOS 6. Thanks guys.
For example, when user asked to login during InApp purchase, they can click on the "Cancel" button, then the app will shoe
Can't connect to the iTunes Store
Is it possible to use our own callback instead of this standard message?
I believe you don't get the alert with "Can't connect to the iTunes Store
" , I suspect you are showing alert view with the error in callback.
I have checked on the iOS 5 and 4.3. if you are NOT seeing this 4.3 and up I would not worry about that.
you can check if user cancelled the transaction with following code
Try following code inside restoreCompletedTransactionsFailedWithError
if (error.code == SKErrorPaymentCancelled || error.code == SKErrorPaymentNotAllowed){
NSLog(#"User Cancelled");
}
I know it looks little confusing but works great, it works even user canceled on Restore or New Purchase.
The system does not display any alert when a purchase is canceled, it's up to your application. See Step #10 in the documentation.
Basically, it goes like this :
The method paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions of your transactionObserver is called whenever a transaction begins, succeeds, or fails. If it fails, the -[SKPaymentTransaction error] will contain a regular NSError. You can then check its code and act accordingly.
The known codes are : (from <StoreKit/SKError.h>)
// error codes for the SKErrorDomain
enum {
SKErrorUnknown,
SKErrorClientInvalid, // client is not allowed to issue the request, etc.
SKErrorPaymentCancelled, // user cancelled the request, etc.
SKErrorPaymentInvalid, // purchase identifier was invalid, etc.
SKErrorPaymentNotAllowed // this device is not allowed to make the payment
};
You probably want to check at least for SKErrorPaymentCancelled and SKErrorPaymentNotAllowed.
Another interesting point is that the NSError contains a localizedDescription which you can display in an UIAlertView. That's where the "Can't connect to the iTunes Store" text probably comes.
(Also, possibly related : the Sandbox store used to test In-App purchase is flakey, which may explain the error.)
While I was testing I would not get that message when canceling the login, but only messages generated by my code:
Are you sure you are not triggering the message within the SKPaymentQueue Callback method paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions for transaction state SKPaymentTransactionStateFailed?
In case of canceled transaction, the transaction.error.code is set to SKErrorPaymentCancelled. In such cases one can omit any error pop ups or show their own.
I'm trying to make "In App Purchase " works in my iphone app.
I created some products and a few test accounts in itunes connect.
I have no problem to retreive the products data (prices etc..) but when I try to make a payment
- I am asked to log in
- I use a test account
-> the transaction always fail with the following error :
failedTransaction with error : Error Domain=SKErrorDomain Code=2 "Connexion à l’iTunes Store impossible" UserInfo=0x65d02a0 {NSLocalizedDescription=Connexion à l’iTunes Store impossible}
I tried with several products and test account (even in other stores like us) but I still get the same error...
NB : I think it worked fine the first time I tried but never still
Any idea will be welcome !
Thanks
For me, I just scoured my code until I found my mistake. I was so certain everything was fine, but it was not. When I requested product information from the store, I used the correct Product Identifier:
self.productRequest= [[[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObject: #"com.popculturesoft.RC_vCar.fullVersion"]] autorelease];
However, when I went to create the payment, I used the incorrect Product Identifier:
SKPayment *payment = [SKPayment paymentWithProductIdentifier:#"com.popculturesoft.RC_vCar_Lite.fullVerson"];
Using the product Identifier for the payment is not the correct way to do it, although it allows you to do it. It is better to use an SKProduct object. (I had set the fullProduct property earlier in the code:
SKPayment *payment = [SKPayment paymentWithProduct:self.fullProduct];
I was absolutely certain that the store was down, and that was the problem. But the next day I decided to start from the beginning of the process, as described in http://developer.apple.com/library/ios/#technotes/tn2259/_index.html. This is when I found that my incorrect Product Identifier was the problem.
Check out this thread. It seems to be a problem with the Sandbox. Lot's of people having this issue-
iPhone storekit sandbox stopped working
I had the same symptoms and in my case the problem was that I had a test user account with the same name as a real Apple ID account. I resolved the problem by creating a different test user account.