How do I make an iOS Swift "In App Purchases" Hosted Content pkg file for a text file with a sentence that should be embedded in a view controller The product that is being sold is basically a sentence of about 10 words or so.

I would like to store that sentence with apple content hosting linked to my in app purchase product.

when the user purchases the product that sentence will appear in a view controller after purchase succeeds within a UILabel.

The products of in app purchases are non-consumable.

When a user purchases an item, I would like for the user to be able to access a UIlabel with text (a short sentance) from a hosted content of the product. I would like the sentance to be hosted with the product by apple.

The sentence (or text string ) is different for every product and I would like to store the sentence (10 words or so) in the product "Apple hosted content" section so that the text (sentence of words) can be embedded later on in a UILabel within a view controller. the text in the UILabel is the text from the hosted content in apple.

My question is like this:

What kind of content package do I submit for hosted content pkg.?

Do I submit a .txt file in the Xcode in-app purchases template project file of Xcode with the desired string of text that can later on be embedded within the UILabel in the apps view controller?

If not, is there a different content file I should be embedding into the "In App Purchases" project template within Xcode?

Also, How do I later-on embed the text from the Hosted contend in my product to the UILabel in my apps view controller preferably using swift and Xcode 6.2?

Please note: I am new to in app-purchasing. I am quite familiar with Xcode and Swift though.

I am using Xcode 6.2 + Apple Swift

1

There are 1 best solutions below

1
On

You can make a simple UILabel, and when In-App is purchased, you can show that Label. You can set a Notification and inside your productPurchased function, you can show/hide UILabel. Here is a wonderful lecture by Ray Wenderlich on In App Purchases

For tutorials in Swift, you can have a look at these :