LayarSDK Documentation
Instance Methods | Class Methods | Properties | List of all members
LayarSDK Class Reference

This is the main class for Layar SDK. You use this class to configure the SDK and to construct required AR view controllers. More...

#import <LayarSDK/LayarSDK.h>

Inherits <NSObject>.

Instance Methods

(id) - initWithConsumerKey:andConsumerSecret:andDelegate:
 Initialize an instance of LayarSDK object and configure it. More...
 
(id) - initWithConsumerKey:andConsumerSecret:andDelegate:customLocationProvider:
 Initialize an instance of LayarSDK object and configure it. More...
 
(void) - webViewControllerForURL:withCompletion:
 Open an web view controller with http url loaded. More...
 
(void) - viewControllerForURL:withCompletion:
 Open an AR view controller with layer/campaign loaded. More...
 
(void) - openURL:onExistingViewController:completion:
 Load a layer/campaign on an existing view controller. More...
 
(void) - viewControllerForScanningWithCompletion:
 Open an AR view controller for scanning. More...
 

Class Methods

(NSString *) + localizedStringForKey:andComment:
 Returns a localized string from the LayarSDK Bundle.
 
(LayarSDK *) + layarSDKWithConsumerKey:andConsumerSecret:andDelegate:
 Construct an instance of LayarSDK object and configure it. More...
 
(LayarSDK *) + layarSDKWithConsumerKey:andConsumerSecret:andDelegate:customLocationProvider:
 Construct an instance of LayarSDK object and configure it. More...
 

Properties

id< LayarSDKDelegate > delegate
 Reference to Layad SDK delegate.
 
CLLocation * fixedLocation
 Fixed location to use for Geo layers. More...
 
BOOL popOutsEnabled
 Use this property to control if 'pop out' functionality is enabled in AR view controllers. More...
 

Detailed Description

This is the main class for Layar SDK. You use this class to configure the SDK and to construct required AR view controllers.

Ideally, there should only be one single instance of this class in your application.

Method Documentation

- (id) initWithConsumerKey: (NSString *)  consumerKey
andConsumerSecret: (NSString *)  consumerSecret
andDelegate: (id< LayarSDKDelegate >)  delegate 

Initialize an instance of LayarSDK object and configure it.

Parameters
consumerKeyNSString* Your OAuth consumer key used to sign all Layar API requests
consumerSecretNSString* Your OAuth consumer secret used to sign all Layar API requests
delegateid<LayarSDKDelegate> Reference to an object of a class that implements LayarSDKDelegate protocol. Can be nil. Will be weakly held.
Returns
Configured instance of LayarSDK class.
- (id) initWithConsumerKey: (NSString *)  consumerKey
andConsumerSecret: (NSString *)  consumerSecret
andDelegate: (id< LayarSDKDelegate >)  delegate
customLocationProvider: (id< LayarSDKLocationProvider >)  customLocationProvider 

Initialize an instance of LayarSDK object and configure it.

Parameters
consumerKeyNSString* Your OAuth consumer key used to sign all Layar API requests
consumerSecretNSString* Your OAuth consumer secret used to sign all Layar API requests
delegateid<LayarSDKDelegate> Reference to an object of a class that implements LayarSDKDelegate protocol. Can be nil. Will be weakly held.
customLocationProviderid<LayarSDKLocationProvider> Reference to an object of a class that implements LayarSDKDelegate protocol. Will be strongly held.
Returns
Configured instance of LayarSDK class.
+ (LayarSDK*) layarSDKWithConsumerKey: (NSString *)  consumerKey
andConsumerSecret: (NSString *)  consumerSecret
andDelegate: (id< LayarSDKDelegate >)  delegate 

Construct an instance of LayarSDK object and configure it.

Parameters
consumerKeyNSString* Your OAuth consumer key used to sign all Layar API requests
consumerSecretNSString* Your OAuth consumer secret used to sign all Layar API requests
delegateid<LayarSDKDelegate> Reference to an object of a class that implements LayarSDKDelegate protocol. Can be nil. Will be weakly held.
Returns
Constructed and configured autoreleased instance of LayarSDK class.
+ (LayarSDK*) layarSDKWithConsumerKey: (NSString *)  consumerKey
andConsumerSecret: (NSString *)  consumerSecret
andDelegate: (id< LayarSDKDelegate >)  delegate
customLocationProvider: (id< LayarSDKLocationProvider >)  customLocationProvider 

Construct an instance of LayarSDK object and configure it.

Parameters
consumerKeyNSString* Your OAuth consumer key used to sign all Layar API requests
consumerSecretNSString* Your OAuth consumer secret used to sign all Layar API requests
delegateid<LayarSDKDelegate> Reference to a class that implements LayarSDKDelegate protocol. Can be nil. Will be weakly held.
customLocationProviderid<LayarSDKLocationProvider> Reference to an object of a class that implements LayarSDKDelegate protocol. Can be nil. Will be strongly held.
Returns
Constructed and configured autoreleased instance of LayarSDK class.
- (void) openURL: (NSURL *)  url
onExistingViewController: (UIViewController< LayarSDKViewController > *)  viewController
completion: (void(^)(BOOL completed, NSError *error))  completion 

Load a layer/campaign on an existing view controller.

Parameters
urlA URL pointing to layer or campaign. Should have 'layar://' scheme and contain layer name and optionally additional parameters. Example: layar://layername See Layar client API docs for a detailed description.
completionCompletion block that will be executed when the view controller has loaded the new URL
- (void) viewControllerForScanningWithCompletion: (LayarSDKViewControllerForScanningCompletion)  completion

Open an AR view controller for scanning.

Parameters
completionCompletion block that will be executed when the view controller is ready to be displayed. You get a reference to the view controller as a parameter to the completion block.
- (void) viewControllerForURL: (NSURL *)  url
withCompletion: (LayarSDKURLCompletion)  completion 

Open an AR view controller with layer/campaign loaded.

Parameters
urlA URL pointing to layer or campaign. Should have 'layar://' scheme and contain layer name and optionally additional parameters. Example: layar://layername See Layar client API docs for a detailed description.
completionCompletion block that will be executed when the view controller is ready to be displayed. You get a reference to the view controller as a parameter to the completion block.
- (void) webViewControllerForURL: (NSURL *)  url
withCompletion: (LayarSDKWebURLCompletion)  completion 

Open an web view controller with http url loaded.

Parameters
urlA URL pointing to the web page. Can have http or https schemes. Example: http://www.google.com
completionCompletion block that will be executed when the view controller is ready to be displayed. You get a reference to the view controller as a parameter to the completion block.

Property Documentation

- (CLLocation*) fixedLocation
readwritenonatomicstrong

Fixed location to use for Geo layers.

Using this property you can test your Geo layers for any arbitrary Geo location. Setting it to an instance of CLLocation object will override GPS location used for Geo layers. Set to nil to disable the override.

- (BOOL) popOutsEnabled
readwritenonatomicassign

Use this property to control if 'pop out' functionality is enabled in AR view controllers.

Defaults to YES. Setting this property does not affect AR view controllers that are already created.


The documentation for this class was generated from the following file: