Skip to content

Commit 19d369f

Browse files
authored
Merge pull request #8 from adjust/v007
Version 0.0.7
2 parents eebea51 + 8a8541a commit 19d369f

37 files changed

+2175
-1481
lines changed

README.md

Lines changed: 194 additions & 80 deletions
Large diffs are not rendered by default.

demo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
"test": "echo \"Error: no test specified\" && exit 1"
1111
},
1212
"dependencies": {
13-
"@adjustcom/smart-banner-sdk": "^0.0.6",
13+
"@adjustcom/smart-banner-sdk": "^0.0.7",
1414
"lorem-ipsum": "^2.0.8"
1515
},
1616
"author": "Adjust GmbH",
1717
"license": "MIT",
1818
"devDependencies": {
1919
"html-loader": "^4.2.0",
20-
"html-webpack-plugin": "^5.5.0",
20+
"html-webpack-plugin": "^5.5.3",
2121
"svg-inline-loader": "^0.8.2"
2222
}
2323
}

demo/src/data/default-sdk-settings.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { InitialisationOptions } from '@adjustcom/smart-banner-sdk';
33
export const defaultSdkSettings: InitialisationOptions = {
44
appToken: '6uzo4j2d8hz4',
55
logLevel: 'verbose',
6-
androidAppSchema: 'myapp',
7-
deepLinkPath: 'catalogue/product={product}',
8-
context: { promo: 'kitty', product: 't-shirt' }
6+
iosDeepLinkPath: 'items/{product}',
7+
androidDeepLinkPath: '{path}',
8+
context: { promo: 'kitty', product: 't-shirt', path: 'android/{promo}-promo' }
99
};

