LayarSDK Documentation
Instance Methods | List of all members
<LayarSDKDelegate> Protocol Reference

The LayarSDKDelegate provides you with several callback methods to inform you and allow you to override some activities. More...

#import <LayarSDK/LayarSDK.h>

Inherits <NSObject>.

Instance Methods

(void) - layarSDK:didLaunchLayer:withTitle:recognizedReferenceImageName:onViewController:
 Called when the user has scanned a reference image and this reference image has been detected to be one of your pages in one of your campaigns, or when the user did launch a geo layer. More...
 
(void) - layarSDK:didLaunchLayerWithLayerObject:recognizedReferenceImageName:onViewController:
 Called when the user has scanned a reference image and this reference image has been detected to be one of your pages in one of your campaigns, or when the user did launch a geo layer. More...
 
(void) - layarSDK:didRecognizeQRCode:onViewController:
 Called when the user has scanned a QR code and it is shown in AR. More...
 
(BOOL) - layarSDK:shouldPerformVisualSearchForImage:onViewController:
 Called whenever the user scans something and a visual search query will be sent to the server. The callee will get the image that will be sent to the Layar server for image recognition. Allows you to override the visual search API call. More...
 
(NSDictionary *) - layarSDK:willSendPOIRequestWithParameters:
 Called when the layar sdk will make a request for pois. This callback enables the user of the SDK to customize the parameters being sent with the poi request. The entries in the returned dictionary will override the entries in the parameters before being sent to the server. New entries will be added. Note that in this manner a parameter cannot be removed. It can either be modified or added. More...
 
(void) - layarSDK:didReceiveVisualSearchResultsWithResponseCode:responseMessage:recognizedReferenceImagesForLayers:onViewController:
 Called whenever a response is received from the server for a visual search query. More...
 
(BOOL) - layarSDK:shouldShowNoResultsFoundForImage:onViewController:
 Called whenever the SDK is going to pop-up a message indicating to the user that no results were found. This will allow you to intercept this situation and program your own behavior when this happens, e.g. replacing the pop-up message with your own instructions. More...
 
(void) - layarSDK:didStartTrackingReferenceImage:withLayer:withLayerTitle:onViewController:
 Informs your application that after a campaign is loaded the visual tracking of one of the pages has started. You are provided with the referenceImageName which relates to one of your pages as well as the layarName (campaign name) and the layarTitle (campaign title). More...
 
(void) - layarSDK:didStartTrackingReferenceImage:withLayerObject:onViewController:
 Informs your application that after a campaign is loaded the visual tracking of one of the pages has started. You are provided with the referenceImageName which relates to one of your pages as well as the layarName (campaign name) and the layarTitle (campaign title). More...
 
(void) - layarSDK:didStopTrackingReferenceImage:withLayerObject:onViewController:
 Informs your application that visual tracking of one of the pages has stopped. You are provided with the referenceImageName which relates to one of your pages as well as the layarName (campaign name) and the layarTitle (campaign title). More...
 
(void) - layarSDK:didShowAugmentForPOI:referenceImageName:layer:onViewController:
 Called when an augment is displayed on a POI. More...
 
(void) - layarSDK:didShowAugmentForPOIWithPOIObject:referenceImageName:layerObject:onViewController:
 Called when an augment is displayed on a POI. More...
 
(void) - layarSDK:didClickOnAugmentForPOI:referenceImageName:layer:onViewController:
 Called when the user clicked on an augment. More...
 
(void) - layarSDK:didClickOnAugmentForPOIWithPOIObject:referenceImageName:layerObject:onViewController:
 Called when the user clicked on an augment. More...
 
(void) - layarSDK:didStartPlayingVideoForPOI:referenceImageName:layer:onViewController:
 Called when an AR video starts playing (either directly, or when the user clicks the play/replay button) More...
 
(void) - layarSDK:didStartPlayingVideoForPOIWithPOIObject:referenceImageName:layerObject:onViewController:
 Called when an AR video starts playing (either directly, or when the user clicks the play/replay button) More...
 
