Skip to content

Commit 91c5d58

Browse files
committed
Merge pull request #48 from adjust/v100
Version 1.0.0
2 parents 2b46c2e + fbed568 commit 91c5d58

File tree

19 files changed

+112
-273
lines changed

19 files changed

+112
-273
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Version 1.0.0 (23rd November 2023)
2+
3+
The first release of a new Adjust Smart Banner SDK!
4+
5+
#### Added
6+
- Three sizes of banner: small, medium and large.
7+
- Banner custom colors and images support.
8+
- Automatic detection of browser language and ability to force SDK to show banners in chosen language.
9+
- Placement conditions support: choose pages where show banners.
10+
- UTM parameters passing to campaign parameters.
11+
- Dynamic deeplinks.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Adjust GmbH, https://www.adjust.com
3+
Copyright (c) 2023 Adjust GmbH, https://www.adjust.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ The sdk is also available through CDN and then accessible through global `Adjust
2828
To <a id="loading-snippet">load Smart Banner SDK through CDN</a> paste the following snippet into the `<head>` tag:
2929
```html
3030
<script type="application/javascript">
31-
!function(e,n,t,a,o,s,r,i,c){var d=o+"_q";e[o]=e[o]||{},e[d]=e[d]||[];for(var u=0;u<s.length;u++)r(e[o],e[d],s[u]);i=n.createElement(t),c=n.getElementsByTagName(t)[0],i.async=!0,i.src="https://cdn.adjust.com/adjust-smart-banner-latest.min.js",i.onload=function(){e[o]=e[o].default;for(var n=0;n<e[d].length;n++)e[o][e[d][n][0]]?e[o][e[d][n][0]].apply(e[o],e[d][n][1]):console.error("No such function found in "+o+": "+e[d][n][0]);e[d]=[]},c.parentNode.insertBefore(i,c)}(window,document,"script",0,"AdjustSmartBanner",["init","show","hide","setLanguage","setIosDeepLinkPath","setAndroidDeepLinkPath","setContext","setAndroidAppSchema","setDeepLinkPath"],(function(e,n,t){e[t]=function(){n.push([t,arguments])}}));
31+
!function(n,t,e,o,a,s,r,i,c){var u=a+"_q";n[a]=n[a]||{},n[u]=n[u]||[];for(var d=0;d<s.length;d++)r(n[a],n[u],s[d]);i=t.createElement(e),c=t.getElementsByTagName(e)[0],i.async=!0,i.src="https://cdn.adjust.com/adjust-smart-banner-latest.min.js",i.onload=function(){n[a]=n[a].default;for(var t=0;t<n[u].length;t++)n[a][n[u][t][0]]?n[a][n[u][t][0]].apply(n[a],n[u][t][1]):console.error("No such function found in "+a+": "+n[u][t][0]);n[u]=[]},c.parentNode.insertBefore(i,c)}(window,document,"script",0,"AdjustSmartBanner",["init","show","hide","setLanguage","setIosDeepLinkPath","setAndroidDeepLinkPath","setContext"],(function(n,t,e){n[e]=function(){t.push([e,arguments])}}));
3232
</script>
3333
```
3434

35-
When loading the sdk through CDN we suggest using minified version. You can target specific version like `https://cdn.adjust.com/adjust-smart-banner-0.0.7.min.js`, or you can target latest version `https://cdn.adjust.com/adjust-smart-banner-latest.min.js` if you want automatic updates without need to change the target file. The sdk files are cached so they are served as fast as possible, and the cache is refreshed every half an hour. If you want updates immediately make sure to target specific version.
35+
When loading the sdk through CDN we suggest using minified version. You can target specific version like `https://cdn.adjust.com/adjust-smart-banner-1.0.0.min.js`, or you can target latest version `https://cdn.adjust.com/adjust-smart-banner-latest.min.js` if you want automatic updates without need to change the target file. The sdk files are cached so they are served as fast as possible, and the cache is refreshed every half an hour. If you want updates immediately make sure to target specific version.
3636

3737

