Friday, May 18, 2012

Facebook iOS application url scheme problem

I am working on an iOS application that handle some url schemes. Let say that you want to allow your users to open from your app the Facebook app.


    NSURL *facebookURL = [NSURL URLWithString:@"fb://"];
    if([[UIApplication sharedApplication] canOpenURL:facebookURL]){
        [[UIApplication sharedApplication] openURL:facebookURL];
    }

This code above is working with no problem  if you have Facebook app installed on your iOS device.

Now the tricky part appears when the user has installed Superonic HD or  Supersonic and has no Facebook application on the device the code will open Supersonic game even if the user installs the Facebeook application after supersonic.

If the user deletes the supersonic game the Facebook application will still not be opened because the code will not pass the if condition.

The fix is to delete Facebook application and Supersonic game, install the Facebook application first and then Supersonic game.

So if you are an developer that uses Facebook URL scheme you know what to expect, if you are an iPhone user and you have apps that open Supersonic instead of Facebook you know that is not the application fault, but the Supersonic application that registered the same URL schemes Facebook.

If you write an application that will have an URL scheme and you think that in the future you will make it public try to choose something that is unique and that will be very hard to be copied by others. Because if Facebook used a url scheme like "facebook://" then will be hard for other applications to have the same URL scheme and even if they had the same scheme they could not say that this was a mistake and not an intended action.

Advice for those who write an application with an URL scheme try to make it as clear as possible that the scheme used it is yours. Because if all applications will use 2 letter scheme the rewrite of URL scheme it is inevitable on how many application are in store.

Hopefully Apple will impose some rule in the future for the URL scheme naming.

If you have an application and you want others to use it you can add it to the iPhone URL Schemes akosma wiki.

Saturday, March 10, 2012

Change developer and company name in Xcode 4

When you create a new project in Xcode, Xcode will add to the headers of the files the developer name, date and the copyright information as comments.

//  Created by  on 2/5/12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.

The easiest why to change this is to go to your Address Book application, identify the current user contact and edit the contact (see correct first name and last name and also company name). The current user contact has a small indication like in the following screen shot.



Address Book current user contact
After you save the contact restart Xcode and create an new class to test if every think is as desired.

This is all write if you work only for projects in the same company, but what happens when you are a free lancer and you work for multiple companies in the same time. 

Xcode allows you to set company name for each project separately. 
Open Xcode project and make sure that you have selected your project.  Expand Utilities area and in Project Document you can set Organization. This will override the  company name set in the Address Book application.

Xocde 4 Project Document


If you are developing a framework you can also set class prefix and when you will create a new file in the class name the prefix will be automatically added.

Xcode 4 New File automatic prefix




Flipster - Cool Android Facebook client



   Flipster a cool Facebook client for android phones. The main purpose of the application is the user experience, the user experience made easy and cool. The app is free and available in store so you can try it now.
   Blow I have attached some screen shots of  Flipster to convince you that the  Flipster app is cool and is a must have.




Thursday, March 8, 2012

iOS 5.1 update is released.

The iOS 5.1 is released.

In the new update they added:
 - Japanese language support for Siri
 - Photos can now be deleted from photo stream
 - Camera shortcut now always visible on Lock Screen for iPhone 4S, iPhone 4, iPhone 3GS and iPod  touch (4th generation)
 - Camera face detection now highlights all detected faces
 - Redesigned Camera app for iPad
 - Genius Mixes and Genius playlists for iTunes Match subscribers
 - Audio for TV shows and movies on iPad optimized to sound louder and clearer
 - Podcast controls for playback speed and a 30 second rewind for iPad
 - Updated AT&T network indicator
 - Addresses bugs affecting battery life
 - Fixes an issue that occasionally caused audio to drop for outgoing calls.

i

iOS 5.1 Lock Screen cammera shortcut.


Wednesday, February 1, 2012

Max OS X Upadate suports Romanian language

Today release of the Mac OS X Update added support for Romanian, Catalan, Croatian, Greek, Hebrew, Slovak, Thai and Ukrainian.
Well done Apple!

Monday, January 30, 2012

Fix iMac Win 7 black screen afther instalation

   A few days ago I wanted to install Win 7 on my 2010 iMac. After the install on first reboot on windows partition the screen was black. The problem is caused by the ati drivers that are included in windows. After some googling I have found an solution.
   First of all you need the windows drivers for your machine.  Start Boot Camp assistant in Application -> Utilities.
   Hit continue and select download the latest Windows support software for Apple
After this select Save a copy to an external drive.
Hit continue and an dialog box will appear asking you where to save the drivers.

 After you successfully download your drivers, copy the the WindowsSupport directory to an drive that is fat32 or ntfs formatted. 


   Now let's fix the black screen on Win 7 on iMac and Boot Camp.
   After the installation of Win 7 boot your machine in Lion (hold alt key to change the boot partition), mount the windows partition and delete atikmdag.sys from c:/windows/system32/drivers.
   To access your windows partition you need to install NTFS-3G and from Finder menu bar choose Go -> Go to Folder and type "/volumes".

    Now you can see your boot camp partition and make changes to the files. Go to "/Volumes/BOOTCAMP/Windows/System32/drivers" and move to trash the "atikmdag.sys" file. Be sure to back up it first.
   Now you can safely restart your machine in windows and finish the installation.
   After you finish setting up your user account settings you can install your windows drivers.