Skip to content

Commit 5f41ef1

Browse files
craigrousedanielsogl
authored andcommitted
feat(tealium): add tealium ionic wrappers (#2414)
1 parent cea1dc1 commit 5f41ef1

File tree

5 files changed

+361
-23
lines changed

5 files changed

+361
-23
lines changed

DEVELOPER.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ You need to run `npm run build` in the `ionic-native` project, this will create
115115

116116
### Cleaning the code
117117

118-
You need to run `npm run lint` to analyze the code and ensure it's consistency with the repository style. Fix any errors before submitting a PR.
118+
You need to run `npm run lint` to analyze the code and ensure its consistency with the repository style. Fix any errors before submitting a PR.
119119

120120
### 'Wrapping' Up
121121

122-
That's it! The only thing left to do is rigorously document the plugin and it's usage. Take a look at some of the other plugins for good documentation styles.
122+
That's it! The only thing left to do is rigorously document the plugin and its usage. Take a look at some of the other plugins for good documentation styles.
123123

124124
## Commit Message Format
125125

@@ -218,4 +218,4 @@ Example:
218218
```ts
219219
@CordovaFunctionOverride()
220220
someMethod(): Observable<any> { return; }
221-
```
221+
```

package-lock.json

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
2+
import { Injectable } from '@angular/core';
3+
4+
/**
5+
* @paid
6+
* @name TealiumAdIdentifier
7+
* @description
8+
* This module depends on the [Tealium Cordova Plugin](https://github.com/tealium/cordova-plugin). Without it, this module will not do anything.
9+
* Makes the IDFA and Google Ad Identifier available in the Tealium data layer.
10+
*
11+
* @usage
12+
* ```
13+
* import { TealiumAdIdentifier } from '@ionic-native/tealium-adidentifier';
14+
*
15+
*
16+
* constructor(private adIdentifier: TealiumAdIdentifier) { }
17+
*
18+
* ...
19+
*
20+
*
21+
* this.adIdentifier.setPersistent("main");
22+
* this.adIdentifier.setVolatile("main");
23+
*
24+
* ```
25+
*/
26+
27+
@Plugin({
28+
pluginName: 'TealiumAdIdentifier',
29+
plugin: 'tealium-cordova-adidentifier', // npm package name, example: cordova-plugin-camera
30+
pluginRef: 'window.tealiumAdIdentifier', // the variable reference to call the plugin, example: navigator.geolocation
31+
repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin
32+
platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS']
33+
install: '', // OPTIONAL install command, in case the plugin requires variables
34+
})
35+
36+
@Injectable()
37+
export class TealiumAdIdentifier extends IonicNativePlugin {
38+
39+
/**
40+
* This function stores the ad identifier information as persistent data
41+
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
42+
* @return {Promise<any>} Returns a promise that resolves when something happens
43+
*/
44+
@Cordova()
45+
setPersistent(instanceName: string): Promise<any> {
46+
return;
47+
}
48+
49+
/**
50+
* This function stores the ad identifier information as volatile data
51+
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
52+
* @return {Promise<any>} Returns a promise that resolves when something happens
53+
*/
54+
@Cordova()
55+
setVolatile(instanceName: string): Promise<any> {
56+
return;
57+
}
58+
59+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
2+
import { Injectable } from '@angular/core';
3+
4+
/**
5+
* @paid
6+
* @name TealiumInstallReferrer
7+
* @description
8+
* This module depends on the [Tealium Cordova Plugin](https://github.com/tealium/cordova-plugin). Without it, this module will not do anything.
9+
* Implements a Broadcast Receiver for the INSTALL_REFERRER intent.
10+
*
11+
* @usage
12+
* ```
13+
* import { TealiumInstallReferrer } from '@ionic-native/tealium-installreferrer';
14+
*
15+
*
16+
* constructor(private installReferrer: TealiumInstallReferrer) { }
17+
*
18+
*
19+
* this.installReferrer.setPersistent("main");
20+
* this.installReferrer.setVolatile("main");
21+
*
22+
*
23+
*
24+
* ```
25+
*/
26+
27+
@Plugin({
28+
pluginName: 'TealiumInstallReferrer',
29+
plugin: 'tealium-cordova-installreferrer', // npm package name, example: cordova-plugin-camera
30+
pluginRef: 'window.tealiumInstallReferrer', // the variable reference to call the plugin, example: navigator.geolocation
31+
repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin
32+
platforms: ['Android'], // Array of platforms supported, example: ['Android', 'iOS']
33+
install: '', // OPTIONAL install command, in case the plugin requires variables
34+
})
35+
36+
@Injectable()
37+
export class TealiumInstallReferrer extends IonicNativePlugin {
38+
39+
/**
40+
* This function stores the install referrer information as persistent data
41+
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
42+
* @return {Promise<any>} Returns a promise that resolves when something happens
43+
*/
44+
@Cordova()
45+
setPersistent(instanceName: string): Promise<any> {
46+
return;
47+
}
48+
49+
/**
50+
* This function stores the install referrer information as volatile data
51+
* @param instanceName {string} Your arbitrary Tealium instance name provided at init time
52+
* @return {Promise<any>} Returns a promise that resolves when something happens
53+
*/
54+
@Cordova()
55+
setVolatile(instanceName: string): Promise<any> {
56+
return;
57+
}
58+
59+
}

0 commit comments

Comments
 (0)