Using UIButton for In App Purchasing - iphone

I am wondering if there is some way to make an iPhone application where when a user clicks a UIButton, it to display an alert box about the item and then gives the user an option to purchase it. I see a lot of documentation on Apple's site regarding creating a view to store all of the choices of what to buy, but I don't really want to create my application this way. In addition, do I need to have my app in the app store before I can add in-app-purchasing, or can I do it before?
Thanks for any help.
EDIT: I am attempting to make the purchase "Non-Consumable", if it makes any difference in how the button would be set up.

The way a user makes the purchase is irrelevant and can be anything you want. The real challenge is getting the in-app purchasing up and running.

Related

Embeding multiple apps in an app?

I am a newcomer to application development and I'm wondering if the concept I have can actually be created.
My concept involves creating an app that has the ability to embed another app within itself.
I'll do an example which is also a very bad one but you'll at least get the point.
Picture an app on the iphone that's called "Kwesi's app". Once you tap on it, it opens up a page with 3 icons. A facebook icon, a gmail icon and a hotmail icon. Now tap your finger on the gmail icon and instantly your gmail opens up withing "Kwesi's app" and you have full access. There is also a button in the top left corner that says "Main Menu". Once you tap the "Main Menu" icon, you go back to the three icons and can now rinse and repeat.
I hope this example is clear enough.
The question I seem to be coming back to is, would it be possible having an application that embeds or links you to other apps in that manner? I can only guess that it'd be really weird since they'd have to be installed seperately on your phone but I don't want that. I want one app that can handle an already set amount of apps within itself as the above example shows.
Thank you very much for reading and any thought would be very much appreciated.
/Kwesi
No, that is not possible in iOS for security reasons. But you have the following choices to modify your idea:
Register a protocol for the app : This will allow you to send data between applications using protocols. However, if the app wasn't made by you and doesn't have a protocol, then you can't use it.
Using this idea, it is possible to open an application. For example, opening Facebook with "fb://" or evernote with "evernote://". I am sure there are other applications that have these protocols. Just be aware that you don't have control on the application in this case. You can only open it and send data to it.
Since your example was about Facebook, Gmail. Then I would suggest using their corresponding API and build everything in your application. Many famous applications provide APIs for a fee or free usage. You have to check with each one separately.

iOS: ensure User has to input password before In-App purchase

One of the cool unsung new features of iOS 6 is the way it doesn’t ask you for a password every single time you go to make an app purchase.
( http://www.cultofmac.com/201559/re-enable-password-check-in-ios-6-to-avoid-nasty-in-app-purchase-surprises-ios-tips/#LasCHqVOtcTZxIjc.99 )
I'm writing an App for Children for a client, is there a way to ensure the user has to add his password for every in-app purchase from inside the App?
I mean, I can also show a message to the parents to change the setting, but maybe that's not what they want. Still their children shouldn't be able to buy things in the ensuing 15minutes after the parents bought something from my app.
Thanks for your help!
PS: Maybe if I could read the time since the last in-app purchase somehow and check if it's less then the 15 minutes I could show an extra alert.
The iOS API for In App purchases does not have an option to force asking for the password. I totally understand why you would want that but it just one possible with the current SDK. I also do not see Apple changing this any time soon.
It's not even your responsibility if you look at how Apple setup the In App purchases since iOS 5. Parent can just lock the ability to use in app purchases for the device it self.
You can of course make parents aware of this ability but you just can't force it.

Does subclassing a UIAlertView to accept user input go against the HIG?

I've seen a lot of answers out on SO detailing how to accept user input on an UIAlertView, but I was wondering if doing so violates Apple's iOS Human Interface Guidelines.
According to the section on Alerts,
Avoid creating unnecessary alerts... [alerts] are usually unnecessary if they... [a]sk for confirmation of user-initiated actions. To get confirmation for an action the user initiated, even a potentially risky action such as deleting a contact, you should use an action sheet.
However, I wish to use a Alert view to prompt the user to input a password, much like Apple does when a user purchases an app from App Store.
I'd appreciate any input!
As Apple does this in many locations, I don't think it violates the HIG. I can also say this with confidence because of something I learned at WWDC. I would advise you to look on the Apple Developer site under the prerelease documentation for iOS 5 on UIAlertView (unfortunately I can't say more on here since it is under NDA).
I can see how they would reject it for something their own app does such as login using an undocumented API (as said by Karithikeyan). However I think the odd alert view here and there can't harm your chances of getting in the store.(Used for input)
(To give an example of how I have used the Alert View differently without problems).
I sometimes use the alert view for my loading indicators. I get the alerview and put the indicator inside while it spins, and I have had no problems doing this either.
My advice: use it with restraint but do not fear rejection. If it seems right to use, it probably is.
As far as i know ,
i dont think so that apple will reject bcoz my one of my app released in the appstore for using a UIAlertView to prompt user to enter login Credentials ,
my vote is you can go with it!
be sure you are using addTextFieldWithValue this method to create your alertview bz this is undocumented API , you will get rejected.
so better use normal methods to design your alert!