(void) - layarSDK:didStartPlayingAudioForPOI:referenceImageName:layer:onViewController:
 Called when an AR audio starts playing (either directly, or when the user clicks the play/replay button) More...
 
(void) - layarSDK:didStartPlayingAudioForPOIWithPOIObject:referenceImageName:layerObject:onViewController:
 Called when an AR audio starts playing (either directly, or when the user clicks the play/replay button) More...
 
(void) - layarSDK:didFocusPOI:layer:onViewController:
 Called when a POI gets the focus. More...
 
(void) - layarSDK:didFocusPOIWithPOIObject:layerObject:onViewController:
 Called when a POI gets the focus. More...
 
(BOOL) - layarSDK:shouldTriggerActionForPOI:referenceImageName:layer:action:onViewController:
 Called when an action will be triggered, either by a user click or automatically. More...
 
(BOOL) - layarSDK:shouldTriggerActionForPOIWithPOIObject:referenceImageName:layerObject:action:onViewController:
 Called when an action will be triggered, either by a user click or automatically. More...
 
(void) - layarSDK:didTriggerActionForPOI:referenceImageName:layer:action:onViewController:
 Called when an action is triggered, either by a user click or automatically. More...
 
(void) - layarSDK:didTriggerActionForPOIWithPOIObject:referenceImageName:layerObject:action:onViewController:
 Called when an action is triggered, either by a user click or automatically. More...
 
(void) - layarSDK:didEnterPopOutModeOnViewController:
 Called when a view controller enters pop-out mode. More...
 
(void) - layarSDK:didExitPopOutModeOnViewController:
 Called when a view controller exits pop-out mode. More...
 
(void) - layarSDK:didEnterScreenshotModeOnViewController:
 Called when a view controller goes into the screenshot view. More...
 
(void) - layarSDK:didExitScreenshotModeOnViewController:
 Called when a view controller goes out of the screenshot view. More...
 

Detailed Description

The LayarSDKDelegate provides you with several callback methods to inform you and allow you to override some activities.

You get information about which layer has been loaded and when a certain reference image is tracked etc.

All callbacks are optional, so you only need to implement the ones you're interested in.

Many callbacks pass Layer and POI objects in form of dictionaries that contain extended information about the campaign/layer and POI for which the callback is made.

These dictionaries always use strings (NSString*) as keys.

The following structure is guaranteed for POI objects:

            {
                "id"        : (NSString*) The unique id which identifies a POI in the getPOIs response.
                "object"    : (NSDictionary*)
                    {
                        "url"           : (NSString*) The URL of the object to be displayed.
                        "contentType"   : (NSString*) The content type of the object.
                    }
            }

