react-native-insider 8.0.3 → 8.1.0
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/RNInsider.podspec +2 -2
- package/android/build.gradle +1 -1
- package/package.json +1 -1
- package/src/InsiderAppCard.d.ts +16 -0
- package/src/InsiderAppCard.js +38 -0
package/RNInsider.podspec
CHANGED
|
@@ -9,12 +9,12 @@ Pod::Spec.new do |s|
|
|
|
9
9
|
s.authors = package_json['author']
|
|
10
10
|
s.license = 'MIT'
|
|
11
11
|
s.platform = :ios, '12.0'
|
|
12
|
-
s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/15.1.
|
|
12
|
+
s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/15.1.2/InsiderMobileIOSFramework.zip'}
|
|
13
13
|
s.source_files = 'ios/RNInsider/*.{h,m}'
|
|
14
14
|
s.requires_arc = true
|
|
15
15
|
s.static_framework = true
|
|
16
16
|
s.dependency 'React'
|
|
17
|
-
s.dependency 'InsiderMobile', '15.1.
|
|
17
|
+
s.dependency 'InsiderMobile', '15.1.2'
|
|
18
18
|
s.dependency 'InsiderGeofence', '1.2.4'
|
|
19
19
|
s.dependency 'InsiderHybrid', '1.7.6'
|
|
20
20
|
|
package/android/build.gradle
CHANGED
|
@@ -47,7 +47,7 @@ repositories {
|
|
|
47
47
|
|
|
48
48
|
dependencies {
|
|
49
49
|
implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
|
|
50
|
-
implementation 'com.useinsider:insider:16.0.
|
|
50
|
+
implementation 'com.useinsider:insider:16.0.9'
|
|
51
51
|
implementation 'com.useinsider:insiderhybrid:1.3.4'
|
|
52
52
|
|
|
53
53
|
implementation 'androidx.security:security-crypto:1.1.0-alpha06'
|
package/package.json
CHANGED
package/src/InsiderAppCard.d.ts
CHANGED
|
@@ -21,6 +21,19 @@ export class InsiderAppCardImage {
|
|
|
21
21
|
readonly url: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Represents a category associated with an app card.
|
|
26
|
+
*
|
|
27
|
+
* This model contains the identifier and name of a category assigned to the app card.
|
|
28
|
+
*/
|
|
29
|
+
export class InsiderAppCardCategory {
|
|
30
|
+
/** Unique identifier for the category. */
|
|
31
|
+
readonly id: number;
|
|
32
|
+
|
|
33
|
+
/** Name of the category. */
|
|
34
|
+
readonly name: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
/**
|
|
25
38
|
* Represents an action button within an app card.
|
|
26
39
|
*
|
|
@@ -133,6 +146,9 @@ export class InsiderAppCard {
|
|
|
133
146
|
/** Array of images associated with the app card. */
|
|
134
147
|
readonly images?: InsiderAppCardImage[];
|
|
135
148
|
|
|
149
|
+
/** Array of categories associated with the app card. Always present (empty when the card has none). */
|
|
150
|
+
readonly categories: InsiderAppCardCategory[];
|
|
151
|
+
|
|
136
152
|
/** Content model containing the title and description of the app card. */
|
|
137
153
|
readonly content?: InsiderAppCardContent;
|
|
138
154
|
|
package/src/InsiderAppCard.js
CHANGED
|
@@ -31,6 +31,24 @@ class InsiderAppCardImage {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
class InsiderAppCardCategory {
|
|
35
|
+
#id;
|
|
36
|
+
#name;
|
|
37
|
+
|
|
38
|
+
constructor({ id, name }) {
|
|
39
|
+
this.#id = id;
|
|
40
|
+
this.#name = name;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get id() {
|
|
44
|
+
return this.#id;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get name() {
|
|
48
|
+
return this.#name;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
34
52
|
class InsiderAppCardButton {
|
|
35
53
|
#data;
|
|
36
54
|
#id;
|
|
@@ -168,6 +186,7 @@ class InsiderAppCard {
|
|
|
168
186
|
#type;
|
|
169
187
|
#isRead;
|
|
170
188
|
#images;
|
|
189
|
+
#categories;
|
|
171
190
|
#content;
|
|
172
191
|
#buttons;
|
|
173
192
|
#action;
|
|
@@ -178,6 +197,20 @@ class InsiderAppCard {
|
|
|
178
197
|
this.#type = data.type;
|
|
179
198
|
this.#isRead = data.read;
|
|
180
199
|
this.#images = data.images ? data.images.map(x => new InsiderAppCardImage(x)) : null;
|
|
200
|
+
this.#categories = [];
|
|
201
|
+
if (Array.isArray(data.categories)) {
|
|
202
|
+
for (const x of data.categories) {
|
|
203
|
+
if (x == null || typeof x !== 'object') {
|
|
204
|
+
console.warn(`[ReactNative] Skipping non-dictionary category element: ${JSON.stringify(x)}`);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (typeof x.id !== 'number' || typeof x.name !== 'string') {
|
|
208
|
+
console.warn(`[ReactNative] Skipping malformed category element: ${JSON.stringify(x)}`);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
this.#categories.push(new InsiderAppCardCategory(x));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
181
214
|
this.#content = data.content ? new InsiderAppCardContent(data.content) : null;
|
|
182
215
|
this.#buttons = data.buttons ? data.buttons.map(x => new InsiderAppCardButton(data.id, x)) : null;
|
|
183
216
|
this.#action = InsiderAppCardAction.fromData(data.action);
|
|
@@ -199,6 +232,10 @@ class InsiderAppCard {
|
|
|
199
232
|
return this.#images;
|
|
200
233
|
}
|
|
201
234
|
|
|
235
|
+
get categories() {
|
|
236
|
+
return this.#categories;
|
|
237
|
+
}
|
|
238
|
+
|
|
202
239
|
get content() {
|
|
203
240
|
return this.#content;
|
|
204
241
|
}
|
|
@@ -278,6 +315,7 @@ class InsiderAppCardsCampaignResponse {
|
|
|
278
315
|
export {
|
|
279
316
|
InsiderAppCardContent,
|
|
280
317
|
InsiderAppCardImage,
|
|
318
|
+
InsiderAppCardCategory,
|
|
281
319
|
InsiderAppCardButton,
|
|
282
320
|
|
|
283
321
|
InsiderAppCardAction,
|