iOS development different user permissions get different features - ios

Can I have one app that changes depending on user permissions. For example if I were a paying user I would be able to login to the same app and ONLY be able to SEE and play tetris, however, if i were a free user i would login to a free account and ONLY be able to SEE and play pong. Essentially having two apps put into one and a person can choose between the two games by logging in or logging out. If so, how can I approach this?
edit: I have a custom TBC involved. Is it possible that it changes too depending on a user's permission?
edit2: Sorry... Also Would it make my app unreasonably big and slow? Since I would have so many more MVC objects (essentially at least twice the size since I would need to create an object for a subscriber and a freeuser?)

There are several ways to achieve this, all you need is to create and store some specific flag, for example isUserPremium and check it on the initial view controller or in AppDelegate. Than depending on it you can lead user to different view controllers.

You can put in-app Purchase inside your app. You can put Consumable In-App Purchase. And then with NSUserDefaults value, you can show respective games to user. Eg, if their value is false then show pong game otherwise show tetris game. For more details on how to integrate in-app Purchases follow this Raywenderlich's tutorial

Related

How should I handle in app payment for new app that does not have anything to show yet

I have created a new app that is not in both stores yet. It is supposed to charge users subscriptions every 1 / 3 / or 6 months. The app helps users find nearby users based on some criteria. Some parts of the app are for paid members and other parts of the app for all users. There are 0 users in the app right now. So there are no users to show to each user. Which makes it difficult to charge people subscription.
I have the following questions that would appreciate if someone can answer:
Should I show the paywall to the users at this point?
What is the best way to make all users paid so that they can use the app even though they did not pay anything.
What would be the best way to show the paywall to the users at this early stage.
Please keep in mind that users are the assets in this app. So if there are no users in the app, there would be nothing to show to other users and charging people subscription would not make sense.
What would be the best strategy here.
I appreciate any help I can get.
Should I show the paywall to the users at this point?
Sure, why not, as earlier you implement the feature, easier will be the changes in the future screens if you have a reusable logic.
What is the best way to make all users paid so that they can use the app even though they did not pay anything.
You need to handle the access control of each feature or screen in the App that you want to be allowed only for premium access, something like:
if(isPremium) {
return UnauthorizedScreen() or SubscribeNowScreen();
}
return PremiumFeatureScreen();
EDIT: It seems i missunderstood the question, I would focus on acquiring users in the beggining and monetizing the App with premium features instead unless you will be able to market and you company have a big name that can attract users even without have they using the app yet. You can put limitations in the app, or you can offer longer free trial period such as 1 year?
This article is quite interesting on how to monetize Applications.
What would be the best way to show the paywall to the users at this early stage.
I Recommend you to add the option to subscribe in the Options of your App, so the users can go there and subscribe if they want. Apollo is one the Apps i like the Subscription model so you can get some ideas from this App.

In app purchase Type to be used for below requirement

I am using In-app purchases in my app. After a user pays for a video, they can view it.
The problem is that I will have a huge list of videos on my server and price will vary for each video. So, every time when I post a video, do I need to add the video in iTunes Connect or is there an easier way?
A user can watch a video only a limited number of times (say 5 times) then the user needs to pay for the video again. How do I achieve this functionality? Use consumable and restore it after 5 times? Or, is there an approach for this?
Yes, you will have to create one product per consumable that you want to sell. After the user purchases the product, send the receipt to your backend and verify and store the purchase. Then notify your client and finish the transaction. You need to make sure you keep track of the consumables that your user purchased, this might be easier if you have a login system, otherwise, things get more complicated and you might need to create a restore and alias system with random user IDs. You can read more about how the system works here
Every time you start the app you would ask your server for the purchases that the specific user has made. That way you can programmatically figure out if the user can buy to watch the same video again and let it purchase another view.
It looks to me that what you are trying to achieve is not really scalable with the way the App Store IAPs are structured right now and I would really consider a subscription model rather than a consumable based app.
There's four types of In-App purchases and only Consumable fits your requirements.
You'd have to implement the logic to keep track of how many times a user can watch a given video and update this data whenever a user makes a purchase or watches a video. Ideally, you'd use a database (local or remote) to keep track of this data.
With this implementation, you would only need to register a new SKU when you want a new combination of price and number of views.
Here's an example of possible SKUs:
com.yourorganization.5dollars5views which lets a user view the selected video 5 times for $5
com.yourorganization.5dollars10views which lets a user view the selected video 10 times for $5
com.yourorganization.10dollars5views which lets a user view the selected video 5 times for $10