For more information on POI objects see 'hotspots' documentation in the GetPOIs API doc (https://www.layar.com/documentation/browser/api/getpois-response/hotspots/). Note that not all fields specified in the GetPOIs API are available in POI object.

The following structure is guaranteed for Layer objects:

            {
                "name"      : (NSString*) The name of the layer
                "title"     : (NSString*) The title of the layer
                "icon"      : (NSString*) The URL of the layer's icon
            }

Internally campaigns are related to layers so the layer name is your campaign's name and the layer title is your campaign's title.

Method Documentation

- (void) layarSDK: (LayarSDK *)  layarSdk
didClickOnAugmentForPOI: (NSString *)  poiId
referenceImageName: (NSString *)  referenceImageName
layer: (NSString *)  layerName
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when the user clicked on an augment.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiIdNSString* The ID of the POI
referenceImageNameNSString* The name of the reference image or nil for Geo layers
layerNameNSString* The name of the layer/campaign
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didClickOnAugmentForPOIWithPOIObject: (NSDictionary *)  poiObject
referenceImageName: (NSString *)  referenceImageName
layerObject: (NSDictionary *)  layerObject
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when the user clicked on an augment.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiObjectNSDictionary* The POI object. See protocol reference for detailed structure.
referenceImageNameNSString* The name of the reference image or nil for Geo layers
layerObjectNSDictionary* The layer object. See protocol reference for detailed structure.
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didEnterPopOutModeOnViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when a view controller enters pop-out mode.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didEnterScreenshotModeOnViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when a view controller goes into the screenshot view.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didExitPopOutModeOnViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when a view controller exits pop-out mode.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didExitScreenshotModeOnViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when a view controller goes out of the screenshot view.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didFocusPOI: (NSString *)  poiId
layer: (NSString *)  layerName
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when a POI gets the focus.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiIdNSString* The ID of the POI
layerNameNSString* The name of the layer/campaign
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didFocusPOIWithPOIObject: (NSDictionary *)  poiObject
layerObject: (NSDictionary *)  layerObject
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when a POI gets the focus.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiObjectNSDictionary* The POI object. See protocol reference for detailed structure.
layerObjectNSDictionary* The layer object. See protocol reference for detailed structure.
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didLaunchLayer: (NSString *)  layerName
withTitle: (NSString *)  layerTitle
recognizedReferenceImageName: (NSString *)  recognizedReferenceImageName
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when the user has scanned a reference image and this reference image has been detected to be one of your pages in one of your campaigns, or when the user did launch a geo layer.

Note
Internally campaigns are related to layers so the layerName is your campaign's name and the layerTitle is your campaign's title.
Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
layerNameNSString* The name of the detected campaign
layerTitleNSString* The title of the detected campaign
recognizedReferenceImageNameNSString* Name of recognized reference image in case the user has scanned a reference image, nil otherwise
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didLaunchLayerWithLayerObject: (NSDictionary *)  layerObject
recognizedReferenceImageName: (NSString *)  recognizedReferenceImageName
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when the user has scanned a reference image and this reference image has been detected to be one of your pages in one of your campaigns, or when the user did launch a geo layer.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
layerObjectNSDictionary* The layer object for detected campaign. See protocol reference for detailed structure.
recognizedReferenceImageNameNSString* Name of recognized reference image in case the user has scanned a reference image, nil otherwise
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didReceiveVisualSearchResultsWithResponseCode: (NSUInteger)  responseCode
responseMessage: (NSString *)  responseMessage
recognizedReferenceImagesForLayers: (NSDictionary *)  recognizedReferenceImagesForLayers
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called whenever a response is received from the server for a visual search query.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
responseCodeNSUInteger Response code received from the server. 0 for no error, nonzero for an error
responseMessageNSString* Response message received from the server
recognizedReferenceImagesForLayersNSArray* Dictionary containing all layer/campaign names and corresponding reference image names found by visual search. Dictionary keys are NSString* layer/campaign names. Dictionary values are NSArray* arrays of NSString* reference image names recognized for the layer specified by dictionary key.
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didRecognizeQRCode: (NSString *)  qrCodeText
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when the user has scanned a QR code and it is shown in AR.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
qrCodeTextNSString* Full text of recognized QR code
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didShowAugmentForPOI: (NSString *)  poiId
referenceImageName: (NSString *)  referenceImageName
layer: (NSString *)  layerName
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an augment is displayed on a POI.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiIdNSString* The ID of the POI
referenceImageNameNSString* The name of the reference image
layerNameNSString* The name of the layer/campaign
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didShowAugmentForPOIWithPOIObject: (NSDictionary *)  poiObject
referenceImageName: (NSString *)  referenceImageName
layerObject: (NSDictionary *)  layerObject
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an augment is displayed on a POI.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiObjectNSDictionary* The POI object. See protocol reference for detailed structure.
referenceImageNameNSString* The name of the reference image
layerObjectNSDictionary* The layer object. See protocol reference for detailed structure.
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didStartPlayingAudioForPOI: (NSString *)  poiId
referenceImageName: (NSString *)  referenceImageName
layer: (NSString *)  layerName
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an AR audio starts playing (either directly, or when the user clicks the play/replay button)

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiIdNSString* The ID of the POI
referenceImageNameNSString* The name of the reference image
layerNameNSString* The name of the layer/campaign
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didStartPlayingAudioForPOIWithPOIObject: (NSDictionary *)  poiObject
referenceImageName: (NSString *)  referenceImageName
layerObject: (NSDictionary *)  layerObject
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an AR audio starts playing (either directly, or when the user clicks the play/replay button)

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiObjectNSDictionary* The POI object. See protocol reference for detailed structure.
referenceImageNameNSString* The name of the reference image
layerObjectNSDictionary* The layer object. See protocol reference for detailed structure.
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didStartPlayingVideoForPOI: (NSString *)  poiId
referenceImageName: (NSString *)  referenceImageName
layer: (NSString *)  layerName
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an AR video starts playing (either directly, or when the user clicks the play/replay button)

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiIdNSString* The ID of the POI
referenceImageNameNSString* The name of the reference image
layerNameNSString* The name of the layer/campaign
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didStartPlayingVideoForPOIWithPOIObject: (NSDictionary *)  poiObject
referenceImageName: (NSString *)  referenceImageName
layerObject: (NSDictionary *)  layerObject
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an AR video starts playing (either directly, or when the user clicks the play/replay button)

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiObjectNSDictionary* The POI object. See protocol reference for detailed structure.
referenceImageNameNSString* The name of the reference image
layerObjectNSDictionary* The layer object. See protocol reference for detailed structure.
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didStartTrackingReferenceImage: (NSString *)  referenceImageName
withLayer: (NSString *)  layerName
withLayerTitle: (NSString *)  layerTitle
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Informs your application that after a campaign is loaded the visual tracking of one of the pages has started. You are provided with the referenceImageName which relates to one of your pages as well as the layarName (campaign name) and the layarTitle (campaign title).

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
referenceImageNameNSString* The name of the reference image
layerNameNSString* The name of the tracked campaign
layerTitleNSString* The title of the tracked campaign
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didStartTrackingReferenceImage: (NSString *)  referenceImageName
withLayerObject: (NSDictionary *)  layerObject
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Informs your application that after a campaign is loaded the visual tracking of one of the pages has started. You are provided with the referenceImageName which relates to one of your pages as well as the layarName (campaign name) and the layarTitle (campaign title).

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
referenceImageNameNSString* The name of the reference image
layerObjectNSDictionary* The layer object for tracked campaign. See protocol reference for detailed structure.
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didStopTrackingReferenceImage: (NSString *)  referenceImageName
withLayerObject: (NSDictionary *)  layerObject
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Informs your application that visual tracking of one of the pages has stopped. You are provided with the referenceImageName which relates to one of your pages as well as the layarName (campaign name) and the layarTitle (campaign title).

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
referenceImageNameNSString* The name of the reference image
layerObjectNSDictionary* The layer object for tracked campaign. See protocol reference for detailed structure.
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didTriggerActionForPOI: (NSString *)  poiId
referenceImageName: (NSString *)  referenceImageName
layer: (NSString *)  layerName
action: (NSDictionary *)  action
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an action is triggered, either by a user click or automatically.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiIdNSString* The ID of the POI
referenceImageNameNSString* The name of the reference image (nil for geo layers)
layerNameNSString* The name of the layer/campaign
actionNSDictionary* Action object. Refer to GetPOIs API doc for field descriptions (http://layar.com/documentation/browser/api/getpois-response/actions/) String field values are stored using NSString objects, numerical and boolean field values are stored as NSNumber objects
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (void) layarSDK: (LayarSDK *)  layarSdk
didTriggerActionForPOIWithPOIObject: (NSDictionary *)  poiObject
referenceImageName: (NSString *)  referenceImageName
layerObject: (NSDictionary *)  layerObject
action: (NSDictionary *)  action
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an action is triggered, either by a user click or automatically.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiObjectNSDictionary* The POI object. See protocol reference for detailed structure.
referenceImageNameNSString* The name of the reference image (nil for geo layers)
layerObjectNSDictionary* The layer object. See protocol reference for detailed structure.
actionNSDictionary* Action object. Refer to GetPOIs API doc for field descriptions (http://layar.com/documentation/browser/api/getpois-response/actions/) String field values are stored using NSString objects, numerical and boolean field values are stored as NSNumber objects
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
- (BOOL) layarSDK: (LayarSDK *)  layarSdk
shouldPerformVisualSearchForImage: (UIImage *)  image
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called whenever the user scans something and a visual search query will be sent to the server. The callee will get the image that will be sent to the Layar server for image recognition. Allows you to override the visual search API call.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
imageUIImage* Image captured from camera
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
Returns
boolean indicating whether API call should be made or not
Note
If this callback is not implemented by the delegate object, the SDK behaves as if the return value was YES.
- (BOOL) layarSDK: (LayarSDK *)  layarSdk
shouldShowNoResultsFoundForImage: (UIImage *)  image
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called whenever the SDK is going to pop-up a message indicating to the user that no results were found. This will allow you to intercept this situation and program your own behavior when this happens, e.g. replacing the pop-up message with your own instructions.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
imageUIImage* Image used for visual search (captured from camera)
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
Returns
boolean indicating whether the SDK built-in pop-up should be shown.
Note
Customization could also be done just by replacing assets and strings for these messages.
If this callback is not implemented by the delegate object, the SDK behaves as if the return value was YES.
- (BOOL) layarSDK: (LayarSDK *)  layarSdk
shouldTriggerActionForPOI: (NSString *)  poiId
referenceImageName: (NSString *)  referenceImageName
layer: (NSString *)  layerName
action: (NSDictionary *)  action
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an action will be triggered, either by a user click or automatically.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiIdNSString* The ID of the POI
referenceImageNameNSString* The name of the reference image (nil for geo layers)
layerNameNSString* The name of the layer/campaign
actionNSDictionary* Action object. Refer to GetPOIs API doc for field descriptions (http://layar.com/documentation/browser/api/getpois-response/actions/) String field values are stored using NSString objects, numerical ans boolean field values are stored as NSNumber objects
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
Returns
boolean indicating whether the action should be triggered or not.
Note
If this callback is not implemented by the delegate object, the SDK behaves as if the return value was YES.
- (BOOL) layarSDK: (LayarSDK *)  layarSdk
shouldTriggerActionForPOIWithPOIObject: (NSDictionary *)  poiObject
referenceImageName: (NSString *)  referenceImageName
layerObject: (NSDictionary *)  layerObject
action: (NSDictionary *)  action
onViewController: (UIViewController< LayarSDKViewController > *)  viewController 
optional

Called when an action will be triggered, either by a user click or automatically.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
poiObjectNSDictionary* The POI object. See protocol reference for detailed structure.
referenceImageNameNSString* The name of the reference image (nil for geo layers)
layerObjectNSDictionary* The layer object. See protocol reference for detailed structure.
actionNSDictionary* Action object. Refer to GetPOIs API doc for field descriptions (http://layar.com/documentation/browser/api/getpois-response/actions/) String field values are stored using NSString objects, numerical ans boolean field values are stored as NSNumber objects
viewControllerUIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates
Returns
boolean indicating whether the action should be triggered or not.
Note
If this callback is not implemented by the delegate object, the SDK behaves as if the return value was YES.
- (NSDictionary*) layarSDK: (LayarSDK *)  layarSdk
willSendPOIRequestWithParameters: (NSDictionary *)  parameters 
optional

Called when the layar sdk will make a request for pois. This callback enables the user of the SDK to customize the parameters being sent with the poi request. The entries in the returned dictionary will override the entries in the parameters before being sent to the server. New entries will be added. Note that in this manner a parameter cannot be removed. It can either be modified or added.

Parameters
layarSdkLayarSDK* Reference to the LayarSDK object
parametersNSDictionary* The parameters being sent with the poi request.
Returns
NSDictionary* containing keys for entries that need to be modified or added to parameters with their value.

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