Michael Olivero
The official blog of Michael Olivero, Software Architect & Humble Entrepreneur

How to Add Apple Physical Gift Card to Passbook

Saturday, 10 January 2015 22:19 by Michael Olivero



Quick Start

Details of how this works

I had a few Apple gift cards laying around and now using apple's Touch ID more often, I wanted to place these into Passbook for safe keeping and easier access. So how do we go about adding Apple gift cards to Passbook?

First, the simplest way to add a gift card to passbook is tapping the "Add to Passbook" button when receiving a gift card over email.  It looks something like this.


However, what if you already have a physical gift card and want to add this one to Passbook?  It turns out it's not too easy or straight forward.  Some people recommend downloading the Gyft iPhone app which allows you to import many gift cards from many merchants, however I'm a little skeptical of adding them to an app from a 3rd party other than Apple.  This app, and others similar to it, require you to enter all the confidential information from the gift card into the app and transmit it over the internet to their servers.  Although I'm pretty sure these are legit applications, I still had concerns over the security of my information.  Are the connections from the app to their cloud servers secure?  How secure are the servers themselves, etc.

So I then started to investigate the URL apple generates for "Add to Passbook" button.  Part of the URL includes the card number, but the remainder of the URL seems to be some unrecognizable encoded string.  Not relenting, after some research over the web, I discovered Apple has a specific URL they use to add Apple store gift cards to Passbook.  Since this URL is hosted by apple over a secure SSL connection, I feel quite comfortable using it to add my gift cards to passbook.  The url is:


where 9999... represents the card number and AAAA... represents the PIN of the card.

When I enter this URL into Safari on the iPhone, Safari reports it as an invalid card even for a valid one. The Passbook app however expects to scan a QR code to add cards, so I then searched online for a free QR code generator and came across this open source javascript project on github1 which generates a QR code on the clients browser with JavaScript.  After reviewing the code to make sure there was no transfer of information, I used it to generate a QR code for the URL above replacing the 9999... and AAAA... with the numbers on the back of one of the Apple gift cards.  Once the QR code was generated, I then used the Passbook app to scan this code successfully adding my gift cards to passbook as shown.

I added all of my remaining cards with out issue.

I'm now embedding the generator for anyone to use as the wish here. This is pure javascript running on your browser and no information is delivered from your browser elsewhere.  Intact, the QR code changes in real time as you enter digits or letters. Simply enter your gift card number, pin number and then scan the generated QR code with passbook to add it to your passbook.




1.  http://davidshimjs.github.io/qrcodejs/

iPad Air Verizon vs AT&T vs T-Mobile vs Sprint can I use SIMM from any on another?

Wednesday, 6 November 2013 00:49 by Michael Olivero

Everyone is feverishly asking if it's possible to use AT&T iPad Air with a Verizon SIMM or vice versa, a Verizon iPad Air with an AT&T SIMM?  How about a T-Mobile on a Verizon iPad and vice versa?

First lets clarify some confusion with 3rd generation and 4th generation iPad.  While it is true you can purchase an Verizon iPad and use an AT&T ximm card in it, you will only achieve the 3G or 4G speeds available on AT&T -- not AT&T's LTE speeds.

With iPad Air (5th generation), are iPads all the same model hardware and they are only differentiated by having the corresponding telco's simm card in the device for your convenience.  To confirm, this statement here is screen shot of Apple's web site on their LTE coverage vs. iPad model.  Notice how only one hardware model of iPad Air exists for all LTE telco's on the right.


When you compare this to iPad 4th generation, there were two hardware models as shown.

So in summary, no matter which iPad Air you purchased you do not need to swap the hardware to be compatible with another carrier's LTE network in the US.  Simply get the correct sim card and activate it.

Tags:   ,
Categories:   iPhone / iPad
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Open letter to Tim Cook on saving lives with iOS7 feature to enable DND with motion

Wednesday, 22 May 2013 01:46 by Michael Olivero
From: Michael Olivero
Date: May 22, 2013, 1:43:10 AM EDT
To: scook@apple.com
Subject: Lives matter, do the right thing and lets save some lives -- it's literally in our hands to do so

