Skip to content

Commit

Permalink
Release of version 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Kurzawa committed May 23, 2023
1 parent ca4c69f commit 20692f2
Show file tree
Hide file tree
Showing 100 changed files with 258 additions and 263 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

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

## [0.13.0] - 2023-05-19

### Fixed
- [iOS] `PromotionImage` property mapping in `Promotion` object.

### Changed
- `RecommendationSeenEvent` and `RecommendationClickEvent` have new constructors, same as parent `RecommendationViewEvent` class before.
- Update of native SDK's dependencies.
- Improvements to stability.

### Added
- `RecommendationViewEvent` class.


## [0.12.0] - 2023-03-27

### Fixed
Expand All @@ -20,6 +34,7 @@ All notable changes to this project will be documented in this file.
- `Injector.getBanners` method.
- `Injector.showBanner` method.


## [0.11.0] - 2023-02-07

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ repositories {
dependencies {
implementation 'com.facebook.react:react-native:+'
implementation "com.squareup.okhttp3:logging-interceptor:4.9.1"
api 'com.synerise.sdk:synerise-mobile-sdk:5.0.1'
api 'com.synerise.sdk:synerise-mobile-sdk:5.4.0'
}

//apply from: 'publish.gradle'
Binary file not shown.
20 changes: 19 additions & 1 deletion ios/ReactNativeSynerise/Modules/RNPromotions.m
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ - (nullable NSDictionary *)dictionaryWithPromotion:(SNRPromotion *)model {
[dictionary setString:model.name forKey:@"name"];
[dictionary setString:model.headline forKey:@"headline"];
[dictionary setString:model.descriptionText forKey:@"descriptionText"];
[dictionary setArray:model.images forKey:@"images"];
[dictionary setArray:[self arrayWithPromotionImages:model.images] forKey:@"images"];

[dictionary setDate:model.startAt forKey:@"startAt"];
[dictionary setDate:model.expireAt forKey:@"expireAt"];
Expand Down Expand Up @@ -242,6 +242,24 @@ - (nullable NSDictionary *)dictionaryWithPromotionDiscountStep:(SNRPromotionDisc
return nil;
}

- (nullable NSArray *)arrayWithPromotionImages:(NSArray<SNRPromotionImage *> *)model {
if (model != nil) {
NSMutableArray *array = [@[] mutableCopy];

for (SNRPromotionImage *promotionImageModel in model) {
NSMutableDictionary *dictionary = [@{} mutableCopy];
[dictionary setString:promotionImageModel.url forKey:@"url"];
[dictionary setString:SNR_PromotionImageTypeToString(promotionImageModel.type) forKey:@"type"];

[array addObject:dictionary];
}

return array;
}

return nil;
}

- (nullable NSDictionary *)dictionaryWithAssignVoucherResponse:(SNRAssignVoucherResponse *)model {
if (model != nil) {
NSMutableDictionary *dictionary = [@{} mutableCopy];
Expand Down
5 changes: 5 additions & 0 deletions ios/ReactNativeSynerise/Modules/RNTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ - (SNRCustomEvent *)eventWithDictionary:(NSDictionary *)dictionary {
[builder setObject:((NSDictionary *)paramValue) forKey:paramKey];
continue;
}

if ([paramValue isKindOfClass:[NSArray class]] == YES) {
[builder setObject:((NSArray *)paramValue) forKey:paramKey];
continue;
}
}
}
}];
Expand Down
2 changes: 1 addition & 1 deletion ios/react-native-synerise-sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'json'

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

SYNERISE_SDK_FRAMEWORK_VERSION = '4.10.1'
SYNERISE_SDK_FRAMEWORK_VERSION = '4.12.2'

Pod::Spec.new do |s|
s.name = package['name']
Expand Down
1 change: 0 additions & 1 deletion lib/classes/api_queries/BaseApiQuery.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiQuerySortingOrder = exports.BaseApiQuery = void 0;
var ApiQuerySortingOrder;
(function (ApiQuerySortingOrder) {
ApiQuerySortingOrder["Ascending"] = "asc";
Expand Down
1 change: 0 additions & 1 deletion lib/classes/api_queries/DocumentsApiQuery.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DocumentsApiQuery = void 0;
var DocumentsApiQuery = /** @class */ (function () {
function DocumentsApiQuery(type, typeValue, version) {
this.type = type;
Expand Down
1 change: 0 additions & 1 deletion lib/classes/api_queries/DocumentsApiQueryType.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DocumentsApiQueryType = void 0;
var DocumentsApiQueryType;
(function (DocumentsApiQueryType) {
DocumentsApiQueryType["SCHEMA"] = "by-schema";
Expand Down
1 change: 0 additions & 1 deletion lib/classes/api_queries/PromotionsApiQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PromotionsApiQuery = void 0;
var BaseApiQuery_1 = require("./BaseApiQuery");
var PromotionsApiQuery = /** @class */ (function (_super) {
__extends(PromotionsApiQuery, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/CustomEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomEvent = void 0;
var Event_1 = require("./Event");
var CustomEvent = /** @class */ (function (_super) {
__extends(CustomEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/Event.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Event = void 0;
var Event = /** @class */ (function () {
function Event(label, action, parameters) {
this.label = label;
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/auth/LoggedInEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.LoggedInEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var LoggedInEvent = /** @class */ (function (_super) {
__extends(LoggedInEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/auth/LoggedOutEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.LoggedOutEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var LoggedOutEvent = /** @class */ (function (_super) {
__extends(LoggedOutEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/auth/RecognizeClientEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecognizeClientEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var RECOGNIZE_CLIENT_EVENT_LABEL = 'client';
var RECOGNIZE_CLIENT_EVENT_ACTION = 'client.createOrUpdate';
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/auth/RegisteredEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RegisteredEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var RegisteredEvent = /** @class */ (function (_super) {
__extends(RegisteredEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/cart/CartEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CartEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var Params;
(function (Params) {
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/cart/ProductAddedToCartEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductAddedToCartEvent = void 0;
var CartEvent_1 = require("../cart/CartEvent");
var ProductAddedToCartEvent = /** @class */ (function (_super) {
__extends(ProductAddedToCartEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/cart/ProductRemovedFromCartEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductRemovedFromCartEvent = void 0;
var CartEvent_1 = require("../cart/CartEvent");
var ProductRemovedFromCartEvent = /** @class */ (function (_super) {
__extends(ProductRemovedFromCartEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/cart/UnitPrice.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnitPrice = void 0;
var UnitPrice = /** @class */ (function () {
function UnitPrice(amount, currency) {
this.amount = amount;
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/other/AppearedInLocationEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppearedInLocationEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var Params;
(function (Params) {
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/other/HitTimerEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.HitTimerEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var HitTimerEvent = /** @class */ (function (_super) {
__extends(HitTimerEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/other/SearchedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SearchedEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var SearchedEvent = /** @class */ (function (_super) {
__extends(SearchedEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/other/SharedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SharedEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var SharedEvent = /** @class */ (function (_super) {
__extends(SharedEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/other/VisitedScreenEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.VisitedScreenEvent = void 0;
var CustomEvent_1 = require("./../CustomEvent");
var VisitedScreenEvent = /** @class */ (function (_super) {
__extends(VisitedScreenEvent, _super);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductAddedToFavouritesEvent = void 0;
var CustomEvent_1 = require("../CustomEvent");
var ProductAddedToFavouritesEvent = /** @class */ (function (_super) {
__extends(ProductAddedToFavouritesEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/product/ProductViewedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductViewedEvent = void 0;
var CustomEvent_1 = require("../CustomEvent");
var Params;
(function (Params) {
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/push/PushCancelledEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PushCancelledEvent = void 0;
var CustomEvent_1 = require("../CustomEvent");
var PushCancelledEvent = /** @class */ (function (_super) {
__extends(PushCancelledEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/push/PushClickedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PushClickedEvent = void 0;
var CustomEvent_1 = require("../CustomEvent");
var PushClickedEvent = /** @class */ (function (_super) {
__extends(PushClickedEvent, _super);
Expand Down
1 change: 0 additions & 1 deletion lib/classes/events/push/PushViewedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PushViewedEvent = void 0;
var CustomEvent_1 = require("../CustomEvent");
var PushViewedEvent = /** @class */ (function (_super) {
__extends(PushViewedEvent, _super);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { RecommendationEvent } from './RecommendationEvent';
declare class RecommendationClickEvent extends RecommendationEvent {
constructor(label: string, productId: string, name: string, campaignId: string, campaignHash: string, parameters?: object);
constructor(label: string, productId: string, productName: string, campaignId: string, campaignHash: string, parameters?: object);
setCategory(category: string): void;
setUrl(url: string): void;
}
export { RecommendationClickEvent };
25 changes: 22 additions & 3 deletions lib/classes/events/recommendation/RecommendationClickEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,32 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecommendationClickEvent = void 0;
var RecommendationEvent_1 = require("./RecommendationEvent");
var Params;
(function (Params) {
Params["PRODUCT_ID"] = "productId";
Params["PRODUCT_NAME"] = "name";
Params["CATEGORY"] = "category";
Params["URL"] = "url";
Params["CAMPAIGN_ID"] = "campaignId";
Params["CAMPAIGN_HASH"] = "campaignHash";
})(Params || (Params = {}));
var RecommendationClickEvent = /** @class */ (function (_super) {
__extends(RecommendationClickEvent, _super);
function RecommendationClickEvent(label, productId, name, campaignId, campaignHash, parameters) {
return _super.call(this, label, 'recommendation.click', productId, name, campaignId, campaignHash, parameters || {}) || this;
function RecommendationClickEvent(label, productId, productName, campaignId, campaignHash, parameters) {
var _this = _super.call(this, label, 'recommendation.click', parameters || {}) || this;
_this.parameters[Params.PRODUCT_ID] = productId;
_this.parameters[Params.PRODUCT_NAME] = productName;
_this.parameters[Params.CAMPAIGN_ID] = campaignId;
_this.parameters[Params.CAMPAIGN_HASH] = campaignHash;
return _this;
}
RecommendationClickEvent.prototype.setCategory = function (category) {
this.parameters[Params.CATEGORY] = category;
};
RecommendationClickEvent.prototype.setUrl = function (url) {
this.parameters[Params.URL] = url;
};
return RecommendationClickEvent;
}(RecommendationEvent_1.RecommendationEvent));
exports.RecommendationClickEvent = RecommendationClickEvent;
3 changes: 0 additions & 3 deletions lib/classes/events/recommendation/RecommendationEvent.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { CustomEvent } from '../CustomEvent';
declare class RecommendationEvent extends CustomEvent {
constructor(label: string, action: string, productId: string, name: string, campaignId: string, campaignHash: string, parameters?: object);
setCategory(category: string): void;
setUrl(url: string): void;
}
export { RecommendationEvent };
25 changes: 2 additions & 23 deletions lib/classes/events/recommendation/RecommendationEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,12 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecommendationEvent = void 0;
var CustomEvent_1 = require("../CustomEvent");
var Params;
(function (Params) {
Params["PRODUCT_ID"] = "productId";
Params["NAME"] = "name";
Params["CATEGORY"] = "category";
Params["URL"] = "url";
Params["CAMPAIGN_ID"] = "campaignId";
Params["CAMPAIGN_HASH"] = "campaignHash";
})(Params || (Params = {}));
var RecommendationEvent = /** @class */ (function (_super) {
__extends(RecommendationEvent, _super);
function RecommendationEvent(label, action, productId, name, campaignId, campaignHash, parameters) {
var _this = _super.call(this, label, action, parameters || {}) || this;
_this.parameters[Params.PRODUCT_ID] = productId;
_this.parameters[Params.NAME] = name;
_this.parameters[Params.CAMPAIGN_ID] = campaignId;
_this.parameters[Params.CAMPAIGN_HASH] = campaignHash;
return _this;
function RecommendationEvent() {
return _super !== null && _super.apply(this, arguments) || this;
}
RecommendationEvent.prototype.setCategory = function (category) {
this.parameters[Params.CATEGORY] = category;
};
RecommendationEvent.prototype.setUrl = function (url) {
this.parameters[Params.URL] = url;
};
return RecommendationEvent;
}(CustomEvent_1.CustomEvent));
exports.RecommendationEvent = RecommendationEvent;
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { RecommendationEvent } from './RecommendationEvent';
declare class RecommendationSeenEvent extends RecommendationEvent {
constructor(label: string, productId: string, name: string, campaignId: string, campaignHash: string, parameters?: object);
constructor(label: string, productId: string, productName: string, campaignId: string, campaignHash: string, parameters?: object);
setCategory(category: string): void;
setUrl(url: string): void;
}
export { RecommendationSeenEvent };
Loading

0 comments on commit 20692f2

Please sign in to comment.