-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tealium): add tealium ionic wrappers (#2414)
- Loading branch information
1 parent
cea1dc1
commit 5f41ef1
Showing
5 changed files
with
361 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; | ||
import { Injectable } from '@angular/core'; | ||
|
||
/** | ||
* @paid | ||
* @name TealiumAdIdentifier | ||
* @description | ||
* This module depends on the [Tealium Cordova Plugin](https://github.com/tealium/cordova-plugin). Without it, this module will not do anything. | ||
* Makes the IDFA and Google Ad Identifier available in the Tealium data layer. | ||
* | ||
* @usage | ||
* ``` | ||
* import { TealiumAdIdentifier } from '@ionic-native/tealium-adidentifier'; | ||
* | ||
* | ||
* constructor(private adIdentifier: TealiumAdIdentifier) { } | ||
* | ||
* ... | ||
* | ||
* | ||
* this.adIdentifier.setPersistent("main"); | ||
* this.adIdentifier.setVolatile("main"); | ||
* | ||
* ``` | ||
*/ | ||
|
||
@Plugin({ | ||
pluginName: 'TealiumAdIdentifier', | ||
plugin: 'tealium-cordova-adidentifier', // npm package name, example: cordova-plugin-camera | ||
pluginRef: 'window.tealiumAdIdentifier', // the variable reference to call the plugin, example: navigator.geolocation | ||
repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin | ||
platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS'] | ||
install: '', // OPTIONAL install command, in case the plugin requires variables | ||
}) | ||
|
||
@Injectable() | ||
export class TealiumAdIdentifier extends IonicNativePlugin { | ||
|
||
/** | ||
* This function stores the ad identifier information as persistent data | ||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time | ||
* @return {Promise<any>} Returns a promise that resolves when something happens | ||
*/ | ||
@Cordova() | ||
setPersistent(instanceName: string): Promise<any> { | ||
return; | ||
} | ||
|
||
/** | ||
* This function stores the ad identifier information as volatile data | ||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time | ||
* @return {Promise<any>} Returns a promise that resolves when something happens | ||
*/ | ||
@Cordova() | ||
setVolatile(instanceName: string): Promise<any> { | ||
return; | ||
} | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
src/@ionic-native/plugins/tealium-installreferrer/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; | ||
import { Injectable } from '@angular/core'; | ||
|
||
/** | ||
* @paid | ||
* @name TealiumInstallReferrer | ||
* @description | ||
* This module depends on the [Tealium Cordova Plugin](https://github.com/tealium/cordova-plugin). Without it, this module will not do anything. | ||
* Implements a Broadcast Receiver for the INSTALL_REFERRER intent. | ||
* | ||
* @usage | ||
* ``` | ||
* import { TealiumInstallReferrer } from '@ionic-native/tealium-installreferrer'; | ||
* | ||
* | ||
* constructor(private installReferrer: TealiumInstallReferrer) { } | ||
* | ||
* | ||
* this.installReferrer.setPersistent("main"); | ||
* this.installReferrer.setVolatile("main"); | ||
* | ||
* | ||
* | ||
* ``` | ||
*/ | ||
|
||
@Plugin({ | ||
pluginName: 'TealiumInstallReferrer', | ||
plugin: 'tealium-cordova-installreferrer', // npm package name, example: cordova-plugin-camera | ||
pluginRef: 'window.tealiumInstallReferrer', // the variable reference to call the plugin, example: navigator.geolocation | ||
repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin | ||
platforms: ['Android'], // Array of platforms supported, example: ['Android', 'iOS'] | ||
install: '', // OPTIONAL install command, in case the plugin requires variables | ||
}) | ||
|
||
@Injectable() | ||
export class TealiumInstallReferrer extends IonicNativePlugin { | ||
|
||
/** | ||
* This function stores the install referrer information as persistent data | ||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time | ||
* @return {Promise<any>} Returns a promise that resolves when something happens | ||
*/ | ||
@Cordova() | ||
setPersistent(instanceName: string): Promise<any> { | ||
return; | ||
} | ||
|
||
/** | ||
* This function stores the install referrer information as volatile data | ||
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time | ||
* @return {Promise<any>} Returns a promise that resolves when something happens | ||
*/ | ||
@Cordova() | ||
setVolatile(instanceName: string): Promise<any> { | ||
return; | ||
} | ||
|
||
} |
Oops, something went wrong.