Alert for reminding the user to rate the app

As you may have seen in some apps an alert pops up asking the user to rate the app in itunes and usually the alternatives you get to choose from is something like: Sure which opens the rate page for the app. The second option is No Thanks which closes the alert and the third option usually is maybe later which displays the alert later.
I was wondering how to do this.
I want the alert to be displayed after say the app has launched 20 times if that would be possible.
And how can I create an maybe later alternative which displays the alert maybe 15 launches of the app later?
And a final question is there a special link for the apps rate page? So when you click the sure button or whatever it will take your directly to the rate page.
I've used this: https://github.com/arashpayan/appirater. You can look at my fork as well for a specific mod I needed.
[EDIT: comment re NSUserDefaults]
I suggested this link because it is a full, working implementation of what you describe that is easily integrated into existing apps. I've used (and modified) it myself. NSUserDefaults is a general purpose mechanism for persisting app state. I agree with the others that it's a very useful thing to learn and use, it's just not a full answer to your question. If you choose to roll your own implementation of a rating system (nothing wrong with that) you will most likely use NSUserDefaults to store the relevant info.
Check out my answer for this similar question. I provide two different links you can use for taking the user to the "rate this app" screen in the App Store.
Direct "rate in iTunes" link in my app?
You can use NSUserDefaults to save the launch count (increment it in application:didFinishLaunchingWithOptions:), then save the user's choice another preference key. If the user says later, you could reset the counter back to zero.
I don't think there is a special rating link, but you can link to your app's specific App Store page. This was incorrect, as TomSwift points out; see Direct "rate in iTunes" link in my app?
I wrote a library for doing this with minimal effort on your part:
https://github.com/nicklockwood/iRate
I'd recommend using a library rather than rolling your own solution. It may seem like a simple problem but the library takes care of a whole bunch of extra stuff, like ensuring that the user is prompted for each new installed version, that they are reminded after a certain time if they decline, that they aren't prompted to go to the app store unless they have a network connection, etc.

purchasing an item from my app

I have an IPhone app.And I would like to purchase items like clothes..... through app.So tell me which one is best way?
1.can I redirect to that website using webview ? or
2.Is there any other ways to purchase it?
If I redirect to that particular website then is it taking care of the transactions security?
Any help is greatful
So you are purchasing an item from a web store through a windows application? If so, the web view would be the way to go because it will handle the ssl hopefully implemented from the website, and it should be a breeze to implement.
If this does not answer your question, please reword it in a clear manner.
Is the "store" you are purchasing from yours? while a UIWebView would do the trick just fine (using SSL of course), you would want to make sure the content is sized correctly for the iPhone's screen. IMHO, I would grab the raw data from the site and display it with native UI elements or else why just not visit the store in Mobile-Safari??
you should just use apple inAppPurchase... it was born just for your purpose and works with the same iTune-iStore user account... and apple manage it...