Human curiosity is inevitable. Human feeling of invincibility is one of man's greatest weakness.
When we receive a message or a call while driving, some may have the will power to ignore the distraction, but most, intelligent and not, will succumb under the pressure of curiosity. This happens daily, hundreds of thousands of times, if not millions, every day on the roads across the nation and around the world.
For some time now I've been enjoying the new do not disturb (DND) feature of the iPhone.  Only a select list of people from my exception list can ring or message me during one specified interval of time -- how wonderful it has been to finally, in a passive way, reclaim my time to focus or simply sleep without interruption.
How could I passively have the same results while driving?  I know I'm on the road on certain times, say 8-9am and 6-7pm, however DND feature only allows me one time slot -- and the sleep window won by wide margin.  Even if we could specify multiple time slots within DND, the static time slots  does not take into consideration atypical windows, say a 7am commute, or other trips thought the day like lunch or simply holidays.  So, while the multiple do not disturb time windows allows for greater flexibility, we still need a more refined way of applying it passively while driving.
My proposal:
- enable option to have DND like features while in motion like driving
- allow a margin for human softness, say 5 min after last detection motion (e.g. Traffic lights, etc.)
- implement it with battery efficiency by using triangulation of cell towers (preferred) or low accuracy GPS
- allow exception list (I see this as enhanced DND, so same list from DND exception would apply)
- apply parental lock so child cannot turn it off.
This is very easy for Apple to implement. All the plumbing is already present to release this as soon as even the upcoming iOS release.  I'm not a parent yet, but as a parent I would enforce this with a parental lock. As a parent I would prefer to have the occasional inconvenience of being out of reach but yet with the assurance distraction is deferred.  Yes, there are some false positives such as being a passenger in a vehicle, but these are exceptional and hardly sufficient to justify not implementing this toggle-able life saving feature.
At the end of the day, Apple cares, and this is certainly an underdeveloped area Apple can make a huge difference much like Apple has in many others such as accessibility.
Michael Olivero
Sent from my iPad
Categories:   iPhone / iPad
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Bank Failures App 1.0

Friday, 28 December 2012 17:44 by Michael Olivero

Over the fall quarter of 2012, we created the Bank Failures app for iOS.  I thank a colleague of mine for the detailed graphics and CSV parsing library we ended up using extensively for this and other apps. The idea is very simple -- banks have been failing at a very fast pace since 2008 and there is no easy way to access this information in an organized way to search or simply filter this data by year or by state.

Since we were applying techniques in iOS development, we decided to leverage this need while at the same time applying advanced UI techniques in iOS such as UITableView among others. A recently blog covers some interesting details with UITableView's.

The following are some screenshots of the app as submitted to the Apple App Store.  In a future blog update, I will decompose the entire application from the nightly process which pulls bank data from us government web sites to the filtering, tab views, etc.

A better Siri for iPhone? - Google Voice Search for iOS

Wednesday, 31 October 2012 20:32 by Michael Olivero


Most people who know me would say I'm an Apple buff and have "Appleitus" where anything and everything about Apple is just amazing to me.  For the most part this is true, and yet few realize I actually work and program on Windows most of the time making it just that more ironic.  Despite my "Appleitus" however I have to give credit where credit is due and this happens to be with Google's latest app update for Google Search on iOS.

Google search for some time now has updated their iOS app and slowly incorporated various features from the Chrome tabs, to one touch accessibility for most of their services.  Historically it has mostly been hidden under the barrage of apps I have on my phone rarely using it as it really didn't provide me any real significant benefit over what is already available on the iOS platform -- until today.

I can honestly say, I was impressed on my first use of the voice enabled search.  Unlike Siri which first listens and then sends your audio quickly to Apple servers for interpretation, Google voice search interprets your spoken words on the fly as you speak.  Not only does it do this on the fly, it also is context aware.  For example, as you speak, it changes the previous interpreted words while using the more recently interpret words if it feels you formerly meant another word.  If you ask for Apple's stock price, it first writes the word "apples" and then changes it to "Apple's" as soon as it interprets the next word and realized you are talking about the stock price for Apple the company.

Unlike Siri, you can pretty much ask Google search anything and Google uses it's vast amount of data to not only infer what you spoke with highest probability algorithm, but also provide custom search results where you can interact with.  For example, you can ask it what movies are playing now and you get a nice interface showing you the movie covers playing in theaters now allowing you to scroll horizontally and and tapping shows the details along with the show times for the nearest theaters.


You can ask it what is day light savings time and it explains it.  You ask it when is day light savings time and it tells you when it starts and when it ends.  You can ask it for "who is sheldon" and it promptly finds the actor Sheldon from Big Bang Theory.  You ask it for "who is penny" and it also shows the corresponding actress.  Follow that with "what is a penny" and you get a nice voice description of what a penny is.

The video below carries it's own weight.  It was convincing enough that the app became part of my dock.

