I've been trying to incorporate in-app purchase to my iOS app, with which users who want to be annoyed with Ad being displayed on the screen can disable those Ads by purchasing the product. The app uses UITabBarController
, and the screen on which users can purchase the product is different from the screen users see the Ad - in other words, I use different view controllers set on to different tabs in UITabBarController
.
However, when users have completed purchasing the product, they still keep seeing those Ads on the screen, and it's only after the next time when users launch the app that those Ads are completely removed from the screen.
However, Apple documentation infers that they reject an app that forces users to restart the app. I think this includes the situation I'm talking about right now, so I would like to know how to restart the app internally - in other words, I want to restart the app as if it's launched from scratch only within the app, probably by calling UIApplication
and its methods or something like that.
How can I restart the app in such a way? Or maybe is it a better way to cope with this purchasing issue? Also, if that can be restarted from within the app, should I write the payment code (SKProductsRequest
and SKPaymentTransactionObserver
) in the view controller that manages the in-app purchase, or in AppDelegate.m
?
I use iOS 7.1 and Xcode 5.1.