3838
## <a id="initialization">Initialization</a>
@@ -100,16 +100,6 @@ AdjustSmartBanner.init({
100100

101101
These parameters allow you to specify where your user lands in your app when they click on banner. For further information see [Deeplinks](#deeplinks).
102102

103-
##### <a id="init-schema">**androidAppSchema**</a> `string`
104-
105-
> [!WARNING]
106-
> Parameter `androidAppSchema` is deprecated, please don't use it anymore.
107-
108-
##### <a id="init-deeplinkpath">**deepLinkPath**</a> `string`
109-
110-
> [!WARNING]
111-
> Parameter `deepLinkPath` is deprecated, please use [`androidDeepLinkPath`](#init-androiddeeplinkpath) and [`iosDeepLinkPath`](#init-iosdeeplinkpath) respectivetely the platform where you want deeplink path to be changed.
112-
113103
##### <a id="init-androiddeeplinkpath">**androidDeepLinkPath**</a> `string`
114104

115105
Overrides Android deeplink path, which allows you to change user destination in your mobile app when they click on banner.
@@ -349,16 +339,6 @@ AdjustSmartBanner.setContext({ product_id: "999888" });
349339

350340
There are several functions to set custom deeplink path or deeplink path template and its context.
351341

352-
#### <a id="deeplinks-setters-schema">**setAndroidAppScheme**</a>
353-
354-
> [!WARNING]
355-
> Method `setAndroidAppSchema` is deprecated, please don't use it anymore.
356-
357-
#### <a id="deeplinks-setters-deeplinkpath">**setDeepLinkPath**</a>
358-
359-
> [!WARNING]
360-
> Method `setDeepLinkPath` is deprecated and will be removed, please use [`setAndroidDeepLinkPath`](#init-androiddeeplinkpath) and [`setIosDeepLinkPath`](#init-iosdeeplinkpath) respectivetely the platform where you want deeplink path to be changed.
361-
362342
#### <a id="deeplinks-setters-androidDeeplinkpath">**setAndroidDeepLinkPath**</a>
363343

364344
Accepts a string representing deep link path or deeplint path template.

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test": "echo \"Error: no test specified\" && exit 1"
1111
},
1212
"dependencies": {
13-
"@adjustcom/smart-banner-sdk": "^0.0.7",
13+
"@adjustcom/smart-banner-sdk": "^1.0.0",
1414
"lorem-ipsum": "^2.0.8"
1515
},
1616
"author": "Adjust GmbH",

loading-snippet.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@
4040
'setLanguage',
4141
'setIosDeepLinkPath',
4242
'setAndroidDeepLinkPath',
43-
'setContext',
44-
45-
/* deprecated functions */
46-
'setAndroidAppSchema',
47-
'setDeepLinkPath'
43+
'setContext'
4844
],
4945
function (context, queue, methodName) {
5046
context[methodName] = function () {

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adjustcom/smart-banner-sdk-project",
3-
"version": "0.0.1",
3+
"version": "1.0.0",
44
"description": "Adjust Smart Banner SDK",
55
"scripts": {
66
"build": "npm run build --workspace=layout && npm run build --workspace=sdk && npm run build:snippet && npm run copy",

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adjustcom/smart-banner-sdk",
3-
"version": "0.0.7",
3+
"version": "1.0.0",
44
"description": "Adjust Smart Banner SDK",
55
"scripts": {
66
"build:sdk": "webpack --config ./webpack.config.js",

sdk/src/data/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export interface SmartBannerResponseData {
6262
}
6363

6464
export interface PlacementCondition {
65-
operator: "or" | "and";
65+
operator: 'or' | 'and';
6666
rules: Array<PlacementCondition | string>;
6767
}
6868

sdk/src/domain/banners-filter/display-rules.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class DisplayRules implements BannerFilter {
1212
constructor(private url: string) { }
1313

1414
private and(rules: Array<PlacementCondition | string>): boolean {
15-
for (let rule of rules) {
15+
for (const rule of rules) {
1616
if (typeof rule === 'string') {
1717
if (!new RegExp(rule, 'i').test(this.url)) {
1818
return false; // if at least one rule form rules array doesn't match then the entire condition doesn't match
@@ -28,7 +28,7 @@ export class DisplayRules implements BannerFilter {
2828
}
2929

3030
private or(rules: Array<PlacementCondition | string>): boolean {
31-
for (let rule of rules) {
31+
for (const rule of rules) {
3232
if (typeof rule === 'string') {
3333
if (new RegExp(rule, 'i').test(this.url)) {
3434
return true; // if at least one rule form rules array does match then the entire condition does match
@@ -50,7 +50,7 @@ export class DisplayRules implements BannerFilter {
5050
return this.and(condition.rules);
5151
}
5252

53-
Logger.warn('Unknown operator ' + condition.operator + ', try to update the SDK.')
53+
Logger.warn('Unknown operator ' + condition.operator + ', try to update the SDK.');
5454
return false;
5555
}
5656

@@ -81,7 +81,7 @@ export class DisplayRules implements BannerFilter {
8181
} else if (match === MatchType.default) {
8282
defaultBanners.push(it);
8383
}
84-
})
84+
});
8585

8686
if (matchingNonDefault.length > 0) {
8787
return matchingNonDefault;

0 commit comments

Comments
 (0)