Categories:   iPhone / iPad
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Setting UITableView rowHeight property dynamically when reusing UITableViewCell via xib / nib

Monday, 1 October 2012 14:07 by Michael Olivero

xCode allows for multiple convenient ways for configuring the UITableView cells.  Using one of default custom configurations, specifying it in storyboard as a prototype, specifying it in a nib file which is then reused, and simply creating it in code directly.  While developing an app which makes use of the UITableView, I came across an interesting dilemma where I wanted the flexibility of using xCode's UI to configure it however I wanted to avoid certain issues each approach carries as described below.

One approach is to define each UITableViewCell as a prototype of each UITableView directly in storyboard as shown below,

however if there are going to be multiple UITableViews displaying cells in a similar fashion, the inclination is to configure them repeatedly in each UITableView.  This is very repetitious and may even lead to inconsistencies if one is not careful and generally is considered bad programming practice similar to copying a pasting an entire method just to make one small modification within.  One can improve upon this approach by inheriting a common base UITableView class where the configuration is specified in code, however this defeats the flexibility of using xCode's UI to custom configure the UITableViewCell's various sub views.

Another approach is defining the UITableViewCell in a separate nib / xib file, you can then register the nib and reference the UITableViewCell for reuse accordingly from any UITableView controller.  This method retains the configurability of the UITableViewCell via the xCode interface as shown below.


When reusing the UITableView cell in this fashion however, most online examples indicate to register the nib file for reuse and then dequeue as usual to populate the data for each individual cell.  The problem here is, the UITableView's rowHight property is not updated automatically as it is when one specifies the UITableViewCell as a prototype and at run time, you may see something like this:



Many online blogs emphasize the height should be specified as part of the cell construction while executing with the cellForRowAtIndexPath method within the UITableViewController.  The problem I have with this solution is quite frankly, even though perhaps only 10 or actual cells will be constructed and then reused, this code is repeated unnecessarily for those 10 or so times.

The easier route is simply to specify a fixed height in the nib file, say 60 and then specifying the same 60 points in the UITableView's rowHeight property as shown in both images below.



 This will produce the balanced height we are seeking as shown below:


While this has improvements on reuse as we will have consistently looking UITableViewCell's throughout our various controllers and retains the ability to configured and edited via the xCode UI, it still has the ill effect of having to maintaing the rowHeight in two or more different places whenever the height changes and is not yet to my satisfaction of cleanliness.

Further research online reveal many blogs emphasizing the implementation of the heightForRowAtIndexPath method for the UITableViewController. This method is great when there are UITableViewCells with dynamically varying content which need varying height for each cell, however this is not the case here. The problem with this approach continues to be the repeated calls for a UITableViewCell which doesn't vary in height.  Furthermore, in the various examples I found not only is the height specified repeatedly, but registration of nib is repeated as well and some additional lines of code which could also be avoided.


The Solution:

Since in this particular example, the UITableViewCell height will remain the same across all sections and rows and UITableViews, it makes sense to programmatically tell the UITableView it's rowHeight much like we would via the xCode UI, however do so once and be done with it.  The value should also be extracted programmatically from the UITableViewCell residing in the nib / xib file so if the height is ever changed in the future via the design tools, the UITableView is automatically adjusted accordingly without any further intervention in the code.

To accomplish this, the logical place to put such code would be in the UiTableViewController's viewDidLoad method as this code is executed once regardless of the number of rows to rendered.  In this method, we simply load the nib by name, register this nib with the UITableView, and then simply set the rowHeight of the UITableView to match the height of the first view in the nib which we already know is simply a UITableViewCell.


    UINib* nib = [UINibnibWithNibName:@"ADTableViewCell"bundle:nil];

    [self.tableViewregisterNib:nib forCellReuseIdentifier: [ADCustomCellIdentifier]];

    self.tableView.rowHeight = ((UITableViewCell*)[[nib instantiateWithOwner:selfoptions:nil] objectAtIndex:0]).bounds.size.height;


In the example code above, we additionally reference a predefined class method for the cell identifier we conveniently placed in the strongly typed class representing the UITableViewCell with [ADCustomCell Identifier].

Tags:   , , ,
Categories:   iPhone / iPad | Software
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

The New IPhone's or iPhone 5 New Features With Illustrations

Wednesday, 15 August 2012 01:44 by Michael Olivero

With the next iPhone just around the corner, I've decided to consolidate all the rumors i have read in the past 6 months into a concise list of the ones which are most certainly coming to the iPhone.


