Avoid Interstitial to show if the App is Purchased through App Store App

You are not notified of an inApp in the App Store before paymentQueue:shouldAddStorePayment:forProduct:. Also, no inApp popup occurs unless your app presents one in paymentQueue:updatedTransactions:.

This is the best thing I can suggest for you:

I'm assuming that you don't put up an interstitial ad immediately upon your app starting - that wouldn't be a very good user experience. So you just have to keep an ad from displaying between the time you know the user bought something and the time you process that transaction.

  1. So then, you can have a global variable BOOL doAllowIntAd which defaults to YES.
  2. To find out if the user bought an inApp in the App Store, very early in application:(UIApplication *)application didFinishLaunchingWithOptions:, you call [[SKPaymentQueue defaultQueue] addTransactionObserver:yourTransactionObserver]; so that your observer is set up to receive the inApp from the App Store. This is the very first thing I do in didFinishLaunchingWithOptions:.

  3. When paymentQueue:shouldAddStorePayment:forProduct: on yourTransactionObserver gets called, before returning YES, set doAllowIntAd = NO to keep the ad from displaying.

  4. When StoreKit calls paymentQueue:updatedTransactions: on yourTransactionObserver with the inApp from the App Store, you process it the same way you would process a purchase made within your app. For example, for transaction.transactionState==SKPaymentTransactionStatePurchased, simply add doAllowIntAd = YES after the transaction has been processed, content enabled, and [yourSKPaymentQueue finishTransaction:] has been called, to allow the interstitial ad to be displayed again. Of course, you should re-enable doAllowIntAd not just for SKPaymentTransactionStatePurchased, but for some other transactionState as well. But you may decide to leave the ad disabled in the case the transaction is deferred, for example.

Thus if there is any delay between 3 & 4, your ad won't display during that time. You can experiment to see whether there is any delay in practice.