How to restore your single In-App Purchase in iOS

This is an addition to my previous article. To allow uses to restore their In-App Purchases you can expand on the previous article and include the following method in your Shop class. This needs to be public so it can be called from your main class: – (BOOL)restoreThePurchase { // verify/refresh receipt here (even though […]

How to create a single In-App Purchase in iOS 7

This “simple everyday” feature has caused me many headaches on many occasions. Implementing a simple unlockable feature isn’t as straightforward as it perhaps could be – and I’ll make it as simple as possible (so I won’t forget next time I need to add it to an app). In this example we’re going to have […]

How to open the LinkedIn App from your own iOS App

Here’s a sample action that tries to open a LinkedIn Profile with the LinkedIn App. If it’s not installed, it opens a link to the profile in Safari. If that doesn’t work it gives a log message (please handle appropriately in your own code): – (IBAction)openLinkedIn:(id)sender { // open the LinkedIn App if (![[UIApplication sharedApplication] […]

How to create a Twitter Follow button in your iOS App

Much like the Facebook Like button we can create a Twitter Follow button. It’s easy to create a HTML button which we can load into a small UIWebView (about 40 pixels high): – (void)viewDidLoad { [super viewDidLoad]; // add Twitter Follow button in a web view NSString *twitterFollowButton = @”<a href=’https://twitter.com/versluis’ class=’twitter-follow-button’ data-show-count=’true’ data-size=’large’>Follow @versluis</a><script>!function(d,s,id){var […]

How to open the Twitter App from your own iOS App

Opening the Twitter App is pretty much the same as opening the Facebook App discussed earlier, just the URL scheme is different. This is how we open Twitter so people can follow the user (me in this case, versluis). If the call is unsuccessful, we’ll try to open the Twitter page in Safari. And if […]

How to open the Facebook App from your own iOS App

Thanks to Custom URL Schemes, iOS Apps can register themselves and be “woken up” by another app (such as yours). Many can even accept parameters if you do. Opening another app happens via the UIApplication class, and an NSURL as parameter. Here’s how we open the Facebook App and direct it to open my Pinkstone […]