Showing posts with label iPhone. Show all posts
Showing posts with label iPhone. Show all posts

Thursday, January 7, 2010

Opening The Facebook App To Your Facebook Fan Page

Opening The Facebook App To Your Facebook Fan Page

Guest author Robert Strojan (@blackoutrobb) is the founder and lead iPhone app developer at Blackout Labs. He is also a speaker at the 360|iDev Conference in April.

In September I wrote a post on iPhoneDevTools.com about opening the Facebook iPhone app from within another app or from the web with the Facebook app’s custom URLs. I got a lot of questions about how to open the Facebook app directly to a fan page or application page allowing an app’s users to add themselves as Facebook fans.

The most widely used method of opening a Facebook fan page is to open it in Safari or an in-app browser. The issue with this method is that iPhone users likely use the Facebook iPhone app and, consequently, won’t be logged-in in the browser. The extra hurdle of logging in is a significant factor in app-to-Facebook-fan conversion rates. It would be nice to open the Facebook app directly to a fan page allowing the user to add themselves as a fan in a single tap. Here’s how:

The Facebook app is accessible via the custom URL protocol ‘fb://’. There are several domains you can add next to access different parts of the Facebook app. One is ‘profile’. A specific profile can be opened by adding the unique ID of the fan page as a path to the domain. Here’s how I open my recently created Blackout Labs fan page:

I got my Blackout Labs Fan page unique ID by looking at the address bar of my Fan Page:

Some pages won’t have an ID in the address bar. For those, click on your Fan Page profile pic and on the profile pic page you’ll see the parameter ‘id=’ in the address bar which indicates your fan page’s ID.

Now I can open the Blackout Labs fan page directly in the Facebook app with URL fb://profile/210227459693. If you’re currently browsing on the iPhone, tap that link to open the Facebook app directly to my fan page. Here’s what you’ll see:

The Objective-C code is simple: Open the URL with an instance of ’sharedApplication’. An if-statement ensures that the fan page will open in Safari if the user doesn’t have the Facebook app installed.

NSURL *fanPageURL = [NSURL URLWithString:@"fb://profile/210227459693"];  if (![[UIApplication sharedApplication] openURL: fanPageURL]) {         //fanPageURL failed to open.  Open the website in Safari instead         NSURL *webURL = [NSURL URLWithString:@"http://www.facebook.com/pages/Blackout-Labs/210227459693"];         [[UIApplication sharedApplication] openURL: webURL]; } 

The method also works for Facebook apps. If you’ve created an iPhone app that utilizes Facebook connect, then you already have a fan page setup for your app. You can use the same method above to open your Facebook Connect application’s fan page.

Now I wish I could end it there. I’m not affiliated with Facebook and unfortunately, this information hasn’t yet been officially released by Facebook; possibly because the URLs are not yet stable enough for use. I’ve actually encountered a couple bugs in the process of using the URL including the “Become a Fan” button not appearing consistently and my fan page details not showing up every time the app is opened via a custom URL. Furthermore, the URLs aren’t guaranteed to be supported in future versions of the Facebook iPhone app. In other words, make sure you test your implementation with your Facebook fan or app page, and weigh the risks of possible bugs and future incompatibility with the potential of increased fan conversion rates.

Thanks to Robert for contributing this piece! Want to contribute something? Send your topic and a writing sample to dan at mobileorchard.com

Wednesday, December 30, 2009

Submitting an iPhone App to the App Store

Submitting an iPhone App to the App Store


This tutorial assumes you have signed up for the iPhone Developer
Program and have access to the iPhone Dev Center as a Team Agent. It
is based on the instructions available in the iPhone Dev Center -
iPhone Developer Program Portal,developer.apple.com/iphone

Step 1: Generate a Certificate Signing Request

On your mac, in your Applications folder, open the Utilities folder
and launch Keychain Access.
In the Preferences menu, set Online Certificate Status Protocol (OSCP)
and Certificate Revocation List (CRL) to "Off".
Choose Keychain Access -> Certificate Assistant -> Request a
Certificate from a Certificate Authority.
In the User Email Address field, enter your email address. Please
ensure that the email address entered matches the information that was
submitted when you registered as an iPhone Developer.
In the Common Name field enter your name. Please ensure that the name
entered matches the information that was submitted when you registered
as an iPhone Developer.
No CA (Certificate Authority) Email Address is required. The
'Required' message will be removed after completing the following
step.
Select the 'Saved to Disk' radio button and if prompted, select 'Let
me specify key pair information' and click 'Continue'.
If 'Let me specify key pair' was selected, specify a file name and
click 'Save'. In the following screen select '2048 bits' for the Key
Size and 'RSA' for the Algorithm. Click 'Continue'.
The Certificate Assistant will create a CSR file on your desktop.

Step 2: Submit a Certificate Signing Request for Approval

After creating a CSR, log in to the iPhone Developer Program Portal
and navigate to 'Certificates' > 'Development' and click 'Add
Certificate'.
Click the 'Choose file' button, select your CSR and click 'Submit'. If
the Key Size was not set to 2048 bits during the CSR creation process,
the Portal will reject the CSR.
Upon submission, Team Admins will be notified via email of the
certificate request.
Once your CSR is approved or rejected by a Team Admin, you will be
notified via email of the change in your certificate status.


Step 3: Download/Install Certificate on your machine

Upon CSR approval, Team Members and Team Admins can download their
certificates via the 'Certificates' section of the Program Portal.
Click 'Download' next to the certificate name to download your iPhone
Development Certificate to your local machine.
On your local machine, double-click the downloaded .cer file to launch
Keychain Access and install your certificate.
Certificate is installed on your MAC now the next step is create a App
ID. (Note:You have to follow this step only once and later you don't
have to make certificates for your other applications.)

Step 4: Create an App ID

Log in to the iPhone Developer Program Portal and navigate to 'App
IDs' and click 'Add Id'.
In "App Id Name" enter the name of your application (i.e iphoneapp)
and in "App Id" enter something like com.yourdomain.applicationame and
click on Submit
Write down the "App Id" because you will enter this into the
Info.plist file for your app under "Bundle identifier" tag

Step 5: Create a Provisioning Profile

In the iPhone Developer Program Portal, navigate to 'Provisioning' >
'Distribution' and click 'Add Profile'.
Now select "App Store" in "Distribution Method"
In "Profile Name" type your application name, which will be your
provisioning profile name as well.
In "App ID" select the app name which you created in Step 4.
Download the Provisioning Profile.

Step 6: Import Provisioning Profile into Xcode
Locate the Provisioning Profile on your mac in Finder and drag it to
the XCode icon on your dock.

Step 7: Compile your app for distribution on app store
  A. Launch Xcode and open your project.
  B. If you have not already done so, drag the Distribution
Provisioning Profile downloaded from the Program Portal onto the Xcode
or iTunes icon in the dock (or, drag into
'~/Library/MobileDevice/Provisioning Profiles' directory.)
  C. Open the Xcode project and Duplicate the "Release" configuration
in the Configurations pane of the project's Info panel. Rename this
new configuration "Distribution".
  D. Duplicate Release Configuration In the Target Info window,
select the 'Build' tab and set the 'Configuration' to 'Distribution'
  E. Change the Code Signing Identity In the Target Info window,
navigate to the 'Build' pane. Click the 'Any iPhone OS Device' pop-up
menu below the 'Code Signing Identity' field and select the iPhone
Distribution Certificate/Provisioning Profile pair you wish to sign
and install your code with. Your iPhone Distribution certificate will
be in bold with the Provisioning Profile associated with it in grey
above. In the example below, 'iPhone Distribution: Example Corp, Inc.'
is the Distribution Certificate and 'My App Store Distribution
Provisioning Profile' is the .mobileprovision file paired with it.

     Set the 'Configuration' to 'Distribution'

     Note: If the private key for your iPhone Distribution
certificate is missing, you will be unable to select the iPhone
Distribution Certificate/Provisioning Profile pair and you will see
the following. Importing the private key for your iPhone Distribution
certificate will correct this.

     Import the Private Key
  F. In the Properties Pane of the Target Info window, enter the
Bundle Identifier portion of your App ID. If you have used an explicit
App ID you must enter the Bundle Identifier portion of the App ID in
the Identifier field. For example enter com.domainname.applicationname
if your App ID is A1B2C3D4E5.com.domainname.applicationname. If you
have used a wildcard asterisk character in your App ID, replace the
asterisk with whatever string you choose.

     Enter the Bundle Identifier

     Here are example App IDs and what should be input into the
Identifier field in Xcode.
         * Example App ID: A1B2C3D4E5.com.domainname.applicationname
           Identifier to enter in Xcode: com.domainname.applicationname

         * Example App ID: A1B2C3D4E5.com.domainname.*
           Identifier to enter in Xcode:
com.domainname.<name_of_application_or_suite>

         * Example App ID: A1B2C3D4E5.*
           Identifier to enter in Xcode:
<full_reverse_dns_company_and_application_or_suite_name>

  G. In the project window, select the Distribution Active
Configuration from the overview popup and set the Active SDK to the
desired Device.

     Select Active Configuration
     For App Store Distribution, skip to Step 12. For Ad Hoc
Distribution, complete the following:

  H. In the File Menu, select New File -> iPhone OS -> Code Signing
-> Entitlements.
  I. Code Signing Entitlements Name the file "Entitlements.plist" and
click 'Finish'. This creates a copy of the default entitlements file
within the project.
 J. Entitlements.plist File Select the new Entitlments.plist file and
uncheck the "get-task-allow" property. Save the Entitlements.plist
file.
 K. Set-Task-Allow Select the Target and open the Build settings
inspector. In the 'Code Signing Entitlements' build setting, type in
the filename of the new Entitlements.plist file including the
extension. There is no need to specify a path unless you have put the
Entitlements.plist file somewhere other than the top level of the
project.
 L. Specify new Entitlements.plist File Click 'Build'. (Note: Your
binary must contain a flattened, square-image icon that is 57x57
pixels. This icon is displayed on the iPhone or iPod touch home
screen.)
 M. Highlight the app located within the "Products" sub-folder and
select 'Reveal in Finder' from the Action popup.
 N. Reveal in Finder Use the compress option in Finder to create a
.zip file containing your application. Be sure to compress only the
.app file only and not the entire build folder.
     Create a .zip archive. You will submit this binary to itunesconnect.
  O. To confirm your build was successful, check for the following:

  -->Open the Build Log detail view and confirm the presence of the
"embedded.mobileprovision" file. This will take you to the line in the
build log that shows the provisioning profile was successfully called.
Ensure that the embedded.mobileproviion is located in the proper
"Distribution" build directory and is not located in a "Debug" or
"Release" build directory. Also, confirm that the destination path (at
the very end of the build message) is the app you are building.
    --> Build Results Search for the term "CodeSign" in the Build Log
detail view - this will take you to the line in the build log that
confirms your application was signed by your iPhone Certificate.
     Build Log

If your project is lacking any of the above files or pointing to the
wrong directory, do the following:

  a. Select the Target and open the Build Settings Inspector. Confirm
you are in the Distribution Configuration.
  b. Delete the Code Signing Identity: iPhone Distribution: COMPANYNAME
  c. In the Xcode Build Menu, select Clean all Targets.
  d. Delete any existing build directories in your Xcode project using Finder.
  e. Re-launch Xcode and open your Project.
  f. Re-enter the code-signing identity iPhone Distribution:
COMPANYNAME in the Target Build Settings Inspector.
  g. Rebuild your Project.



Step 8: Uploading Your Binary
In your browser typehttps://itunesconnect.apple.com/ (this website is
very slow over https) and login using your iphone developer account.
Click on "Manage Your Account" > "Add Application"
Be sure to be prepared to upload the following items:
A. App Name ( must be uniqe)
B. App description
C. App Category
D. URL for questions about your app
E. 512×512 px icon
F. Screen shots: 320×480 or 320×460 px size. (At least 1, up to 4)


