welcome to linkAR technical documentation

next previous

Quick Start

2.1.- Setting up the Development Environment


If you are new to iOS developing the following steps will guide you through the very basics of getting started with apple mobile development.
If you already are an iOS developer and have the development environment set up skip to Create new project. Read more on Apple's developer site:

https://developer.apple.com/devcenter/ios/index.action

2.1.1.- Become an iOS Developer


AR Browser applications can not run in the simulator, must be deployed on iOS devices.
You must enroll to the iOS Developer program to deploy applications on iOS devices.
You can enroll here:

http://developer.apple.com/programs/ios

2.1.2.- Install Xcode and the iOS SDK


Once you have enrolled in the iOS Developer program, you should have access to the iOS Dev Center.

http://developer.apple.com/devcenter/ios

Go to the Dev Center and download Xcode.

http://developer.apple.com/xcode/index.php

2.1.3.- Set up a Provisioning Profile


  1. Sign into the iOS Dev Center: http://developer.apple.com/membercenter/
  2. Go to the iOS Provisioning Portal
    1. Follow the process to obtain a certificate, assign a device, create an App ID and create a provisioning profile. Use the wildcard character (*) to build and install multiple applications with a single ID.
    2. Download the provisioning profile you have just created and install it on your computer (double click on it).

2.2.- Installing AR Browser Framework and creating the HelloARLIb

2.2.1.- Create new project


Select Create New Xcode Project from the splash screen (seen below) or file→new→project.. from the menu.

arbr2d_ios_project.png

2.2.2.- Choose Single View Application template


It will give us a basic app template, with a single UIView we can add the ARBrowser to.

arbr2d_ios_template.png

2.2.3.- Fill project details


Make sure use Automatic Reference Counting is selected. Automatic Reference Counting is not obligatory but it makes memory management easier.

arbr2d_ios_counting.png
Bundle id is very important because it represents your application and act as a unique identifier. This Bundle id and the API_KEY associated with it are received for you when you get the arbrowser sdk. In this case we use arlab.HelloARLIb and set its API_KEY in the code.

2.3.- SDK Files


  • EADBrowser Framework
    • libs/
      • EADBrowser.bundle
      • EADBrowser.framework
      • EADUtilities.framework
      • Facebook.framework
  • samples/
    • HelloARLIb
    • ARPickBrowser.
    • ARbrowserOutCamera

2.3.- Create and configure the project

2.3.1.- Copy EADBrowser.bundle


Drag and drop the EADBrowser.bundle from the SDK

  • libs/
    • EADBrowser.bundle

to the project, under Supported files folder.

In this bundle you can replace the images to customize the UI (radar, popup background, logo etc..)

arbr2d_ios_bundle.png

Make sure copy items into destination's group folder (if needed) is selected. Always do this to keep all the necessary files in the same folder.

arbr2d_ios_copy.png

2.3.2.- Adding POI icons to ARBrowser


The POIs icons can be added within the project resources or loaded dynamically from any url. In this sample Drag and drop them to the resources folder from the SDK

  • samples/
    • HelloARLIb
      • HelloARLIb
        • target.png
        • Smiley.png
        • cloud.png
        • v.png


arbr2d_ios_icons.png

2.3.3.- Add the following frameworks


Click on the project icon in the project navigator view, and under Build Phases tab, add each framework by clicking on the + button in the Link Binary With Libraries forum.

  • AVFoundation.framework
  • CoreVideo.framework
  • CoreMedia.framework
  • Foundation.framework
  • MediaPlayer.framework
  • MessageUI.framework
  • QuartzCore.framework
  • UIKit.framework
  • Twitter.framework
  • CoreGraphics.framework
  • OpenGLES.framework
  • CoreLocation.framework
  • CoreMotion.framework


Add the ARBrowser framework EADBrowser.framework from the SDK.

  • EADBrowser Framework/
    • libs/
      • EADBrowser.framework

Add the EADUtilities.framework from the SDK.

  • EADBrowser Framework/
    • libs/
      • EADUtilities.framework

Add FaceBook.framework from the SDK or from Facebook's developer website.

  • EADBrowser Framework/
    • libs/
      • Facebook.framework

Here is how your frameworks folder should look like after you finish:


2.3.4.- Add the ARBrowser


  • On the top of ViewController.h Include the header file ARglLibController.h and the class member _arlibCtrl:
#import <UIKit/UIKit.h>
#import <EADBrowser/ARglLibController.h>
 
@interface ViewController : UIViewController <CLLocationManagerDelegate, ARLibProtocol>
{
    ARglLibController* _arlibCtrl;
    __weak id locationDelegate;
}
 
@end
  • Set File Type of the ViewController.m to Objetive C++ source


arbr2d_ios_objectivec_.png

  • In the viewDidLoad method of ViewController.m you have to alloc and init ARglLibController and Set the App Key you received from the registration service in the website. The App Key is related to the bundle id, in this case arlab.HelloARLIb
- (void)viewDidLoad
{
    [super viewDidLoad];
 
    // Do any additional setup after loading the view, typically from a nib.
    // Hide StatusBar
 
    // Init ARBrowser viewController    
    _arlibCtrl = [[ARglLibController alloc]
                 initWithAppKey:@"kxwm4fGRe2PIJD5DJcY2a6gcJjuezSpmKQMW00+PLA=="];    
    [_arlibCtrl.view setFrame:self.view.frame];
 
    [_arlibCtrl start];            
}
  • Create viewDidAppear method in ViewController.m to present the ARBrowser view:
- (void) viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [self.view addSubview:_arlibCtrl.view];
}
  • Also in ViewController.m change this to Lock rotation:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

2.4.- How to Run


  • Connect a supported device Apple compatible products
  • Select the device from the target menu
  • Click on the Run button or cmd + r.

2.5.- How to Debug


  • After running, make a breakpoint at the wanted line to stop the debugger on runtime.
  • To make a breakpoint, click on the left margine of the line and a blue arrow will appear indicating a new breakpoint was made.
  • Click on the debug navigation or cmd+5, to browse a list of the breakpoints.

2.6.- How to upload to the AppStore


See the apples documentation on Distributing apps to the app store: AppStore Upload

next previous