Stop deleting and downloading apps again to gain free access

I want to offer my app free for a period and then charge to continue using it. I understand that the way to do this is to force the user to buy an In-App product after the free period. However, if I simply record the date that the user starts using the app in the standardUserDefaults and use this to calculate when the user must buy the upgrade the user could simply delete the app when the time arrives (I assume the sandbox is also deleted) and download the app again for another free period.
First question. Is my reasoning so far correct?
Second question. Is there any way of accessing the date that an app is first downloaded?
Assuming the answers to these questions are Yes and No I have come up with the following solution.
Upon downloading the app the user is first forced to "buy" free an In-App product which then will have the date it was added to the transaction queue. This In-App product would then be downloaded for any subsequent download and I could use the date of this product as my reference date.
As I can find no reference to this problem or solutions I really wanted confirmation that this was a sound way to proceed or if there was another more standard way of dealing with the problem.
Thank you
Silas
You are not allowed to limit you app for free for a limited period:
11.9 Apps containing content or services that expire after a limited time will be rejected, except for specific approved content (e.g.
films, television programs, music, books)
If you want to risk it, you could save the date (encrypted) in keychain to make it more persistent. Just so you know, user are able to access their keychain data if they iCloud keychain sharing and are on a Mac. So if they delete the correct key or rest there device your app will fall back to the free/trial mode.
This does not seem entirely consistent with:
Communicate the value of your products to your users. Users want to
know exactly what they’re going to buy. Combine information from the
App Store, such as product prices and descriptions, with additional
data from your server or the app bundle, such as images or demos of
your products. Let users interact with a product in a limited way
before buying it. For example, a game that gives the user the option
to buy new race cars can allow users to run a test lap with the new
car. Likewise, a drawing app that lets the user buy additional brushes
can give users the chance to draw with the new brush on a small
scratch pad and see the difference between brushes. This kind of
design provides users an opportunity to experience the product and be
convinced they want to purchase it.
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/ShowUI.html
One way of letting the user interact with a product feature in a limited way is to let them use it a few times before requiring that they pay to use the feature.

iOS In-App Purchases Multiple In-App Stores

