Skip to content

Commit e166f76

Browse files
committed
add pamtag dependency
1 parent 1384d3d commit e166f76

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pam-react-native",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Pam Real CDP SDK",
55
"source": "./src/index.tsx",
66
"main": "./lib/commonjs/index.js",
@@ -94,7 +94,8 @@
9494
"peerDependencies": {
9595
"@react-native-async-storage/async-storage": "*",
9696
"react": "*",
97-
"react-native": "*"
97+
"react-native": "*",
98+
"pamtag": "*"
9899
},
99100
"workspaces": [
100101
"example"
@@ -206,6 +207,6 @@
206207
},
207208
"dependencies": {
208209
"@react-native-async-storage/async-storage": "^2.1.0",
209-
"pamtag": "../pamtracker.js"
210+
"pamtag": "^1.3.0"
210211
}
211212
}

src/index.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,22 @@ export class Pam {
6767
static async appAttention(pageName: string) {
6868
console.log('appAttention', pageName);
6969

70-
const banner = {
71-
title: 'title',
72-
description: 'description',
73-
image:
74-
'https://s3-ap-southeast-1.amazonaws.com/pam4-sansiri/ecom/public/2sFQrLjdyBbXkHkAMV03HrNtbhC.jpg',
75-
size: 'large',
76-
};
77-
78-
PamReactNative.displayPopup(banner);
79-
// const contectID = Pam._instance.contactState.getContactId();
80-
// const appAttention = await Pam.pamApi.loadAppAttention(pageName, contectID);
81-
// if (appAttention) {
82-
// PamReactNative.displayPopup(appAttention);
83-
// } else {
84-
// console.log('appAttention is undefined');
85-
// }
70+
// const banner = {
71+
// title: 'title',
72+
// description: 'description',
73+
// image:
74+
// 'https://s3-ap-southeast-1.amazonaws.com/pam4-sansiri/ecom/public/2sFQrLjdyBbXkHkAMV03HrNtbhC.jpg',
75+
// size: 'large',
76+
// };
77+
78+
// PamReactNative.displayPopup(banner);
79+
const contectID = Pam._instance.contactState.getContactId();
80+
const appAttention = await Pam.pamApi.loadAppAttention(pageName, contectID);
81+
if (appAttention) {
82+
PamReactNative.displayPopup(appAttention);
83+
} else {
84+
console.log('appAttention is undefined');
85+
}
8686
}
8787

8888
static async track(event: string, payload: Record<string, any>) {

0 commit comments

Comments
 (0)