Johnno's Workbench - Tips, Tutorials, Domino, XPages, Java, Mobile, Appcelerator, etc

11 Aug 2014
0

Bluemix iOS Push Notifications Tutorial: Part 2 – Minimum Requirements

In this post, I’m going to quickly highlight a few requirements before we officially get going with the Bluemix iOS Push Notification Tutorial Series.

1. Mac OSX and Xcode

For those out there new to iOS Development, you cannot test and deploy iOS Applications to devices unless you do it via an Apple Operating System. While you can follow this tutorial using Mountain Lion (OSX 10.8), I’ll be using and recommend Mavericks (OSX 10.9).

Then, you will need to download Xcode. Xcode is Apple’s IDE for developing Mac and iOS Applications. The latest release of Xcode is 5, which is required for this Tutorial as we’ll be deploying an iOS7 Mobile App to test Push Notifications.

Both Mavericks and Xcode 5 are free to download and are available via the Mac App Store. Simply launch the App Store App from your Apple Operating System and search for “mavericks” and “xcode“. You will need an Apple ID to connect to the App Store.

Screen Shot 2014-08-11 at 5.52.58 PMScreen Shot 2014-08-11 at 5.53.13 PM

2. Apple Device and iOS

Unfortunately, you cannot test Push Notifications on an iOS Simulator, which would’ve been awesome. So, you’ll need an Apple Device like an iPhone, iPad or iPod Touch. I would recommend anything from an iPad 2 and up, or an iPhone 4 and up. This will allow us to deploy our app as an iOS7 Application.

So, as mentioned above, your Apple device will need to run iOS7. iOS7 is free from the App Store and definitely worth the upgrade if you haven’t done so yet. The reason I stress using iOS7 is because I haven’t had the opportunity to test the Bluemix SDKs on iOS6. I also don’t plan to as iOS8 is already around the corner.

3. Apple Developer Account

Screen Shot 2014-08-11 at 6.13.18 PM

This is sadly where some money comes in. You’ll need an Apple iOS Developer License, which goes for $99/year. Setting up the license is fairly straightforward, but could take a few days to be activated depending.

If you don’t have an Apple Developer Account as yet, but want one to follow with this tutorial series, I suggest you get it registered sooner rather than later. If we were only developing to test on an iOS Simulator, this wouldn’t be required, but because we need to test on an actual Apple Device, this is compulsory. You can either use your existing Apple ID or create a new one for the iOS Developer Account. It doesn’t matter really.

4. IBM Bluemix Account

bluemix

We’re almost done. What we’re going to need next is an IBM Bluemix account. This is free and is quick to set up. If you already have an existing IBM Id, then great for you. You can log into Bluemix with that ID and you’re good to go. Alternatively, click here to sign up.

Conclusion

With everything above set up and configured, we are ready to start developing iOS Applications, deploy them to Apple Devices and integrating them with the Bluemix Cloud.

The most difficult of all of this is setting up the iOS Developer Program. I did mine years ago and back then it required some documentation, phonecalls, etc. I’m not sure if it’s that complicated still.

In the next tutorial, I’ll be moving to video Media. I’ll be showing you step by step how to set up the necessary Apple Certificates which we’ll need for deploying to an Apple device and sending Push Notifications.

If you find yourself getting stuck with any of the above-mentioned, leave a comment and I’ll try to assist you.

Till next time :)
John
3 Aug 2014
0

IBM Bluemix iOS Push Notifications Tutorial: Part 1 – Overview

bluemix

This is a short video series that I’m planning for the very near future, on how to get the Bluemix Quickstart Push Sample Project running on your Apple devices.

Purpose of this Tutorial

While the Bluemix team do well to make these sample projects as easy to implement as possible and provide the supporting documentation and instructions, this process is quite daunting from my experience. My goal is to take you through the entire process from having very little already set up, to running the Sample Project and sending Push Notifications to your devices from the Bluemix Cloud.

Overview of Tutorial Series

The first phase of this Series will focus on iOS and will be mostly made up of short videos. Once i’ve properly tested the Sample Project for Android I will initiate the next phase.