I have an App with 2 different Modes.I want each Mode to have it's own store for In-App purchases.I'm having a hard time find any policy information or info about having more than one In-App store inside the same App (that could be because it's not a problem at all).
If it's not okay to have "2" stores, would it be okay to have them be the same store and then just filter out the ones that shouldn't be available in that particular Mode?
Simply use the mode to select which of two different sets of in-app purchases are shown to the user. You are free to show or hide in-app purchases as you like, however be clear to the user about any previous purchases!
You can show what ever you want in your shop, but all users should be able in a way or another to buy the same product otherwise it can be seen as discrimination in some countries and it's illegal.
If the in-app purchases are clear functionalities of one mode and the user choses which mode he uses then I don't think there is a problem. But if you force assign a mode to a specific user without him knowing or being able to do anything about then you can have problems, especially if the functionalities are different.
And for example, I worked for some companies which use tiers for consumable (if you already purchased the cheap package, the more expensive one are shown) and this was a problem of discrimination. The solution was allowing any customer to contact support to get access to lower (or higher) tiers. Then even if it's not in the shop they have the possibility to buy the IAP if they want to.

In App Purchase: dynamically add non consumable items

I'm developing an app where the user can purchase digital maps, charts and so on. I'd like to wrap these in in-app-purchases. The thing is that I don't know beforehand how many charts there will be, as I'm getting them from another source from the net. There could be hundreds.
I have a server that periodically gets the charts from that source and stores them locally; there may appear new charts in the future or disappear existing ones. All this without manual intervention.
There are three distinct types of charts.
My first solution was to create three consumable items and let the user buy these; this was working fine but unfortunately Apple rejected it, since they require charts to be "non consumable".
But I'm quite at a loss how to implement what I want with the non-consumable type. If I create these three types as non-consumable, and the user buys one, he will get all the other charts in that group for free, since a non-consumable item can only be bought once.
The only solution I can think of is to create a non-consumable item for every single chart. But that's something I want to avoid at all costs: as it is now, the charts are periodically fetched from the remote source without any manual work on my side. I'd like to keep it that way. I don't want to manually create a new non consumable purchases every time a new chart appears.
Any ideas how to make this scalable?
I can't completely spell it out for you with code but you can handle this problem two ways:
Currency.
You do not sell non-consumable items such as maps. You sell currency. With that currency you purchase maps. The maps you feed dynamically whenever the user hits your store front. That way you only need to track a few purchase options.
The other option:
The company I worked for initially set this up very simply. Our app would launch and we would reach out for a php script that handed us back the app store IDs that we had sitting in it. At that point we'd verify them and use the valid returns. This option allowed us to change our in app purchases through iTunes Connect and then in the script and everything was great.
This is an older post, but I just had the same question and found out there is now a way to dynamically provide non-consumables by hosting the product identifier list on your own server:
Every product you sell in your app has a unique product identifier.
Your app uses these product identifiers to fetch information about
products from the App Store, such as pricing, and to submit payment
requests when users purchase those products. Your app can either read
its list of product identifiers from a file in its app bundle or fetch
them from your server.
If your app has a fixed list of products, such as an in-app purchase
to remove ads or enable functionality, embed the list in the app
bundle. If the list of product identifiers can change without your app
needing to be updated, such as a game that supports additional levels
or characters, have your app fetch the list from your server.
There’s no runtime mechanism to fetch a list of all products
configured in iTunes Connect for a particular app. You’re responsible
for managing your app’s list of products and providing that
information to your app. If you need to manage a large number of
products, consider using the bulk XML upload/download feature in
iTunes Connect.
Apple Developer In-App Purchasing Guide
I think your limit on items is something massive like 10,000 or so.
Pre-create a big number of items, add some code to check your website to see what your highest chart number is and make sure the users can only buy charts that you have.
The app downloads the chart names and corresponding product id from your server and then you're just buying a product.
Apple doesn't care if the actual product is already in the app and unlocked by the purchase, downloaded from their server or provided from your website.
Whether you have these purchased directly via IAP or through some kind of in-app "currency" you could simplify the amount of work you'd need to do in the future by using a naming system which would guarantee a unique map name for each item you want to sell. For example:
NSString *myMapName = [NSString stringWithFormat:#"%#%#%#%#", app_identifier, map_type, top_left_corner_location, scale];
This way if your server passes that information for a new map, there's a programmatic way to know what the IAP identifier should be— just make it the value of the string myMapName.
In the case where you use currency (which sounds easier than the alternative option, and is what lots of big apps out there seem to be doing) you just need to make a hash with some data in your map so that people can't guess the code you're storing in their keychain/plist and magically get all your maps without paying :)
In the case where you actually have individual IAPs for each map, sadly you do have to make an IAP for every possible map once. (But you can hire some kid to do that part for minimum wage, right? It's just data entry) They can be basic shells, though, with the actual info provided via your server as described above, once it's verified that the map has actually been purchased.
Hope this helps!

Resources