Sent from my iPhone

Wednesday, October 21, 2009

Another Great Legal Resource for iPhone App Developers

The following was posted in a LinkedIn user group I subscribed to:

"By examining the iPhone SDK Agreement, Apple’s End User License Agreement, and federal copyright and trademark registration, this guide provides an introductory overview of the common legal issues surrounding iPhone Application development, and the measures developers can adopt to minimize liability and maximize protection of their intellectual property rights. This article was recently distributed at the Voices that Matter: iPhone Developers Conference in Boston. Click here to read the article: http://www.rmchale.com/publications/APracticalLegalGuidetoiPhoneApplicationDevelopment

Sunday, July 19, 2009

Some Legal Issues

As the Internet begins its transfer from computers to mobile
technology, what legal issues do companies making the technology face?
Here are my thoughts with some useful links at the end.

1. The sources I have linked to all do a great job of presenting the
legal issues that iPhone developers face when working with Apple and
protecting property rights.

2. The iPhoneDevSDK forum is very interesting for it's look at the
various real-life issues that developers face such as cease and desist
letters.
http://www.iphonedevsdk.com/forum/business-legal-app-store/23491-iphone-legal-trouble.html

3. I predict that in the next few years, as smart phones get smarter,
and accessories are attached, product liability claims against
software developers will increase. Are individual iPhone developers
liable if they make an app that is compatible with a device
manufacturer's product? What kind of warning does your app have? Is
the app something you reasonably foresee will be used by someone
driving?

