import { NgZone } from '@angular/core'; import { Platform } from 'ionic-angular'; import { Observable } from 'rxjs'; /** * Service for interacting with the PixLive SDK. * Call the init() method when starting your application. */ export declare class PixliveService { private ngZone; private platform; /** * BehaviorSubject keeping track of the synchronization progress. */ private synchronizationProgress; private annotationPresence; private eventFromContent; private enterContext; private exitContext; private qrCodeSynchronization; private codeRecognition; private generatedCoupon; private synchronizationRequest; constructor(ngZone: NgZone, platform: Platform); /** * Initializes the SDK. In particular, it registers several listeners for the PixLive events. * @param gcmSenderId the Google GCM sender ID for the push notifications. Leave it empty if you do not want to enable it. */ init(gcmSenderId?: string): void; private onNewEventFromContent(event); /** * Gets an observable that is called when a content requests a synchronization with * a list of tags (Context synchronization trigger) */ getSynchronizationRequestObservable(): Observable; /** * Gets an observable that is called every time a new coupon is generated * via a coupon content. */ getGeneratedCouponObservable(): Observable; /** * Gets an observable for listening on synchronization progress. The last known * value is given when the listener subscribes to the observable. * A value of 100 means that the synchronization is over. * A value above 100 means that an error occured during the synchronization. */ getSynchronizationProgress(): Observable; /** * Gets an observable that is called when the event "presentAnnotations" or * "hideAnnotations" (true/false respectively) is called. It informs that * an AR annotation is being displayed or not. */ getAnnotationPresenceObservable(): Observable; /** * Gets an observable that is called when an event from content is triggered (e.g. coupon) */ getEventFromContentObservable(): Observable; /** * Gets an observable that is called when a context is entered (i.e. activated). It gives * the public ID of the context. */ getEnterContextObservable(): Observable; /** * Gets an observable that is called when a context is exited. It gives * the public ID of the context. */ getExitContextObservable(): Observable; /** * Gets an observable that is called when a code (e.g. QR code) is recognized. * It gives the content of the code. See also getQrCodeSynchronizationRequest(). */ getCodeRecognition(): Observable; /** * Gets an observable that is called when a synchronization QR code is scanned. * It gives the tag to synchronize */ getQrCodeSynchronizationRequest(): Observable; /** * Synchronize the PixLive SDK with the web platform. * The synchronization can be done in different ways. * * 1) The synchronization can be done without using the tags, in this case, an empty * array is given as parameter. * * 2) The syncronization can be done with one or more tags. Use an array of strings: ['tag1', 'tag2']. * In this case, all contents having one or more of the given tags will be synchronized. * Think of it as => (tag1 OR tag2). * * 3) The synchronization can be done with a combination of tags. Example: [['lang_en', 'tag1'], ['lang_en', 'tag2']]. * In this case, the contents having tags 'lang_en' AND 'tag1' will be synchonized together with the contents having the 'lang_en' AND 'tag2'. * Think of it as => (lang_en AND tag1) OR (lang_en AND tag2). * * @param tags */ sync(tags: any): Promise; /** * Synchronize the PixLive SDK with the web platform. * The synchronization can be done with tags (see sync()) or with tags and tours (this method) * * @param tags an array containing the tag names (e.g. ["tagA"] or [["tagA", "lang_en"], ["tagB", "lang_en"]]) * @param tours an array containing the tour IDs ([1, 2]) */ syncWithTours(tags: any[], tours: any[]): Promise; /** * Synchronize the PixLive SDK with the web platform. * The synchronization can be done with tags, tours and contexts * * @param tags an array containing the tag names (e.g. ["tagA"] or [["tagA", "lang_en"], ["tagB", "lang_en"]]) * @param tours an array containing the tour IDs (e.g. [1, 2]) * @param contexts an array containing the context IDs (e.g. ["ary5tu9tuyktft8"]) */ syncWithToursAndContexts(tags: any[], tours: number[], contexts: string[]): Promise; /** * Gets the nearby GPS points * @param latitude the current latitude * @param longitude the current longitude */ getNearbyGpsPoints(latitude: number, longitude: number): Promise; /** * Checks whether there are beacon contexts. */ isContainingBeacons(): Promise; /** * Checks whether there are GPS contexts. */ isContainingGPSPoints(): Promise; /** * Gets the nearby beacons */ getNearbyBeacons(): Promise; /** * Retrieves the nearby status. */ getNearbyStatus(): Promise; /** * Gets all GPS points in the given bounding box. * @param minLat the minimum latitude * @param minLon the minimum longitude * @param maxLat the maximum latitude * @param maxLon the maximum longitude */ getGpsPointsInBoundingBox(minLat: any, minLon: any, maxLat: any, maxLon: any): Promise; /** * Return the specified context * @param contextId the ID of the context */ getContext(contextId: string): Promise; /** * Get all the contexts that have been synchronized. A context can be an image, a beacon or a GPS point. */ getContexts(): Promise; /** * Opens the given context * @param contextId the ID of the context to open */ activate(contextId: string): void; /** * Opens the given URL using the SDK browser * @param url a link */ openURLInInternalBrowser(url: string): void; /** * Computes the distance between to GPS points * @param latitude1 the latitude of the first point * @param longitude1 the longitude of the first point * @param latitude2 the latitude of the second point * @param longitude2 the longitude of the second point */ computeDistanceBetweenGPSPoints(latitude1: number, longitude1: number, latitude2: number, longitude2: number): Promise; /** * Enable or disable nearby requirement dialog. * @param enabled true if the dialog must be displayed, false otherwise */ setEnableNearbyRequirementDialog(enabled: boolean): Promise; /** * Activates the bookmark feature. A bookmark icon will be shown when a context is * displayed and the user has the possibility to "save" the context. * The feature is disabled by default * * @param enabled true to enable, false to disable. */ setBookmarkSupport(enabled: any): void; /** * Returns the list of contexts that have been bookmarked. */ getBookmarks(): Promise; /** * Adds the contextId to the list of bookmarked content. * @param contextId the context public ID */ addBookmark(contextId: string): void; /** * Removes the contextId to the list of bookmarked content. * @param contextId the context public ID */ removeBookmark(contextId: string): void; /** * Checks whether the context has been marked as favorite. * @param contextId the context public ID */ isBookmarked(contextId: string): Promise; /** * Sets the language to use for online recognition * @param languageCode the language to use (2-character code like "fr" or "en") */ setCloudRecognitionLanguage(languageCode: string): void; /** * Retrieves the tag information for the current local contexts. * It stores the mapping between the given tags and the local contexts. * This method is used before calling enableContextsWithTags. * * @param tags an array of tag names that we want to map with contexts */ updateTagMapping(tags: string[]): Promise; /** * Enables all the contexts that have the given tags. It disables all other contexts. * You must call updateTagMapping before calling this method otherwise the mapping * tag <-> context is unknown. * * @param tags an array of tag names. The contexts to enable must have all of the given tags (logical AND) */ enableContextsWithTags(tags: string[]): Promise; /** * Starts the detection of new nearby gps points, listen to the event newNearbyGPSPoints to get a list * of new gps points nearby. This enables the localizationManager, listen to the event localizationUpdate * to have the position used by the sdk. Call startNearbyGPSDetectionWithParams to specify parameters. */ startNearbyGPSDetection(): void; /** * Starts the detection of new nearby gps points, listen to the event newNearbyGPSPoints to get a list * of new gps points nearby. This enables the localizationManager, listen to the event localizationUpdate * to have the position used by the sdk. Call startNearbyGPSDetection to use the default parameters. * @param minGPSIntervalMS minimal time interval between each new gps position * @param minGPSDistance minimal distance to travel before a gps position is considered as new * @param detectionInterval time needed for a gps point to be considered as new * @param maxDetectionRadius maximal radius, only the points inside the specified radius will be considered as new */ startNearbyGPSDetectionWithParams(minGPSIntervalMS: number, minGPSDistance: number, detectionInterval: number, maxDetectionRadius: number): void; /** * Stops the nearby gps detection and the localizationManager. Both events: newNearbyGPSPoints, localizationUpdate will * stop triggering new values. */ stopNearbyGPSDetection(): void; /** * Enables the notifications, this is meant to be used when the application is in background. Notifications can be enabled/disabled the * when the application is in background/foreground. */ startGPSNotifications(): void; /** * Enables the notifications, this is meant to be used when the application is in background. Notifications can be enabled/disabled the * when the application is in background/foreground. */ stopGPSNotifications(): void; } /** * Class representing a PixLive Maker GPS point. */ export declare class GPSPoint { lat: number; lon: number; detectionRadius: number; distanceFromCurrentPos: number; category: string; label: string; contextId: string; } /** * Class representing a Context. */ export declare class Context { activate: () => void; contextId: string; name: string; description: string; imageHiResURL: string; imageThumbnailURL: string; notificationTitle: string; notificationMessage: string; } /** * Class representing a Event triggered by a content */ export declare class EventFromContent { name: string; params: string; } /** * Class containing the status of nearby (location permission and location/bluetooth on/off) */ export declare class NearbyStatus { /** * If value is "disabled", the location permission has not been granted. */ authorizationStatus?: string; /** * If value is "disabled", the location is disabled. */ locationStatus?: string; /** * If value is "disabled", the bluetooth is off. */ bluetoothStatus?: string; } /** * Coupon received via an "eventFromContent" event */ export declare class GeneratedCoupon { contextId: string; couponUrl: string; constructor(contextId: string, couponUrl: string); }