This Series will be broken down into the following Chapters/Blog Posts:

  1. Minimum requirements for iOS Push Notification Sample Project
  2. Set up Push Notification Certificate and Provisioning Profile on Apple Dev Center (Video Tutorial)
  3. Set up and configure you IBM Bluemix Mobile Cloud Project (Video Tutorial)
  4. Set up and configure Apple Push Notification Certificate for your Mobile Cloud Project (Video Tutorial)
  5. Download and install Bluemix Quickstart Push Sample Project for iOS (Video Tutorial)
  6. Deploy and test Quickstart Push Sample Project as an iOS App on your device (Video Tutorial)

I’ll get the Chapter on minimum requirements out in the next few days and will take it from there.

Cheers for now.
John
19 Jun 2014
2

Possible fix for Error 404 when logging into Bluemix via cf

In the following Node.js Tutorial provided on the IBM Bluemix Cloud environment, you get asked to log in to Bluemix via cf (Cloud Foundry Command Line Interface) using the following command:

cf login -a https://api.mybluemix.net -o <your org name> -s <your space name>

For some reason, I kept getting the following error:

bluemix2

It seems the Endpoint URL changed, but even then, the above command didn’t work after using the new Endpoint URL. After some troubleshooting I finally managed to log in by doing the following:

  • In Terminal, enter cf login
  • API Endpoint = https://api.ng.bluemix.net
  • Provide Email and Password.

bluemix1

I hope this helps

Cheers
John

 

12 Jun 2014
0

TIP: Create global batch files for use in Terminal

I’m slowly but surely becoming a huge fan of running my development workflows through Terminal on my Mac, especially in the case of mobile development using Appcelerator Titanium. This is a quick tip to show you how to group terminal commands into batch files and have these batch files accessible anywhere when working in Terminal.

NOTE

  • I haven’t moved to Mavericks as yet, so my example below applies to Mountain Lion, but should also apply to Mavericks
  • In my example below, my batch file navigates to the required folder, builds and runs my mobile app the iPad Simulator
  • To enable/disable hidden folders and files in Finder, I recommend using Funter or Mountain Tweaks
  • You can’t double click on a hidden file to open it, you need to right-click on the file and select “Open”

Do The Following

  • Open TextEdit and add your commands to it, each command on a new line (See below what I did)

batchfile

  • Save this file and provide a file name without a suffix/file extension (i.e. file name = debugapp) and put it in a folder of your choosing. (e.g. “Users/{username}/Documents/terminalcommands“)
  • Under the “Users/{username}” folder, search for a hidden file called “.bash_profile” and open it
  • NOTE: if you can view hidden files in Finder and you don’t see the “.bash_profile” file, you will need to create it using TextEdit or something similar
  • Next, to add your folder path to the PATH Environment Variable, on a new line, type in export PATH=/Users/{username}/Documents/terminalcommands:$PATH

batchfile2

  • Save and Close
  • Restart Terminal

Test if this worked

  • You can check the $PATH variable by entering echo $PATH in Terminal
  • To run your batch file, simply enter the batch file name (e.g. debugapp) in Terminal
I hope this works for you :)
John
10 Jun 2014
0

XCode Tip: Possible fix if Application Loader hangs

I wanted to publish one of my mobile apps to the Apple App Store via Titanium Studio. The Archive was successfully created by Titanium and launched in XCode, but when I tried to distribute my mobile app to the App Store using the Application Loader, I got stuck on the following screen:

ApplicationLoaderHanging2

After waiting about 30 minutes, I cancelled the upload and started Googling for solutions. Thanks to this article, I managed to fix the issue by doing the following:

  • In Finder, navigate to “Applications”
  • Right click on XCode.app and select “Show Package Contents”
  • In the Finder Window that opens, navigate to “Contents/Applications”
  • Right click on “Application Loader.app” and select “Show Package Contents”
  • In the Finder Window that opens, navigate to “Contents/MaxOS/itms/java/lib”
  • Using a Text Editor (TextEdit / Sublime Text / etc), open net.properties
  • Check that http.proxyPort is set to 80 and that it’s unhashed (You can try the same with the https.proxyPort setting if this doesn’t work)
  • Save and Close
  • Restart XCode

ApplicationLoaderHangingAfter restarting XCode all was well with the world again :)

Hope this helps
John