Skip to content

Commit 9983e45

Browse files
author
Krzysztof Kurzawa
committed
Release of version 1.2.0
1 parent d402b89 commit 9983e45

20 files changed

+45
-63
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.2.0] - 2025-05-13
6+
7+
### Added
8+
- `params` property in `DocumentApiQuery` model to set custom params for fetching Documents.
9+
- `params` property in `ScreenViewApiQuery` model to set custom params for fetching Screen Views.
10+
11+
512
## [1.1.1] - 2025-04-18
613

714
### Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Synerise React Native SDK (react-native-synerise-sdk) (1.1.1)
1+
# Synerise React Native SDK (react-native-synerise-sdk) (1.2.0)
22

33
[![Platform](https://img.shields.io/badge/platform-iOS-orange.svg)](https://github.com/synerise/ios-sdk)
44
[![Platform](https://img.shields.io/badge/platform-Android-orange.svg)](https://github.com/synerise/android-sdk)

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ ext.versions = [
44
'minSdk' : 24,
55
'compileSdk' : 33,
66
'targetSdk' : 33,
7-
'versionCode': 48,
8-
'versionName': "1.1.1"
7+
'versionCode': 51,
8+
'versionName': "1.2.0"
99
]
1010

1111
buildscript {
@@ -58,7 +58,7 @@ repositories {
5858
dependencies {
5959
implementation 'com.facebook.react:react-native:+'
6060
implementation "com.squareup.okhttp3:logging-interceptor:4.9.1"
61-
api 'com.synerise.sdk:synerise-mobile-sdk:6.1.1'
61+
api 'com.synerise.sdk:synerise-mobile-sdk:6.2.0'
6262
}
6363

6464
//apply from: 'publish.gradle'

android/src/main/java/com/synerise/sdk/react/RNContent.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
import java.text.SimpleDateFormat;
3030
import java.util.ArrayList;
3131
import java.util.Date;
32+
import java.util.HashMap;
3233
import java.util.List;
3334
import java.util.Locale;
35+
import java.util.Objects;
3436

3537
import javax.annotation.Nonnull;
3638

@@ -190,7 +192,11 @@ public void onDataAction(ApiError apiError) {
190192
public void generateScreenViewWithApiQuery(ReadableMap screenViewApiQueryMap, Callback callback) {
191193
String feedSlug = screenViewApiQueryMap.hasKey("feedSlug") ? screenViewApiQueryMap.getString("feedSlug") : "";
192194
String productId = screenViewApiQueryMap.hasKey("productId") ? screenViewApiQueryMap.getString("productId") : "";
195+
HashMap<String, Object> params = screenViewApiQueryMap.hasKey("params") ? screenViewApiQueryMap.getMap("params").toHashMap() : null;
193196
ScreenViewApiQuery screenViewApiQuery = new ScreenViewApiQuery(feedSlug, productId);
197+
if (params != null) {
198+
screenViewApiQuery.setParams(params);
199+
}
194200
if (generateScreenViewApiCall != null) generateScreenViewApiCall.cancel();
195201
generateScreenViewApiCall = Content.generateScreenView(screenViewApiQuery);
196202
generateScreenViewApiCall.execute(
@@ -232,7 +238,7 @@ public void onDataAction(ApiError apiError) {
232238
}
233239

234240
private DocumentApiQuery readableMapToDocumentApiQuery(ReadableMap map) {
235-
String slugName = map.hasKey("feedSlug") ? map.getString("feedSlug") : "";
241+
String slugName = map.hasKey("slug") ? map.getString("slug") : "";
236242
DocumentApiQuery documentApiQuery = new DocumentApiQuery(slugName);
237243
documentApiQuery.setProductId(map.hasKey("productId") ? map.getString("productId") : null);
238244
documentApiQuery.setItemsIds(map.hasKey("itemsIds") ? readableArrayToListOfStrings(map.getArray("itemsIds")) : null);
@@ -247,6 +253,11 @@ private DocumentApiQuery readableMapToDocumentApiQuery(ReadableMap map) {
247253
if (map.hasKey("elasticFiltersJoiner")) {
248254
documentApiQuery.setElasticFiltersJoiner(FiltersJoinerRule.valueOf(map.getString("elasticFiltersJoiner")));
249255
}
256+
if (map.hasKey("params")) {
257+
if (map.getMap("params") != null) {
258+
documentApiQuery.setParams(map.getMap("params").toHashMap());
259+
}
260+
}
250261

251262
return documentApiQuery;
252263
}

android/src/main/java/com/synerise/sdk/react/RNSyneriseInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class RNSyneriseInitializer {
1616
public Boolean isCrashHandlingEnabled;
1717
public static volatile boolean isInitialized = false;
1818

19-
public static final String SDK_PLUGIN_VERSION = "1.1.1";
19+
public static final String SDK_PLUGIN_VERSION = "1.2.0";
2020

2121
public void initialize(Application app) {
2222
if (isInitialized == false) {

ios/ReactNativeSynerise/Main/RNSyneriseInitializer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#import "RNSyneriseInitializer.h"
1010

11-
NSString * const SNRSyneriseSDKPluginVersion = @"1.1.1";
11+
NSString * const SNRSyneriseSDKPluginVersion = @"1.2.0";
1212

1313
@implementation RNSyneriseInitializer
1414

ios/ReactNativeSynerise/Modules/RNContent.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ - (SNRDocumentApiQuery *)modelDocumentApiQueryWithDictionary:(NSDictionary *)dic
5757

5858
model.displayAttribute = [dictionary getArrayForKey:@"displayAttribute"];
5959
model.includeContextItems = [dictionary getBoolForKey:@"includeContextItems"];
60-
60+
model.params = [dictionary getDictionaryForKey:@"params"];
61+
6162
return model;
6263
}
6364
}
@@ -98,8 +99,9 @@ - (SNRScreenViewApiQuery *)modelScreenViewApiQueryWithDictionary:(NSDictionary *
9899
if (dictionary != nil) {
99100
NSString *feedSlug = [dictionary getStringForKey:@"feedSlug"];
100101
if (feedSlug != nil) {
101-
SNRScreenViewApiQuery *model = [[SNRScreenViewApiQuery alloc] initWithFeedSlug:feedSlug productID:nil];
102+
SNRScreenViewApiQuery *model = [[SNRScreenViewApiQuery alloc] initWithSlug:feedSlug];
102103
model.productID = [dictionary getStringForKey:@"productId"];
104+
model.params = [dictionary getDictionaryForKey:@"params"];
103105

104106
return model;
105107
}

ios/react-native-synerise-sdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require 'json'
22

33
package = JSON.parse(File.read('./../package.json'))
44

5-
SYNERISE_SDK_FRAMEWORK_VERSION = '5.1.0'
5+
SYNERISE_SDK_FRAMEWORK_VERSION = '5.3.0'
66

77
Pod::Spec.new do |s|
88
s.name = package['name']

lib/classes/api_queries/DocumentApiQuery.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ declare class DocumentApiQuery {
1010
elasticFiltersJoiner?: RecommendationFiltersJoinerRule;
1111
displayAttribute?: Array<string>;
1212
includeContextItems?: boolean;
13+
params?: object;
1314
constructor(slug: string);
1415
toObject(): {
1516
slug: string;
@@ -22,6 +23,7 @@ declare class DocumentApiQuery {
2223
elasticFiltersJoiner: RecommendationFiltersJoinerRule | undefined;
2324
displayAttribute: string[] | undefined;
2425
includeContextItems: boolean | undefined;
26+
params: object | undefined;
2527
};
2628
}
2729
export { DocumentApiQuery };

lib/classes/api_queries/DocumentApiQuery.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ var DocumentApiQuery = /** @class */ (function () {
1616
additionalElasticFilters: this.additionalElasticFilters,
1717
elasticFiltersJoiner: this.elasticFiltersJoiner,
1818
displayAttribute: this.displayAttribute,
19-
includeContextItems: this.includeContextItems
19+
includeContextItems: this.includeContextItems,
20+
params: this.params
2021
};
2122
};
2223
return DocumentApiQuery;

lib/classes/api_queries/DocumentsApiQuery.d.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

lib/classes/api_queries/DocumentsApiQuery.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

lib/classes/api_queries/DocumentsApiQueryType.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

lib/classes/api_queries/DocumentsApiQueryType.js

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
declare class ScreenViewApiQuery {
22
feedSlug: string;
33
productId?: string | null;
4+
params?: object | null;
45
constructor(feedSlug: string, productId?: string | null);
56
toObject(): {
67
feedSlug: string;
78
productId: string | null | undefined;
9+
params: object | null | undefined;
810
};
911
}
1012
export { ScreenViewApiQuery };

lib/classes/api_queries/ScreenViewApiQuery.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var ScreenViewApiQuery = /** @class */ (function () {
1010
return {
1111
feedSlug: this.feedSlug,
1212
productId: this.productId,
13+
params: this.params
1314
};
1415
};
1516
return ScreenViewApiQuery;

lib/config/import_models.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export { ScreenView } from './../classes/models/Content/ScreenView';
3939
export { ScreenViewAudienceInfo } from '../classes/models/Content/ScreenViewAudienceInfo';
4040
export { BaseApiQuery, IApiQuerySorting, ApiQuerySortingOrder } from './../classes/api_queries/BaseApiQuery';
4141
export { PromotionsApiQuery } from './../classes/api_queries/PromotionsApiQuery';
42-
export { DocumentsApiQuery } from './../classes/api_queries/DocumentsApiQuery';
43-
export { DocumentsApiQueryType } from './../classes/api_queries/DocumentsApiQueryType';
42+
export { DocumentApiQuery } from './../classes/api_queries/DocumentApiQuery';
43+
export { ScreenViewApiQuery } from './../classes/api_queries/ScreenViewApiQuery';
4444
export { Token } from './../classes/models/Token/Token';
4545
export { TokenOrigin, TokenOriginFromString, TokenOriginToString } from './../classes/models/Token/TokenOrigin';
4646
export { InitializationConfig } from './../classes/models/Misc/InitializationConfig';

lib/config/import_models.js

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": "react-native-synerise-sdk",
3-
"version": "1.1.1",
3+
"version": "1.2.0",
44
"description": "React Native wrapper for Synerise SDK",
55
"author": {
66
"name": "Synerise",

react-native-synerise-sdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require 'json'
22

33
package = JSON.parse(File.read('./package.json'))
44

5-
SYNERISE_SDK_FRAMEWORK_VERSION = '5.1.0'
5+
SYNERISE_SDK_FRAMEWORK_VERSION = '5.3.0'
66

77
Pod::Spec.new do |s|
88
s.name = package['name']

0 commit comments

Comments
 (0)