Skip to content

Commit

Permalink
Merge pull request #11 from Synerise/v0.23.0
Browse files Browse the repository at this point in the history
Release of version 0.23.0
  • Loading branch information
awoczek authored Aug 5, 2024
2 parents 0161c08 + 77d404e commit cb18640
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 16 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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

## [0.23.0] - 2024-08-05

### Fixed
- [iOS] Potential issue with slow SDK initialization.
- [iOS] Potential issues with Simple Authentication requests.

### Added
- We added new parameters to the push.click event: `clickSource`, `actionType`, `url` and `actionButtonTitle`.

### Changed
- Update of native SDK's dependencies.


## [0.22.0] - 2024-07-16

IMPORTANT:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Synerise React Native SDK (react-native-synerise-sdk) (0.22.0)
# Synerise React Native SDK (react-native-synerise-sdk) (0.23.0)

[![Platform](https://img.shields.io/badge/platform-iOS-orange.svg)](https://github.com/synerise/ios-sdk)
[![Platform](https://img.shields.io/badge/platform-Android-orange.svg)](https://github.com/synerise/android-sdk)
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ ext.versions = [
'minSdk' : 21,
'compileSdk' : 33,
'targetSdk' : 33,
'versionCode': 36,
'versionName': "0.22.0"
'versionCode': 37,
'versionName': "0.23.0"
]

buildscript {
Expand Down Expand Up @@ -58,7 +58,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.19.0'
api 'com.synerise.sdk:synerise-mobile-sdk:5.20.0'
}

//apply from: 'publish.gradle'
13 changes: 11 additions & 2 deletions android/src/main/java/com/synerise/sdk/react/RNSynerise.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package com.synerise.sdk.react;

import android.app.Application;
import android.util.Log;

import androidx.annotation.NonNull;

import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.synerise.sdk.client.Client;
import com.synerise.sdk.core.types.model.InitializationConfig;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -94,8 +97,14 @@ public void syneriseInitialized() {
}

@ReactMethod
public void changeClientApiKey(String apiKey) {
Client.changeApiKey(apiKey);
public void changeClientApiKey(String apiKey, ReadableMap initializationConfigMap) {
if (initializationConfigMap != null) {
InitializationConfig initializationConfig = new InitializationConfig();
initializationConfig.setSalt(initializationConfigMap.hasKey("requestValidationSalt") ? initializationConfigMap.getString("requestValidationSalt") : null);
Client.changeApiKey(apiKey, initializationConfig);
} else {
Client.changeApiKey(apiKey);
}
}

@ReactMethod(isBlockingSynchronousMethod = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class RNSyneriseInitializer {
public Boolean isCrashHandlingEnabled;
public static volatile boolean isInitialized = false;

public static final String SDK_PLUGIN_VERSION = "0.22.0";
public static final String SDK_PLUGIN_VERSION = "0.23.0";

public void initialize(Application app) {
if (isInitialized == false) {
Expand Down
2 changes: 1 addition & 1 deletion ios/ReactNativeSynerise/Main/RNSyneriseInitializer.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "RNSyneriseInitializer.h"

NSString * const SNRSyneriseSDKPluginVersion = @"0.22.0";
NSString * const SNRSyneriseSDKPluginVersion = @"0.23.0";

@implementation RNSyneriseInitializer

Expand Down
12 changes: 10 additions & 2 deletions ios/ReactNativeSynerise/Modules/RNSynerise.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,20 @@ - (NSDictionary *)constantsToExport
return [NSNumber numberWithBool:isInitialized];
}

RCT_EXPORT_METHOD(changeClientApiKey:(NSString *)clientApiKey) {
RCT_EXPORT_METHOD(changeClientApiKey:(NSString *)clientApiKey config:(NSDictionary *)initializationConfigDictionary) {
if (clientApiKey == nil) {
return;
}

[SNRSynerise changeClientApiKey:clientApiKey];
SNRInitializationConfig *initializationConfig = [SNRInitializationConfig new];
if (initializationConfigDictionary != nil) {
NSString *requestValidationSalt = [initializationConfigDictionary getStringForKey:@"requestValidationSalt"];
if (requestValidationSalt != nil) {
initializationConfig.requestValidationSalt = requestValidationSalt;
}
}

[SNRSynerise changeClientApiKey:clientApiKey config:initializationConfig];
}

@end
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.18.2'
SYNERISE_SDK_FRAMEWORK_VERSION = '4.19.1'

Pod::Spec.new do |s|
s.name = package['name']
Expand Down
5 changes: 5 additions & 0 deletions lib/classes/models/Misc/InitializationConfig.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare class InitializationConfig {
requestValidationSalt?: string;
toObject(): object;
}
export { InitializationConfig };
14 changes: 14 additions & 0 deletions lib/classes/models/Misc/InitializationConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InitializationConfig = void 0;
var InitializationConfig = /** @class */ (function () {
function InitializationConfig() {
}
InitializationConfig.prototype.toObject = function () {
return {
requestValidationSalt: this.requestValidationSalt,
};
};
return InitializationConfig;
}());
exports.InitializationConfig = InitializationConfig;
1 change: 1 addition & 0 deletions lib/config/import_models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ export { DocumentsApiQuery } from './../classes/api_queries/DocumentsApiQuery';
export { DocumentsApiQueryType } from './../classes/api_queries/DocumentsApiQueryType';
export { Token } from './../classes/models/Token/Token';
export { TokenOrigin, TokenOriginFromString, TokenOriginToString } from './../classes/models/Token/TokenOrigin';
export { InitializationConfig } from './../classes/models/Misc/InitializationConfig';
export { SyneriseSource } from './../classes/models/Misc/SyneriseSource';
export { InAppMessageData } from './../classes/models/Misc/InAppMessageData';
2 changes: 2 additions & 0 deletions lib/config/import_models.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/main/Synerise.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { NotificationsModule as Notifications } from './modules/NotificationsMod
import { InjectorModule as Injector } from './modules/InjectorModule';
import { PromotionsModule as Promotions } from './modules/PromotionsModule';
import { ContentModule as Content } from './modules/ContentModule';
import { InitializationConfig } from './../classes/models/Misc/InitializationConfig';
import { IError, Error } from './../classes/types/Error';
declare class SyneriseInitializer {
private settings?;
Expand All @@ -28,7 +29,7 @@ declare class Synerise {
static isInitialized(): Boolean;
static onReady(callback: () => void): void;
static onError(callback: (error: Error) => void): void;
static changeClientApiKey(clientApiKey: string): void;
static changeClientApiKey(clientApiKey: string, config?: InitializationConfig | undefined): void;
static get Settings(): Settings;
static get Client(): Client;
static get Tracker(): Tracker;
Expand Down
5 changes: 3 additions & 2 deletions lib/main/Synerise.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,10 @@ var Synerise = /** @class */ (function () {
Synerise.onError = function (callback) {
onSyneriseError = callback;
};
Synerise.changeClientApiKey = function (clientApiKey) {
Synerise.changeClientApiKey = function (clientApiKey, config) {
if (SyneriseInitializer.isSyneriseInitialized()) {
SyneriseModuleConnector_1.SyneriseModuleConnector.invokeMethod(RNSynerise.changeClientApiKey, [clientApiKey]);
var configObject = config === null || config === void 0 ? void 0 : config.toObject();
SyneriseModuleConnector_1.SyneriseModuleConnector.invokeMethod(RNSynerise.changeClientApiKey, [clientApiKey, configObject]);
}
else {
console.warn("Synerise.changeClientApiKey: Synerise is not initialized, please use Synerise.Initializer first.");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-synerise-sdk",
"version": "0.22.0",
"version": "0.23.0",
"description": "React Native wrapper for Synerise SDK",
"author": {
"name": "Synerise",
Expand Down
2 changes: 1 addition & 1 deletion 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.18.2'
SYNERISE_SDK_FRAMEWORK_VERSION = '4.19.1'

Pod::Spec.new do |s|
s.name = package['name']
Expand Down

0 comments on commit cb18640

Please sign in to comment.