What is Sandbox in iOS? Can I transfer data between one app to another app?
From The iOS Environment
For security reasons, iOS places each app (including its preferences
and data) in a sandbox at install time. A sandbox is a set of
fine-grained controls that limit the app’s access to files,
preferences, network resources, hardware, and so on. As part of the
sandboxing process, the system installs each app in its own sandbox
directory, which acts as the home for the app and its data.
one solution to transmit data from one to another app is via URL Schemes
iOS - transferring in-apps between apps
It's possible to transfer data from one app to another quite easily if your users have both apps installed, however it's not possible to transfer in app purchases from one app to another.
What you'll have to do is update your legacy app to support some kind of action or link to the new app, then open the new app from within the old app with UIApplication openURL:
and pass through some meta data about the upgrade.
Then from within the new app your app delegate will receive didFinishLaunchingWithOptions:
with the URL used to launch the app, you can then download their purchase.
This functionality is supported by registering URL scheme for you new app, which is an info.plist
setting.
A problem you're going to have with the above transfer of purchase meta data between the old app and the new one will be the fact that restoring their purchase will not be possible via StoreKit/Apple (as noted above, transfers are not possible).
You could get around this issue and provide your existing customers with the ability to restore their purchases if you had two in app purchase SKUs for your new app.
One item is the usual item that new customers will need to pay for, the other is identical but $0 for existing customers to 'buy' so they have a purchase registered with StoreKit/Apple for them to restore in the future without the old app.
The new app can conditionally display this $0 option for existing customers if they've upgraded via the method above.
Related Topics
Storyboard View Elements Greyed Out
iOS 13.1 Crash in Avaudio Player
How to Create a Big, Red Uibutton with iOS
Usage of Protocols as Array Types and Function Parameters in Swift
Change String Color with Nsattributedstring
Swift - Uibutton with Two Lines of Text
Button in Uitableviewcell Not Responding Under iOS 7
iOS 8 Tab Bar Item Background Colour
Xcode - Mpnowplayinginfocenter Info Is Not Displayed on iOS 8
iOS - How to Play a Video with Transparency
What Is Sandbox in iOS? How to Transfer Data Between One App to Another App
Cocoapods: Failed to Connect to Github to Update the Cocoapods/Specs Specs Repo
iPhone Ad Hoc Build Using Xcode 4
Swift - How to Hide Back Button in Navigation Item
Making a Phone Call in an iOS Application
When to Use Takeunretainedvalue() or Takeretainedvalue() to Retrieve Unmanaged Objects in Swift