|
LayarSDK Documentation
|
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... | |
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.
|
optional |
Called when the user clicked on an augment.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiId | NSString* The ID of the POI |
| referenceImageName | NSString* The name of the reference image or nil for Geo layers |
| layerName | NSString* The name of the layer/campaign |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when the user clicked on an augment.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiObject | NSDictionary* The POI object. See protocol reference for detailed structure. |
| referenceImageName | NSString* The name of the reference image or nil for Geo layers |
| layerObject | NSDictionary* The layer object. See protocol reference for detailed structure. |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when a view controller enters pop-out mode.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when a view controller goes into the screenshot view.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when a view controller exits pop-out mode.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when a view controller goes out of the screenshot view.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when a POI gets the focus.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiId | NSString* The ID of the POI |
| layerName | NSString* The name of the layer/campaign |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when a POI gets the focus.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiObject | NSDictionary* The POI object. See protocol reference for detailed structure. |
| layerObject | NSDictionary* The layer object. See protocol reference for detailed structure. |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
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.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| layerName | NSString* The name of the detected campaign |
| layerTitle | NSString* The title of the detected campaign |
| recognizedReferenceImageName | NSString* Name of recognized reference image in case the user has scanned a reference image, nil otherwise |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
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.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| layerObject | NSDictionary* The layer object for detected campaign. See protocol reference for detailed structure. |
| recognizedReferenceImageName | NSString* Name of recognized reference image in case the user has scanned a reference image, nil otherwise |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called whenever a response is received from the server for a visual search query.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| responseCode | NSUInteger Response code received from the server. 0 for no error, nonzero for an error |
| responseMessage | NSString* Response message received from the server |
| recognizedReferenceImagesForLayers | NSArray* 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. |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when the user has scanned a QR code and it is shown in AR.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| qrCodeText | NSString* Full text of recognized QR code |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an augment is displayed on a POI.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiId | NSString* The ID of the POI |
| referenceImageName | NSString* The name of the reference image |
| layerName | NSString* The name of the layer/campaign |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an augment is displayed on a POI.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiObject | NSDictionary* The POI object. See protocol reference for detailed structure. |
| referenceImageName | NSString* The name of the reference image |
| layerObject | NSDictionary* The layer object. See protocol reference for detailed structure. |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an AR audio starts playing (either directly, or when the user clicks the play/replay button)
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiId | NSString* The ID of the POI |
| referenceImageName | NSString* The name of the reference image |
| layerName | NSString* The name of the layer/campaign |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an AR audio starts playing (either directly, or when the user clicks the play/replay button)
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiObject | NSDictionary* The POI object. See protocol reference for detailed structure. |
| referenceImageName | NSString* The name of the reference image |
| layerObject | NSDictionary* The layer object. See protocol reference for detailed structure. |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an AR video starts playing (either directly, or when the user clicks the play/replay button)
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiId | NSString* The ID of the POI |
| referenceImageName | NSString* The name of the reference image |
| layerName | NSString* The name of the layer/campaign |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an AR video starts playing (either directly, or when the user clicks the play/replay button)
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiObject | NSDictionary* The POI object. See protocol reference for detailed structure. |
| referenceImageName | NSString* The name of the reference image |
| layerObject | NSDictionary* The layer object. See protocol reference for detailed structure. |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
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).
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| referenceImageName | NSString* The name of the reference image |
| layerName | NSString* The name of the tracked campaign |
| layerTitle | NSString* The title of the tracked campaign |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
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).
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| referenceImageName | NSString* The name of the reference image |
| layerObject | NSDictionary* The layer object for tracked campaign. See protocol reference for detailed structure. |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
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).
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| referenceImageName | NSString* The name of the reference image |
| layerObject | NSDictionary* The layer object for tracked campaign. See protocol reference for detailed structure. |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an action is triggered, either by a user click or automatically.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiId | NSString* The ID of the POI |
| referenceImageName | NSString* The name of the reference image (nil for geo layers) |
| layerName | NSString* The name of the layer/campaign |
| action | NSDictionary* 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 |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an action is triggered, either by a user click or automatically.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiObject | NSDictionary* The POI object. See protocol reference for detailed structure. |
| referenceImageName | NSString* The name of the reference image (nil for geo layers) |
| layerObject | NSDictionary* The layer object. See protocol reference for detailed structure. |
| action | NSDictionary* 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 |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
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.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| image | UIImage* Image captured from camera |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
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.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| image | UIImage* Image used for visual search (captured from camera) |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an action will be triggered, either by a user click or automatically.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiId | NSString* The ID of the POI |
| referenceImageName | NSString* The name of the reference image (nil for geo layers) |
| layerName | NSString* The name of the layer/campaign |
| action | NSDictionary* 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 |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
optional |
Called when an action will be triggered, either by a user click or automatically.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| poiObject | NSDictionary* The POI object. See protocol reference for detailed structure. |
| referenceImageName | NSString* The name of the reference image (nil for geo layers) |
| layerObject | NSDictionary* The layer object. See protocol reference for detailed structure. |
| action | NSDictionary* 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 |
| viewController | UIViewController<LayarSDKViewController>* Reference to a view controller where this callback originates |
|
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.
| layarSdk | LayarSDK* Reference to the LayarSDK object |
| parameters | NSDictionary* The parameters being sent with the poi request. |
1.8.9.1