4. Does your app meet Apple's content ratings system? It better not
have the ability to access the Internet or else you will be given the
strictest rating.

5. If you are working jointly with other iPhone developers, have you
started thinking about how to structure your relationships for tax and
control purposes?

http://www.underdevelopmentlaw.com/2009/03/legal-issues-surrounding-iphone-application-development.html

http://www.danielsonlegal.com/blog/2009/07/14/iphone-developer-legal-guide/

http://www.danielsonlegal.com/blog/docs/iPhone_Developer_Legal_Guide.pdf


David Dobin
Ddobin@gmail.com
301-379-4264

Saturday, July 4, 2009

iDoClipboard v1.1 now available!

Apple approved version 1.1 of iDoClipboard yesterday. It took about
two weeks for Apple's reviewers to approve the app. You can find the
app in iTunes at http://www.itunes.com/apps/idoclipboard. If you
prefer not to open it in iTunes, you can also read the description by
clicking on the link from http://www.iDoTouch.com.

This update corrects some of the major bugs from version 1.0 by
removing me as the default email recipient and fixing the app so it
doesn't save the same text every time the app is launched. I also re-
formatted the table so that it's easier to read and, taking a tip from
a user, changed the mail button to an envelope.


David Dobin
Ddobin@gmail.com
301-379-4264

Sunday, June 28, 2009

iDoWebEdit v1.0 on the App Store

Apple recently approved my sixth app for sale on the App Store.
Version 1.0 of iDoWebEdit allows the user to enter HTML, CSS, PHP and
Javascript into a text editor then with a tap of the "Done" button,
preview it in a web page. Any changes to the source code are saved
upon pressing of the "Done" button. Tapping the "Edit" button in the
web preview returns you to the editing page.

Version 1.0 does not support references to separate local style sheets
or JavaScript files.

You can find more information at
http://appshopper.com/productivity/idowebedit

How I designed the app:
1. I used Core Data to save each web page. Check out the following
tutorial to learn more about Core Data:


http://developer.apple.com/iphone/library/documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html

This is a must-read for anyone new to Core Data who will be using
persistent custom objects. (if you don't know what a custom object is,
you need to read My First Blog Post).

2. The app uses 1 UIView and 2 subviews: a UITextView and a UIWebView.
Then, to switch between the two, I implemented a flipView method and
set each subview hidden (e.g.,[theWebView setHidden: YES];) as
appropriate:


[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.00];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
UIViewAnimationTransition transition;
transition = UIViewAnimationTransitionFlipFromLeft;
[UIView setAnimationTransition: transition forView:self.view cache:YES];
[UIView commitAnimations];