The new iPhone will have a 4" screen by increasing the height and making it a true wide screen 16:9 display

All iPhones up to and including the 4S have had the similar aspect ratio of the original iPhone released back in 2007.  The new iPhone for 2012 will have a slightly longer profile with a total resolution of 640x1136.  While this may seem to make the phone significantly longer and awkward, it was accomplished efficiently and with only increasing it's physical length every so slightly.  If you look at your current iPhone, the large areas where the home button and speaker reside are reduced by about 40%.  It not too obvious in the side by side comparison below as this was just a mockup using an existing iPhone 4S modified.  With this optimal use of space, along with a slight increase in height, Apple is able to add a 4" screen while retaining the similar look & feel of the already great iPhone 4S.

The new iPhone will have a unibody case.

Unlike the previous two iPhones, where a revolutionary stainless steel frame acts as the main support for the phone while doubling as an antenna for the various services, the new iPhone will sport a unibody case.  While the rumors don't solidly say this case is made of Liquidmetal, I will go on record and almost bet the farm on it being based on Liquidmetal.  The reasons are outlined in a separate blog to be posted soon.  Liquidmetal uses a very unique manufacturing method which allows for building very precise pieces out of molds much like plastics.  This method, while challenging to work with metals, can produce more intricate pieces than traditional CNC machining of metals or aluminum.


The new iPhone will sporta faster processor

Some competing smart phones are already using quad-core cpu's and the iPad3 introduced in early 2012 uses Apple's A5X CPU which is a dual-core cpu with quad-core graphics subsystem.  This CPU is necessary to push the extra pixels the iPad3 requires (4x as much as the previous iPads).  If this CPU is used for the next iPhone, it would be sufficiently powerful for all of the iPhone's needs as it's resolution is significantly lower and consequently making the next iPhone that much more faster on graphics when compared to the iPad3.  It's possible Apple may introduce the quad-core A6 processor, but this might simply be an overkill making battery suffer -- a high priority in a mobile device with aconstrained battery such as the iPhone and other smart phones.


The new iPhone will sport a thinner profile

The new iPhone, with the screen flush, will be 7.6mm thin.  If you want to compare how thin this is when looking at the current iPhone, imagine an iPhone4 or 4S with both of the glass pieces on the back and front removed.  This is approximately how thing the next iPhone will be and it's significant.  How can they do this without shorting battery life?  Two ways, one is of course ever improving battery technology and secondly by using an in-cell panel for the screen.  This simply means the screen and touch technology are built together reducing the space needed to fit both technologies separately as with previous generation iPhones.  Apple's new supplier, Sharp, also confirmed shipments of this new screen a few days ago.


The new iPhone will utilize next generation cellphone technology called LTE (Long Term Evolution)

The first generation iPhone utilized EDGE, which was limited to about 128Kbs speeds and was good for emails and basic data, however wasn't good for general web surfing.  The original iPhone ushered in the mobile data era and not too much later, the next generation iPhone (iPhone 3G) ushered in the next generation mobile data - 3G.  As cellphone companies, particularly AT&T, struggled to keep up with data demands it was clear higher speeds where necessary.  In the US, HSPA (High Speed Packet Access) became the GSM standard for 3G on AT&T's network and later, with the iPhone 4S, introduced yet an upgraded version termed HSPA+ which provides very high speeds under ideal conditions.  The HSPA+ standard however was still not efficient and yet a newer, data oriented, transmission technology was necessary -- LTE.  With LTE (Long Term Evolution), we are littering entering the broadband era for mobile devices.  The speed at which your mobile devices operate is largely indistinguishable from your home broadband speeds with low latency and large throughput.  Early LTE chipsets, similar to initial 3G chipsets, where power hungry and significantly drained the battery when compared to the previous generation 3G and EDGE respectively.  With iPhone5, the LTE chipsets have improved significantly, even within the last 6 months, making LTE more suitable.  Verizon has the largest deployment of LTE, while AT&T has the largest deployment of HSPA+ with LTE available in about 25% of the population Verizon covers.  AT&T however claims more consistent speeds when switching in and out of LTE while Verizon will allegedly switch to their slower 3G technology.  Incidentally, for those which may require voice and data use simultaneously, Verizon's 3G has a small imitation where data cannot be used while on a phone call unlike AT&T's.  The choice of carrier for the new iPhone has become that much more difficult to decide.  Regardless if you choose Verizon or AT&T, you'll have access to the latest LTE speeds where available.

New Smaller Dock Connector