fake-data/smart_banners.json

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,110 @@
11
[
2+
{
3+
"id": "6bcbccc4-7929-47dd-ad39-a21b65c2ca20",
4+
"title": "utm params",
5+
"description": "Download now and enjoy! =)",
6+
"button_text": "Click me",
7+
"dismissal_period": 1209600,
8+
"icon_url": "https://cdn.pixabay.com/photo/2014/11/30/14/11/cat-551554_1280.jpg",
9+
"position": "top",
10+
"size": "small",
11+
"button_label": "Click me",
12+
"title_color": "#191D2F",
13+
"button_color": "#F4F6F9",
14+
"background_color": "#FFFFFF",
15+
"button_text_color": "#191D2F",
16+
"description_color": "#565C78",
17+
"background_image_url": null,
18+
"dismissal_button_color": "#565C78",
19+
"app_name": "0a0a0atestweb",
20+
"display_rule": "(\\/?\\?|&)utm_source=.*&|$",
21+
"display_rules": null,
22+
"tracker_url": {
23+
"template": "https://{domain}/{tracker}?campaign={utm_source}&engagement_type=fallback_click",
24+
"default_template": "https://{domain}/{tracker}?campaign={banner_name}&adgroup={localization_language}",
25+
"context": {
26+
"tracker": "15p8qqfg",
27+
"space_name": "SpaceTest3",
28+
"banner_name": "qa-is-cool",
29+
"localization_language": "default",
30+
"domain": "app.adjust.com"
31+
}
32+
},
33+
"localizations": {
34+
"fr": {
35+
"title": "French title",
36+
"description": "French description",
37+
"button_label": "Click",
38+
"button_text": "Click",
39+
"context": {
40+
"localization_language": "fr"
41+
}
42+
}
43+
}
44+
},
45+
{
46+
"id": "77bbd589-b93e-45d3-839c-789fda105024",
47+
"icon_url": "https://www.apptrace.com/api/app/318597939/artwork_url_small",
48+
"position": "top",
49+
"size": "small",
50+
"dismissal_period": 86400,
51+
"title": "Enjoy 10% off",
52+
"description": "Save on your first app order with code APP10. T&Cs apply.",
53+
"button_text": "Download now",
54+
"button_label": "Download now",
55+
"title_color": "#FFFFFF",
56+
"button_color": "#F9FAFC",
57+
"background_color": "#1E1E1E",
58+
"button_text_color": "#000000",
59+
"description_color": "#FFFFFF",
60+
"dismissal_button_color": "#555555",
61+
"app_name": "NET-A-PORTER",
62+
"display_rule": null,
63+
"tracker_url": {
64+
"template": "https://{domain}/{deep_link_path}?adj_t={tracker}&adj_campaign={campaign}&adj_adgroup={adgroup}&adj_engagement_type=fallback_click",
65+
"context": {
66+
"tracker": "fake_fake",
67+
"campaign": "nap_evergreen_smartbanner",
68+
"adgroup": "default",
69+
"domain": "5ed6.adj.st",
70+
"deep_link_path": "{iosDeepLinkPath}",
71+
"ios_deep_link_path": "."
72+
}
73+
},
74+
"localizations": {}
75+
},
76+
{
77+
"id": "77bbd589-b93e-45d3-839c-789fda105024",
78+
"icon_url": "https://www.apptrace.com/api/app/318597939/artwork_url_small",
79+
"position": "top",
80+
"size": "small",
81+
"dismissal_period": 86400,
82+
"title": "Enjoy 10% off",
83+
"description": "Save on your first app order with code APP10. T&Cs apply.",
84+
"button_text": "Download now",
85+
"button_label": "Download now",
86+
"title_color": "#FFFFFF",
87+
"button_color": "#F9FAFC",
88+
"background_color": "#1E1E1E",
89+
"button_text_color": "#000000",
90+
"description_color": "#FFFFFF",
91+
"dismissal_button_color": "#555555",
92+
"app_name": "NET-A-PORTER",
93+
"display_rule": null,
94+
"tracker_url": {
95+
"template": "https://{domain}/{tracker}?deep_link={deep_link}&campaign={campaign}&adgroup={adgroup}&engagement_type=fallback_click",
96+
"context": {
97+
"tracker": "fake_fake",
98+
"campaign": "nap_evergreen_smartbanner",
99+
"adgroup": "default",
100+
"domain": "app.adjust.com",
101+
"android_app_scheme": "nap",
102+
"android_deep_link_path": "{hallo}",
103+
"deep_link": "{androidAppScheme}://{androidDeepLinkPath}"
104+
}
105+
},
106+
"localizations": {}
107+
},
2108
{
3109
"id": "7091c9c2-981d-4d40-9add-675e5fe4b827",
4110
"title": "Small banner can has a long name but it should be trimmed to just one line. Let's make it even longer just because I can! Muahaha!",

fake-data/smart_banners_mock.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"icon_url": "https://icon/url",
1212
"button_text": "Button",
1313
"is_previous_attribution_priority": true,
14-
"default_language": "en",
1514
"button_color": "#000000",
1615
"dismissal_period": 60,
1716
"title": "Title",
@@ -23,25 +22,25 @@
2322
"description": "Описание",
2423
"button_text": "Кнопка",
2524
"context": {
26-
"adgroup": "ru"
25+
"localization_language": "ru"
2726
}
2827
},
2928
"de": {
3029
"title": "Titel",
3130
"description": "Beschreibung",
3231
"button_text": "Knopf",
3332
"context": {
34-
"adgroup": "de"
33+
"localization_language": "de"
3534
}
3635
}
3736
},
3837
"tracker_url": {
39-
"template": "https://{domain}/{tracker}?campaign={campaign}&adgroup={adgroup}",
38+
"template": "https://{domain}/{tracker}?campaign={campaign}&adgroup={localization_language}",
4039
"context": {
4140
"domain": "app.adjust.com",
4241
"tracker": "tracker",
4342
"campaign": "Banner",
44-
"adgroup": "en"
43+
"localization_language": "en"
4544
}
4645
}
4746
}

layout/src/smart-banner-view.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export class SmartBannerView implements SmartBannerLayout {
4848
} else {
4949
parent.appendChild(child);
5050
}
51-
}
51+
};
5252

5353
if (this.placeholder) {
54-
attach(this.placeholder, parent, this.data.position)
54+
attach(this.placeholder, parent, this.data.position);
5555
}
5656

5757
if (this.wrapper) {
@@ -78,7 +78,7 @@ export class SmartBannerView implements SmartBannerLayout {
7878

7979
this.bannerBody.render(this.root);
8080

81-
this.attachBannerToParent(this.parent)
81+
this.attachBannerToParent(this.parent);
8282
}
8383

8484
public update(banner: SmartBannerViewData, trackerUrl = '') {

layout/src/text/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { SmartBannerViewData } from '../data-types';
2-
31
import styles from './styles.module.scss';
42

53
export enum TextType {

loading-snippet.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@
3838
'show',
3939
'hide',
4040
'setLanguage',
41+
'setIosDeepLinkPath',
42+
'setAndroidDeepLinkPath',
43+
'setContext',
44+
45+
/* deprecated functions */
4146
'setAndroidAppSchema',
42-
'setDeepLinkPath',
43-
'setContext'
47+
'setDeepLinkPath'
4448
],
4549
function (context, queue, methodName) {
4650
context[methodName] = function () {

0 commit comments

Comments
 (0)