Programming

Creating an iOS web app is extremely simple, yet extremely underrated. Advantages to web apps include being able to instantly “push” updates of your app, not having to go through the Apple approval process, and multi device compatibility. Making your web app feel like a native app is not so hard, and with the following HTML tags, your app should be looking good in no time. Please note that all of the following tags go in between your HTML’s <head></head> tags. Setting the application’s icon The application icon is what the user will see when they add your web app to the home screen. <link rel=”apple-touch-icon” href=”app_icon.png”/> If you don’t want the gloss, use this instead <link rel=”apple-touch-icon-precomposed” href=”app_icon.png”/>   Setting the application’s loading image If you’ve used an iPhone app before, you know that before being able to use the application, a “splash” image shows up until the app is done loading. Setting this in your web app is super easy as well, here’s the tag you use – <link rel=”apple-touch-startup-image” href=”loading_image.png” />   Make the application “Full Screen” If you want to hide the Safari navigation controls so that your application appears “Full Screen”, the following line will do the trick. <meta name=”apple-mobile-web-app-capable” content=”yes” />   Changing status bar types iOS has several different types of status bars. Black, translucent and the default white gradient bar. If you don’t want the default white bar, here are the different META tags that can be used to switch them up Default <meta name=”apple-mobile-web-app-status-bar-style” content=”default” /> Black <meta name=”apple-mobile-web-app-status-bar-style” content=”black”  /> Black Translucent <meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent”  />   Allowing your user to scale your app If you don’t want your user to be able to pinch to zoom in / out of your app, the following tag will help you out. <meta name=”viewport” content = “width = device-width, user-scalable = no”   />

Read More

If your project is accepting user input and you’re using MySQL, you’ll probably want to take a look at data sanitation. Luckily for you, I have a really useful function that takes your user’s input and sanitizes it so that it’s safe for database use. The function: function safedata($original) { return mysql_real_escape_string(stripslashes(strip_tags( htmlspecialchars(trim($original))))); } How to use the function: $username = safedata($_POST[‘username’]); // That’s all you need! Please note that in order for this function to work properly, you’ll need to be connected to a database.

Read More

In order to setup your APN server to work with the Apple Push Notifications server, you’ll need to convert your Push Service certificates to .pem files. Some might not know how to properly go about doing this, so here we go! First thing you’ll want to do is open up Keychain Access On the left hand side you’ll see the “Certificates” section, click on it You should see your Apple Push Services certificates on the right hand side   Right click it, and click the Export option given to you. Name the this “apns-dev-cert” Now, click on the side arrow next to the name of your certificate and you should see a little key icon Right click the key icon, and export the key as “apns-dev-key” Now, open up Terminal and go to the directory you exported the certificates to. Type in the following commands (in order), providing your password when prompted. openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert. p12 openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12 openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem cat apns-dev-cert.pem apns-dev-key-noenc.pem > apns-dev.pem Go ahead and close Terminal, you’re all done.

Read More