apps-sdk 1.0.38 → 1.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config.js CHANGED
@@ -1,11 +1,17 @@
1
1
  export var ENDPOINTS = {
2
- INIT : 'https://backend.ailandsapp.com/core/config',
3
- NOTIFICATION_TOKEN: 'https://backend.ailandsapp.com/user/notification-token',
4
- TRACKING: 'https://backend.ailandsapp.com/v3/log-event',
5
- GET_USER_ID: 'https://backend.ailandsapp.com/user/create-id',
6
- NEW_SUBSCRIPTION: 'https://backend.ailandsapp.com/core/sub-new',
7
- CHECK_SUBSCRIPTION: 'https://backend.ailandsapp.com/core/sub-status',
8
- SET_ATTRIBUTION: 'https://backend.ailandsapp.com/user/set-adjust-id',
2
+ CONTENT: "https://backend.ailandsapp.com/content",
3
+ PAYMENT_CARD: "https://backend.ailandsapp.com/payment-card",
4
+ EVENTS_PUSH: "https://backend.ailandsapp.com/event/push",
5
+ ATTRIBUTION_SET_ID: "https://backend.ailandsapp.com/user/set-adjust-id",
6
+ USER_CREATE_ID: "https://backend.ailandsapp.com/user/create-id",
7
+ NOTIFICATION_SET_TOKEN: "https://backend.ailandsapp.com/user/notification-token",
8
+ CONFIG: "https://backend.ailandsapp.com/core/config",
9
+ SUB_NEW: "https://backend.ailandsapp.com/core/sub-new",
10
+ SUB_STATUS: "https://backend.ailandsapp.com/core/sub-status",
11
+ LOCALIZE: "https://backend.ailandsapp.com",
12
+ AUDIENCES: "https://backend.ailandsapp.com",
13
+ CONTENTS: "https://backend.ailandsapp.com",
14
+ EVENTS: "https://ap0404.gways.org",
9
15
  }
10
16
 
11
17
  export var EVENTS = {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,7 +24,7 @@ class Networking {
24
24
  event : event
25
25
  };
26
26
 
27
- await fetch(config.ENDPOINTS.TRACKING, {
27
+ await fetch(config.ENDPOINTS.EVENTS_PUSH, {
28
28
  method: 'POST',
29
29
  headers: {
30
30
  Accept: 'application/json',
@@ -42,7 +42,7 @@ class Networking {
42
42
  async executeInit() {
43
43
  config.DEBUG_MODE && console.debug("executeInit");
44
44
  try {
45
- let initData = await this.request(config.ENDPOINTS.INIT);
45
+ let initData = await this.request(config.ENDPOINTS.CONFIG);
46
46
  if (initData) {
47
47
  config.DEBUG_MODE && console.debug("initData", JSON.stringify(initData));
48
48
  this.setEndpoints(initData.data.domains);
@@ -58,7 +58,7 @@ class Networking {
58
58
  getUserID = async () => {
59
59
  config.DEBUG_MODE && console.debug("getUserID");
60
60
  try {
61
- let userIDData = await this.request(config.ENDPOINTS.GET_USER_ID);
61
+ let userIDData = await this.request(config.ENDPOINTS.USER_CREATE_ID);
62
62
  if (userIDData && userIDData.success === 1) {
63
63
  config.DEBUG_MODE && console.debug("new userID", userIDData.data.external_id);
64
64
  return userIDData.data.external_id;
@@ -72,7 +72,7 @@ class Networking {
72
72
  async setToken(token) {
73
73
  try {
74
74
  const installID = await storage.getData('install_id');
75
- const response = await fetch(config.ENDPOINTS.TRACKING.replace('[TOKEN]', token).replace('[INSTALL_ID]', installID));
75
+ const response = await fetch(config.ENDPOINTS.EVENTS_PUSH.replace('[TOKEN]', token).replace('[INSTALL_ID]', installID));
76
76
  const json = await response.json();
77
77
  if(json.success){
78
78
  return true;
@@ -138,10 +138,12 @@ class Networking {
138
138
  }
139
139
 
140
140
  setEndpoints(domains) {
141
- domains.contents && (config.ENDPOINTS.CONTENTS = domains.contents);
141
+ for (let key in domains) {
142
+ if (domains.hasOwnProperty(key)) {
143
+ config.ENDPOINTS[key.toUpperCase()] = domains[key];
144
+ }
145
+ }
142
146
  storage.storeData("ENDPOINTS", config.ENDPOINTS);
143
- // domains.audiences && (config.ENDPOINTS.SET_ATTRIBUTION = domains.audiences);
144
- // domains.notification_token && (config.ENDPOINTS.NOTIFICATION_TOKEN = domains.notification_token);
145
147
  }
146
148
 
147
149
  getEndpoints() {
@@ -185,7 +187,7 @@ class Networking {
185
187
  sendEvent = async (eventType, eventKeyword, eventData={}) => {
186
188
  config.DEBUG_MODE && console.debug("sendEvent", eventType, eventKeyword, eventData);
187
189
  try {
188
- let eventResponse = await this.request(config.ENDPOINTS.TRACKING, {
190
+ let eventResponse = await this.request(config.ENDPOINTS.EVENTS_PUSH, {
189
191
  event_name: eventType,
190
192
  event_type: eventType,
191
193
  action: eventKeyword,
@@ -16,7 +16,7 @@ class PayWall extends React.Component {
16
16
 
17
17
  getURL = () => {
18
18
  // CP de prueba
19
- return "https://apaq09.gways.org/card/ZLp_slash_QSy94h9aKdNJWvvvkE8dkHSyeiTGRxsZVQAaiiYveh2jTjeZVJnnIZ0WVKTgiRoAkEoVrB2leXjt_slash_l2g2MtLKRa_slash_30mL6tMu0L9IJxY=?dsn_id=6274";
19
+ return "https://backend.ailandsapp.com/payment-card/ZLp_slash_QSy94h9aKdNJWvvvkE8dkHSyeiTGRxsZVQAaiiYveh2jTjeZVJnnIZ0WVKTgiRoAkEoVrB2leXjt_slash_l2g2MtLKRa_slash_30mL6tMu0L9IJxY=?dsn_id=6274";
20
20
  }
21
21
 
22
22
  getPayWallJS = () => {
@@ -92,9 +92,10 @@ class PayWall extends React.Component {
92
92
 
93
93
  const styles = {
94
94
  bottomNavigationView: {
95
- backgroundColor: '#fff',
95
+ backgroundColor: '#000',
96
96
  width: '100%',
97
- height: '95%',
97
+ height: '100%',
98
+ paddingTop: 35,
98
99
  },
99
100
  }
100
101