Serving ads only for users who didn't buy application [duplicate] - ios

This question already has answers here:
Change paid app to free but know if user previously purchased it
(7 answers)
Closed 8 years ago.
I'm switching my iOS app from priced to free and adding ads instead. The issue is, some people already brought the app, and it would seem like a rip off if they start getting ads with the update. Is there a way I can check whether someone has already brought the app, and make it so that ads aren't delivered to them?

As far as I know there is no way to do this. You can't recognize point in time when user bought the app.
You can release (still paid) version that would record the fact the user has bought it somehow - either by marking it in defaults or sending device ID to your server. But this doesn't cover 100% cases. When old user completely deleted and install app again - or install the app on the new device - you will still serve them ads.

When you submit your new app, add a test with the version of your App.
Remove the ads for users who have a version less than the new one.
You can use this code to find the build version :
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:#"CFBundleShortVersionString"];

Related

How do I replace an old expired iOS app with a new app that I built from the ground up?

I have what I believe to be a pretty unique situation and I can't seem to find a solution online. The problem timeline:
4 years ago I paid a developer to build/upload an app to the iOS App Store for me under my own developer account.
Over the years it became outdated and this April it was kicked out of the App Store
I took some online courses this year and rebuilt the app from the ground up.
I would like to post my rebuilt version to the App Store - completely fresh like it's a brand new app (because it basically is)
A couple more things to consider...
I used Swift vs the original Objective-C that the developer used.
I used UserDefaults instead of what appears to be iCloud. (the dev account seems to be littered with permissions for things I don't intend to use - so advice on how to get rid of all of the weird stuff I don't use would be helpful, too)
I also have a different but similar bundle identifier (it replaces "RandomRuby" with "Random-Ruby") that Apple's App ID registration system seems to not like.
The level content and game play are the same - but I have no idea how to figure out what level the previous users were on. (which I'm ok with if it's ethical to make people start over).
It had In-App purchases (they could purchase consumable "Rubies" to use for hints and there was an "Ad Free" upgrade option. The new app doesn't use ads - it just has consumable "Rubies" for monetization). I have no plan to add ads back in - so I imagine a complete reset would be ok here, too? Again - is that ethical?
With all of this context - my question is...
How do I upload a completely-rebuilt-from-scratch app with the exact same name from the exact same company as an expired app through the iOS Developer system? Is this even possible? I'm having a hard time figuring out where to start. I can't even get past creating an App ID.
To update an existing app in your Apple Developer account you only need to use the same BUNDLE ID (e.g. com.apple.keynote) in your Xcode project and a higher version/build number. Everything else is not relevant.
Your previous iOS APP is bounded with the Apple Developer account when it was submitted. And the APP name is unique, just like anyone else may not create another app named 'Facebook'.
So, if the Apple Developer account was not yours, you are in trouble. You need to ask the previous programmer to transfer the APP to you.
If the Apple Developer account was merely expired, and you can prove that the account belongs to you, I guess you can contact Apple Support for help.

iOS – Bundle version incorrect when being sent to analytics backend

I'm going to try and explain this in as simple a way as possible, but feel free to comment if I miss anything or forget to mention anything important.
I'm currently developing an iOS app and I'm collecting analytics on the things that the users are doing while using the app. One of the things I keep sending with every "event" is the app's bundle version to a backend. The way I'm obtaining this version number is using the line
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:#"CFBundleVersion"];
According to my understanding, this obtains the bundle version from Info.plist. When I try NSLoging the variable appVersion, I get the correct version (e.g. 1.2.3).
During testing, I had several users beta testing the app through HockeyApp, and I found that people who are pushing events to the backend through HockeyApp send an incorrect version number. I assumed this was related to Hockey, as if I try to test the app on the simulator or on devices I've pushed the app to through Xcode, I get the correct version number (1.2.3) in the backend.
I've pushed the app onto the app store and it's currently being used by several users, but I keep getting the wrong version number. Sometimes I get 2.1, a lot of times 4.0.
I'm now baffled, and I'm not sure where the problem is at all. Has anyone faced a similar problem in the past?

Query app id of current app on iOS [duplicate]

This question already has answers here:
Is it possible to get app id from iOS application programmatically?
(7 answers)
Closed 8 years ago.
Assume this scenario, there are several apps which will use shared feature. THis feature want to know what's current application's app Id.
My question is: Is there a way to get the application's app Id programmatically. Or What I need do is always find the app id in iTunes and hard coded into my app?
Edit:
I do not make the question clear enough. the app id for twitter in app store is 333903271 and I can use this link(itunes.apple.com/us/app/twitter/id333903271?mt=8&uo=4) to open twitter in appstore. I want this app id, not the bundle id. thanks.
That is a feature of the app store, not the OS. For example, until you setup your app in the app store, you won't have this ID. Instead, once you know the id, you should store it in your App's Info.plist then you can just query it via NSBundle objectForInfoDictionaryKey:.
As long as all your apps store it using the same key, your shared component can rely on it being there.
[[NSBundle mainBundle] bundleIdentifier] should get you what you're looking for.

Making a Paid version of a Free app [duplicate]

This question already has answers here:
How do I manage building a Lite vs Paid version of an iPhone app?
(6 answers)
Closed 8 years ago.
I have made a free version of an app (not in the app store yet) with ad banners and some features.
But I want to make a paid version of this app as well with no ads and more features.
Do I duplicate the app and make 2 separate copies of the app (free and paid) and submit them separately to the app store or is there a way of coding the paid version in to the current free version
I think it may have something to do with targets but i'm not sure
help would be appreciated
You should have a single app if you ask me, however, if you do so, you will need to differentiate paid users from free users. You most probably have a database or will have a database where you store which user have paid for the app. If so, then you can authenticate your users and display the free version for users who have not paid for the app, while you can display the paid version for users who have paid.

How to prevent iOS app from running until the user downloads the newest available version?

I'm new to Xcode so I'm not sure of all the commands available to me. Is there a specific technique that will allow me to prevent the app from being used if there is a new update available in the App Store and the user has not downloaded it?
I am thinking
[check version of app] -> [check latest version of app in App Store] -> [if not equal, dialog that tells them to download the required update] -> [OK button on dialog sends them to the App Store to download update]
Are any of these possible? I've seen it done in "The Simpsons: Tapped Out" game but I'm not sure how to manage it myself.
If it's really complicated, please just let me know it can be done and point me in the right direction and I'll do my own detective work. I'm not wanting easy answers but I do want to know that I'm not chasing after a dead end.
You should have a server that is answering requests from your app. In your server-script you replay the last version of your app and possibly what the app should do.
In your app you open an HTTPRequest to this url and handle the reply. The remaining question for your code is what should be done if your server is not reached (e. g. no network connection when starting the app).
Be careful in a userfriendly handling as otherwise Apple might refuse your app.
You'll want to put the most up to date version number on a server that you check against.
If the server reports that there is an update, gently let the user know and provide an option to update. If you prevent the user from being able to use the app without the update, you could get into trouble with Apple (and your users).
If you can't access the server, assume you're up to date and do nothing.
When a new version is released on the store, wait 12-24 hours before updating the number on your server as it can sometimes take that long for an app update to propagate to all of the store servers.
Be sure to take into account reasons why the user can't upgrade. Such as is your new version able to run on the users version of the device (iOS 6 when you go iOS 7 only etc). This can be handled by having more information on your server than just the current version number. Perhaps have a plist with compatibility info.
Here's some code you can use to get your version number in the app:
NSString* version = [[[NSBundle mainBundle] infoDictionary] objectForKey:#"CFBundleShortVersionString"];
NSString* build = [[[NSBundle mainBundle] infoDictionary] objectForKey:#"CFBundleVersion"];

Resources