The next iPhone will certainly have a smaller dock connector.  Lots of miniaturization has occurred in the last ten years and retaining same 30pin dock connector now certainly start to impact the space utilization in modern devices.  As a result, Apple has little choice but to update the dock connector to not only support modern protocols such as USB3 or Thunderbolt, but also from a footprint perspective making it smaller.  The actual pin out is unknown with certainty, but you can expect it to be smaller and fit universally in either orientation unlike the existing dock connector which fits only in one orientation.


Relocated Microphone Jack

When you hold your phone in your hand, you hold it upright.  When you place it in your pocket, you usually place it top down while holding it in the same orientation.  If you have the audio headphones plugged on the top, as with previous generations, this would require you to reorient your phone in your hand prior to placing it in your pocket so the headphones remain in the upward position.  With the next iPhone, the headphone jack is relocated to the bottom and this particular scenario & inconvenience is alleviated.


Next Major Version of iOS, iOS6

  • As traditional with all previous releases of iPhone, the next iPhone will certainly be released with iOS6.  There are many interesting features of iOS6.
    1. New Maps application utilizing SVG graphics for better realtime scalling
    2. Turn by Turn Directions
    3. New Alarm features such as wake up to iTunes song
    4. New Bluetooth features such as specific group synching rather than all contacts
    5. Deeper Twitter integration as well as Facebook as an OS feature API available to all applications
    6. New metallic-like refresh in many areas such as phone & iPod apps, etc.
Tags:   , ,
Categories:   iPhone / iPad
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Microsoft Surface with VaporMG and Liquidmetal for Apple Mobile devices

Tuesday, 19 June 2012 18:25 by Michael Olivero

Today's announcement, aside from all the bells and whistles of their unique approach in making a content creation device as much as a consumption device, was the use of VaporMG (pronounced Vapor Mag).  When I saw the detailed presentation by Panos Panay, the general manager of Microsoft Surface, I was intrigued at his continual use of the word perfect and the variations there of predominantly centered around the material, the feel and precision of it.

The first thing that came to mind after seeing VaporMG is the strong resemblance to Liquidmetal Apple is expected to use soon.  In the case of Surface, magnesium, is injected into molds allowing for very high precision craftsmanship at unbelievably small thicknesses such as .65mm in the case of the Surface -- a similar process and technology is also applied with Liquidmetal.  I'm not certain if this was a mere coincidence, but on the same day the Surface was announcement, Apple decided to extend their exclusive license to Liquidmetal for another 2 years.  Apple originally acquired an exclusive license to Liquidmetal back in 2010 for mobile devices and is highly rumored to be used in the next iPhone.  Recent leaks of a very thin metallic like enclosure, if legitimate as many have been in the past, provides some support for this rumor, however we will not know for sure until Apple releases their iPhone 5 around October 2012.

I praise Microsoft for taking a full frontal attack on mobile.  I praise them for thinking out of the box in creating a content creation device as much as a content consumption device.  I have to admit, many times I've wanted to create a blog entry and didn't quite find the right convenience to do so with the screen-based touch keyboard and even found it somewhat inconvenient to pair up the bluetooth keyboard as well.  Having the keyboard integrated into the cover seems like a novel tradeoff to both scenarios.

In summary, competition is great for innovation and I look forward to awesome Liquidmetal or VaporMG products to come in the near future from both companies.

Some references:


Apple Extends Exclusive License to Liquid Metal: 

iPhone5 Liquid Metal Enclosure Leak: 

Tags:   , , ,
Categories:   iPhone / iPad
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Apple Siri Commands - Friends

Tuesday, 12 June 2012 20:44 by Michael Olivero

Here are some Siri sample to interact with Friends

Checking Up on Friends

  • Where's Mike?
  • Where is my sister?
  • Is my wife home?
  • Where are all my friends?
  • Who is here?
  • Who is near me?
Tags:   , , ,
Categories:   iPhone / iPad | Mac
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Apple Siri Commands to interact with the Address Book

Tuesday, 12 June 2012 18:51 by Michael Olivero

Here are some Siri sample to interact with the Address Book

Query Contacts with Siri

  • What's Michael's address?
  • What is Mary Jane's phone number?
  • When is my wife's birthday?
  • Show Rick's home email address

Finding Contacts with Siri

  • Show Jason Smith
  • Find people named Rick
  • Who is Michael Rodriguez

Relationships with Siri

  • My mom is Martha Smith
  • Michael Smith is my brother
  • Call my brother at work
Tags:   , , ,
Categories:   iPhone / iPad
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed