Skip to content

Commit faa7a18

Browse files
author
Krzysztof Kurzawa
committed
Release of version 0.24.0
1 parent 82a5563 commit faa7a18

20 files changed

+275
-23
lines changed

CHANGELOG.md

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

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

5+
## [0.24.0] - 2024-10-07
6+
7+
### Fixed
8+
- [iOS] Some potential issues with possible database corruption.
9+
- [Android] Notification callback issue when app was in foreground.
10+
11+
### Added
12+
- `Synerise.Settings.inAppMessaging.contentBaseUrl` option in settings to let you set the base URL to use for all relative URLs in an in-app message's creation.
13+
- `Synerise.Client.updateAccountBasicInformation(context, onSuccess, onError)` method. The new method updates anonymous users.
14+
- `ClientAccountUpdateBasicInformationContext` model correlated with the new `Synerise.Client.updateAccountBasicInformation(context, onSuccess, onError)` method.
15+
16+
### Changed
17+
- [Android] Fresco library is now updated to 3.2.0.
18+
- Optimization of the In-app messaging module (variants are no longer assigned once more when the profile's UUID changes).
19+
- Improvements to stability.
20+
21+
522
## [0.23.1] - 2024-09-16
623

724
### Fixed
@@ -43,7 +60,7 @@ The SDK version 0.21.0 has been omitted for technical reasons.
4360
- [iOS] Some potential issues with retrieving system push consent by the SDK. The SDK set the constent to false when the general consent for the application was enabled, but at least one of the following options was disabled: alerts, sounds, badges.
4461

4562
### Added
46-
- `Synerise.settings.tracker.eventsTriggeringFlush` option in settings to let you set the list of event actions which will trigger instant sending of all events in the queue. The default array contains only push event's actions.
63+
- `Synerise.Settings.tracker.eventsTriggeringFlush` option in settings to let you set the list of event actions which will trigger instant sending of all events in the queue. The default array contains only push event's actions.
4764

4865
### Changed
4966
- All events connected with push campaigns will flush the queue and send events immediately.
@@ -62,7 +79,7 @@ The SDK version 0.21.0 has been omitted for technical reasons.
6279

6380
### Added
6481
- Global Control Group support for in-app messages. From now on, you can use this feature in in-app messaging communication. This lets you take your marketing efforts to the next level and provides a solid foundation for accurate measurement of campaign effectiveness. Read more at https://hub.synerise.com/docs/settings/configuration/global-control-group/.
65-
- [iOS] `Synerise.settings.sdk.localizable` option in settings to let you localize some strings displayed by the SDK.
82+
- [iOS] `Synerise.Settings.sdk.localizable` option in settings to let you localize some strings displayed by the SDK.
6683

6784
### Changed
6885
- Improved mechanism for checking capping in in-app messages. The number of views no longer resets when the account's UUID changes.
@@ -278,14 +295,14 @@ https://hub.synerise.com//developers/mobile-sdk/campaigns/action-handling/
278295
### Added
279296

280297
- Information about device root is moved to AppStarted event.
281-
- New option to set whether events should be sent when server time synchronization has failed - `Synerise.settings.tracker.isBackendTimeSyncRequired`.
298+
- New option to set whether events should be sent when server time synchronization has failed - `Synerise.Settings.tracker.isBackendTimeSyncRequired`.
282299
- `Client.deleteAccountByIdentityProvider` method.
283300

284301
## [0.9.14] - 2020-10-15
285302

286303
### Added
287304

288-
- Support for encrypted notifications (enabled by `Synerise.settings.notifications.encryption`). [1]
305+
- Support for encrypted notifications (enabled by `Synerise.Settings.notifications.encryption`). [1]
289306

290307
[1] Please read full documentation:
291308
iOS: https://help.synerise.com/developers/ios-sdk/configure-notifications/#configuring-notification-encryption
@@ -308,7 +325,7 @@ Android: https://help.synerise.com/developers/android-sdk/configure-notification
308325
- `Synerise.Injector.authenticateByOAuthIfRegistered` method.
309326
- `Synerise.Injector.deleteAccountByOAuth` method.
310327
- `Synerise.Injector.deleteAccountByAppleSignIn` method.
311-
- `Synerise.settings.sdk.sdk.shouldDestroySessionOnApiKeyChange` option in settings.
328+
- `Synerise.Settings.sdk.shouldDestroySessionOnApiKeyChange` option in settings.
312329

313330
## [0.9.11] - 2020-05-18
314331

@@ -336,7 +353,7 @@ Android: https://help.synerise.com/developers/android-sdk/configure-notification
336353

337354
### Fixed
338355

339-
- `Synerise.settings` module issues.
356+
- `Synerise.Settings` module issues.
340357

341358
## [0.9.7] - 2020-03-02
342359

@@ -345,7 +362,7 @@ Android: https://help.synerise.com/developers/android-sdk/configure-notification
345362
- OAuth/Facebook authentication.
346363
- Walkthrough campaign.
347364
- Walkthrough listener in `Synerise.Injector` module.
348-
- `Synerise.settings.injector.automatic` option in settings.
365+
- `Synerise.Settings.injector.automatic` option in settings.
349366
- Vouchers methods in `Synerise.Promotions` module.
350367
- `Synerise.changeClientApiKey` method.
351368

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) (0.23.1)
1+
# Synerise React Native SDK (react-native-synerise-sdk) (0.24.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' : 21,
55
'compileSdk' : 33,
66
'targetSdk' : 33,
7-
'versionCode': 38,
8-
'versionName': "0.23.1"
7+
'versionCode': 40,
8+
'versionName': "0.24.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:5.20.1'
61+
api 'com.synerise.sdk:synerise-mobile-sdk:5.22.0'
6262
}
6363

6464
//apply from: 'publish.gradle'

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

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.synerise.sdk.client.Client;
2525
import com.synerise.sdk.client.model.GetAccountInformation;
2626
import com.synerise.sdk.client.model.UpdateAccountInformation;
27+
import com.synerise.sdk.client.model.UpdateAccountBasicInformation;
2728
import com.synerise.sdk.client.model.client.Agreements;
2829
import com.synerise.sdk.client.model.client.Attributes;
2930
import com.synerise.sdk.client.model.client.RegisterClient;
@@ -556,7 +557,6 @@ public void onDataAction(GetAccountInformation getAccountInformation) {
556557
accountMap.putBoolean("anonymous", getAccountInformation.getAnonymous());
557558
accountMap.putMap("agreements", agreements);
558559
accountMap.putMap("attributes", MapUtil.stringMapToWritableMap(getAccountInformation.getAttributes()));
559-
accountMap.putArray("tags", ArrayUtil.toWritableArray(getAccountInformation.getTags()));
560560
if (getAccountInformation.getLastActivityDate() != null) {
561561
accountMap.putDouble("lastActivityDate", getAccountInformation.getLastActivityDate().getTime());
562562
}
@@ -571,6 +571,46 @@ public void onDataAction(ApiError apiError) {
571571
});
572572
}
573573

574+
//updateAccountBasicInformation(context: ClientAccountUpdateBasicInformationContext, onSuccess: () => void, onError: (error: Error) => void)
575+
@ReactMethod
576+
public void updateAccountBasicInformation(ReadableMap map, Callback callback) {
577+
UpdateAccountBasicInformation updateAccountBasicInformation = new UpdateAccountBasicInformation();
578+
updateAccountBasicInformation.setFirstName(map.hasKey("firstName") ? map.getString("firstName") : null);
579+
updateAccountBasicInformation.setLastName(map.hasKey("lastName") ? map.getString("lastName") : null);
580+
updateAccountBasicInformation.setDisplayName(map.hasKey("displayName") ? map.getString("displayName") : null);
581+
if (map.hasKey("sex")) {
582+
updateAccountBasicInformation.setSex(Sex.getSex(map.getString("sex")));
583+
}
584+
updateAccountBasicInformation.setPhoneNumber(map.hasKey("phone") ? map.getString("phone") : null);
585+
updateAccountBasicInformation.setBirthDate(map.hasKey("birthDate") ? map.getString("birthDate") : null);
586+
updateAccountBasicInformation.setAvatarUrl(map.hasKey("avatarUrl") ? map.getString("avatarUrl") : null);
587+
updateAccountBasicInformation.setCompany(map.hasKey("company") ? map.getString("company") : null);
588+
updateAccountBasicInformation.setAddress(map.hasKey("address") ? map.getString("address") : null);
589+
updateAccountBasicInformation.setCity(map.hasKey("city") ? map.getString("city") : null);
590+
updateAccountBasicInformation.setProvince(map.hasKey("province") ? map.getString("province") : null);
591+
updateAccountBasicInformation.setZipCode(map.hasKey("zipCode") ? map.getString("zipCode") : null);
592+
updateAccountBasicInformation.setCountryCode(map.hasKey("countryCode") ? map.getString("countryCode") : null);
593+
594+
if (map.hasKey("attributes")) {
595+
Attributes attributes = attributesMapper(map.getMap("attributes").toHashMap());
596+
updateAccountBasicInformation.setAttributes(attributes);
597+
}
598+
599+
if (map.hasKey("agreements")) {
600+
Agreements agreements = agreementsMapper(map.getMap("agreements"));
601+
updateAccountBasicInformation.setAgreements(agreements);
602+
}
603+
604+
if (updateAccountCall != null) updateAccountCall.cancel();
605+
updateAccountCall = Client.updateAccountBasicInformation(updateAccountBasicInformation);
606+
updateAccountCall.execute(() -> executeSuccessCallbackResponse(callback, null, null), new DataActionListener<ApiError>() {
607+
@Override
608+
public void onDataAction(ApiError apiError) {
609+
executeFailureCallbackResponse(callback, null, apiError);
610+
}
611+
});
612+
}
613+
574614
//updateAccount(context: ClientAccountUpdateContext, onSuccess: () => void, onError: (error: Error) => void)
575615
@ReactMethod
576616
public void updateAccount(ReadableMap map, Callback callback) {

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class RNSettings extends RNBaseModule {
3939
public static final String RN_SETTINGS_INJECTOR_AUTOMATIC = "INJECTOR_AUTOMATIC";
4040
public static final String RN_SETTINGS_IN_APP_CHECK_GLOBAL_CONTROL_GROUPS_ON_DEFINITIONS_FETCH = "IN_APP_CHECK_GLOBAL_CONTROL_GROUPS_ON_DEFINITIONS_FETCH";
4141
public static final String RN_SETTINGS_IN_APP_MAX_DEFINITION_UPDATE_INTERVAL_LIMIT = "IN_APP_MAX_DEFINITION_UPDATE_INTERVAL_LIMIT";
42+
public static final String RN_SETTINGS_IN_APP_MESSAGING_CONTENT_BASE_URL = "IN_APP_MESSAGING_CONTENT_BASE_URL";
4243
public static final String RN_SETTINGS_IN_APP_MESSAGING_RENDERING_TIMEOUT = "IN_APP_MESSAGING_RENDERING_TIMEOUT";
4344
public static final String RN_SETTINGS_IN_APP_MESSAGING_SHOULD_SEND_IN_APP_CAPPING_EVENT = "IN_APP_MESSAGING_SHOULD_SEND_IN_APP_CAPPING_EVENT";
4445

@@ -69,6 +70,7 @@ public Map<String, Object> getConstants() {
6970
constants.put(RN_SETTINGS_SHOULD_DESTROY_SESSION_ON_API_KEY_CHANGE, RN_SETTINGS_SHOULD_DESTROY_SESSION_ON_API_KEY_CHANGE);
7071
constants.put(RN_SETTINGS_IN_APP_CHECK_GLOBAL_CONTROL_GROUPS_ON_DEFINITIONS_FETCH, RN_SETTINGS_IN_APP_CHECK_GLOBAL_CONTROL_GROUPS_ON_DEFINITIONS_FETCH);
7172
constants.put(RN_SETTINGS_IN_APP_MAX_DEFINITION_UPDATE_INTERVAL_LIMIT, RN_SETTINGS_IN_APP_MAX_DEFINITION_UPDATE_INTERVAL_LIMIT);
73+
constants.put(RN_SETTINGS_IN_APP_MESSAGING_CONTENT_BASE_URL, RN_SETTINGS_IN_APP_MESSAGING_CONTENT_BASE_URL);
7274
constants.put(RN_SETTINGS_IN_APP_MESSAGING_RENDERING_TIMEOUT, RN_SETTINGS_IN_APP_MESSAGING_RENDERING_TIMEOUT);
7375
constants.put(RN_SETTINGS_IN_APP_MESSAGING_SHOULD_SEND_IN_APP_CAPPING_EVENT, RN_SETTINGS_IN_APP_MESSAGING_SHOULD_SEND_IN_APP_CAPPING_EVENT);
7476
return constants;
@@ -85,6 +87,9 @@ public WritableMap getOne(String key) {
8587
if (settings.get(key) instanceof Integer) {
8688
setting.putInt(key, (int) settings.get(key));
8789
}
90+
if (settings.get(key) instanceof String) {
91+
setting.putString(key, (String) settings.get(key));
92+
}
8893
if (settings.get(key) instanceof List) {
8994
List<String> eventsTriggeringFlush = (List<String>) settings.get(key);
9095
WritableArray writableArray = Arguments.createArray();
@@ -110,6 +115,9 @@ public void setOne(ReadableMap settingMap) {
110115
case Number:
111116
matchSetting(key, settingMap.getInt("value"));
112117
break;
118+
case String:
119+
matchSetting(key, settingMap.getString("value"));
120+
break;
113121
case Array:
114122
matchSetting(key, settingMap.getArray("value"));
115123
break;
@@ -131,6 +139,9 @@ public void setMany(ReadableMap newSettings) {
131139
case Number:
132140
matchSetting(key, newSettings.getInt(key));
133141
break;
142+
case String:
143+
matchSetting(key, newSettings.getString(key));
144+
break;
134145
case Array:
135146
matchSetting(key, newSettings.getArray(key));
136147
break;
@@ -206,7 +217,10 @@ private void matchSetting(String key, Object value) {
206217
if (value instanceof Integer) {
207218
Settings.getInstance().inAppMessaging.setMaxDefinitionUpdateIntervalLimit((int) value);
208219
}
209-
220+
case RN_SETTINGS_IN_APP_MESSAGING_CONTENT_BASE_URL:
221+
if (value instanceof String) {
222+
Settings.getInstance().inAppMessaging.setContentBaseUrl((String) value);
223+
}
210224
case RN_SETTINGS_IN_APP_MESSAGING_RENDERING_TIMEOUT:
211225
if (value instanceof Integer) {
212226
Settings.getInstance().inAppMessaging.renderingTimeout = ((int) value) * 1000;
@@ -233,6 +247,7 @@ private Map<String, Object> settingsDictionary() {
233247
settings.put(RN_SETTINGS_NOTIFICATIONS_ENCRYPTION, Synerise.settings.notifications.getEncryption());
234248
settings.put(RN_SETTINGS_SHOULD_DESTROY_SESSION_ON_API_KEY_CHANGE, Synerise.settings.sdk.shouldDestroySessionOnApiKeyChange);
235249
settings.put(RN_SETTINGS_IN_APP_CHECK_GLOBAL_CONTROL_GROUPS_ON_DEFINITIONS_FETCH, Synerise.settings.inAppMessaging.checkGlobalControlGroupsOnDefinitionsFetch);
250+
settings.put(RN_SETTINGS_IN_APP_MESSAGING_CONTENT_BASE_URL, Synerise.settings.inAppMessaging.getContentBaseUrl());
236251
settings.put(RN_SETTINGS_IN_APP_MESSAGING_RENDERING_TIMEOUT, Synerise.settings.inAppMessaging.renderingTimeout / 1000);
237252
settings.put(RN_SETTINGS_IN_APP_MAX_DEFINITION_UPDATE_INTERVAL_LIMIT, Synerise.settings.inAppMessaging.getMaxDefinitionUpdateIntervalLimit());
238253
settings.put(RN_SETTINGS_IN_APP_MESSAGING_SHOULD_SEND_IN_APP_CAPPING_EVENT, Synerise.settings.inAppMessaging.shouldSendInAppCappingEvent);

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

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

20-
public static final String SDK_PLUGIN_VERSION = "0.23.1";
20+
public static final String SDK_PLUGIN_VERSION = "0.24.0";
2121

2222
public void initialize(Application app) {
2323
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 = @"0.23.1";
11+
NSString * const SNRSyneriseSDKPluginVersion = @"0.24.0";
1212

1313
@implementation RNSyneriseInitializer
1414

ios/ReactNativeSynerise/Modules/RNClient.m

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,34 @@ - (nullable SNRClientSimpleAuthenticationData *)modelClientSimpleAuthenticationD
201201
return nil;
202202
}
203203

204+
- (nullable SNRClientUpdateAccountBasicInformationContext *)modelClientUpdateAccountBasicInformationContextWithDictionary:(nullable NSDictionary *)dictionary {
205+
if (dictionary != nil) {
206+
SNRClientUpdateAccountBasicInformationContext *model = [SNRClientUpdateAccountContext new];
207+
model.firstName = [dictionary getStringForKey:@"firstName"];
208+
model.lastName = [dictionary getStringForKey:@"lastName"];
209+
model.displayName = [dictionary getStringForKey:@"displayName"];
210+
model.sex = SNR_StringToClientSex([dictionary getStringForKey:@"sex"]);
211+
model.phone = [dictionary getStringForKey:@"phone"];
212+
model.birthDate = [dictionary getStringForKey:@"birthDate"];
213+
model.avatarUrl = [dictionary getStringForKey:@"avatarUrl"];
214+
215+
model.company = [dictionary getStringForKey:@"company"];
216+
model.address = [dictionary getStringForKey:@"address"];
217+
model.city = [dictionary getStringForKey:@"city"];
218+
model.province = [dictionary getStringForKey:@"province"];
219+
model.zipCode = [dictionary getStringForKey:@"zipCode"];
220+
model.countryCode = [dictionary getStringForKey:@"countryCode"];
221+
222+
model.agreements = [self modelClientAgreementsWithDictionary:[dictionary getDictionaryForKey:@"agreements"]];
223+
224+
model.attributes = [dictionary getDictionaryForKey:@"attributes"];
225+
226+
return model;
227+
}
228+
229+
return nil;
230+
}
231+
204232
- (nullable SNRClientUpdateAccountContext *)modelClientUpdateAccountContextWithDictionary:(nullable NSDictionary *)dictionary {
205233
if (dictionary != nil) {
206234
SNRClientUpdateAccountContext *model = [SNRClientUpdateAccountContext new];
@@ -723,13 +751,29 @@ - (NSDictionary *)constantsToExport
723751
}];
724752
}
725753

754+
//updateAccountBasicInformation(context: ClientAccountUpdateBasicInformationContext, onSuccess: () => void, onError: (error: Error) => void)
755+
756+
RCT_EXPORT_METHOD(updateAccountBasicInformation:(NSDictionary *)dictionary response:(RCTResponseSenderBlock)response)
757+
{
758+
SNRClientUpdateAccountBasicInformationContext *context = [self modelClientUpdateAccountBasicInformationContextWithDictionary:dictionary];
759+
if (context != nil) {
760+
[SNRClient updateAccountBasicInformation:context success:^(BOOL isSuccess) {
761+
[self executeSuccessCallbackResponse:response data:@1];
762+
} failure:^(NSError *error) {
763+
[self executeFailureCallbackResponse:response error:error];
764+
}];
765+
} else {
766+
[self executeDefaultFailureCallbackResponse:response];
767+
}
768+
}
769+
726770
//updateAccount(context: ClientAccountUpdateContext, onSuccess: () => void, onError: (error: Error) => void)
727771

728772
RCT_EXPORT_METHOD(updateAccount:(NSDictionary *)dictionary response:(RCTResponseSenderBlock)response)
729773
{
730-
SNRClientUpdateAccountContext *clientUpdateAccountContext = [self modelClientUpdateAccountContextWithDictionary:dictionary];
731-
if (clientUpdateAccountContext != nil) {
732-
[SNRClient updateAccount:clientUpdateAccountContext success:^(BOOL isSuccess) {
774+
SNRClientUpdateAccountContext *context = [self modelClientUpdateAccountContextWithDictionary:dictionary];
775+
if (context != nil) {
776+
[SNRClient updateAccount:context success:^(BOOL isSuccess) {
733777
[self executeSuccessCallbackResponse:response data:@1];
734778
} failure:^(NSError *error) {
735779
[self executeFailureCallbackResponse:response error:error];

0 commit comments

Comments
 (0)