Who this app is designed for:
1. Experienced developers: Copy and paste code into the text view to
see how your code renders on a small screen. Also, test out web APIs
before integrating them into your mashup.

2. Beginning developers: Test out code in order to learn how the web
languages work generally.

3. All developers: Try out short code snippets while you are on the go
to see how they look on an iPhone.

MORE INFO on developing for Safari on the web:

http://developer.apple.com/safari/library/codinghowtos/Mobile/UserExperience/index.html

http://www.iphonewebdev.com/

http://developer.apple.com/safari/library/codinghowtos/Mobile/GraphicsMediaAndVisualEffects/index.html

http://developer.apple.com/safari/library/navigation/SampleCode.html


David Dobin
Ddobin@gmail.com
301-379-4264

Friday, June 26, 2009

Some Advice for Non-Programmers

During the course of learning how to write iPhone apps, I have found
myself google-ing for tips on iPhone development without having any
clue as to what I was looking for.

The extent of my programming experience before January was a little
HTML that I wrote in 2000. So when I started thinking about my first
real iPhone app, I didn't even understand the basic concepts that go
into a computer program.

Take timers, for example. A timer allows the program designer to
control when things happen in a program-like a timer on a bomb
controls when the bomb explodes. Well, when I started learning iPhone
development and how to make an iPhone app, I didn't even know timers
existed let alone know how to implement one in an iPhone app.

Then I read a tutorial on animating a ball using an NSTimer at http://icodeblog.com/
. After reading the tutorial, I understood what a timer was. Still, it
was probably another month before I could get one working on a real
app without crashing my program.

What's my point? A non-computer programmer can learn how to build an
iPhone app. But it takes time and patience, just like anything else
that's worthy. You won't be able to make a dozen apps overnight.
Believe me, I tried. But if you keep at it, read alot, write your own
code and accept that some days you will feel like you took two (or
ten) steps back, you will get a hang of it. After all, you are
learning a new language.

Here are some links that I found useful for beginning iPhone app
development. But understand that you won't truly get what's inside
those pages until you try to learn the basics of Objective-C (see my
first blog) and try it yourself.

http://icodeblog.com/

http://iphone.zcentric.com/

http://appsamuck.com/blog/index.php/category/31-days/


David Dobin
Ddobin@gmail.com
301-379-4264

iDoClipboard - Week One

I received my first week report for downloads of my latest iPhone App,
iDoClipboard, and the results are pretty exciting.

As many of you know, the app reached number one on the App Store's
list of free productivity apps in Japan.

Anyways, here is the list of countries and their respective download
totals:

1 Japan 4856
2. USA 628
3. Germany 111
4. Canada 81
5. Great Britain 81
6. France 79
7. Italy 60
8. Australia 53
9. SG 37
10. Russia 31


David Dobin
Ddobin@gmail.com
301-379-4264

Thursday, June 25, 2009

iPhone OS 3.0 - some mapkit tutorials

iPhone OS 3.0 has some great new features. One of these is the new
MapKit. Check out these tutorials that I found online:

http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial/

http://blog.objectgraph.com/index.php/2009/04/02/iphone-sdk-30-playing-with-map-kit/

I worked with the Objectgraph tutorials and found them very helpful. A
quick review of the other tutorial also showed that it is very helpful.

If you know of any more tutorials, feel free to post them.

www.iDoTouch.com

Wednesday, June 24, 2009

My First Blog Post

This is my first blog post. I am an attorney and a self-taught iPhone software developer.

I recommend that anyone who wants to learn how to develop for the iPhone start with Programming in Objective-C 2.0 by Steven Kochan.

I got into iPhone programming because I have always been fascinated by futuristic technology, and how computers can make our lives easier. Plus, after using the Blackberry for two or three years, I fell in love with the iPhone as soon as I laid my hands on it.

So, if you are interested in learning how to build an iPhone app, get serious about the technology and get that book.

Also, check out www.iDoTouch.com for links to my current iPhone apps.