Skip to content

Commit 4676644

Browse files
authored
Merge pull request #458 from Countly/staging
Staging 25.1.1
2 parents 50f35b5 + 2b17367 commit 4676644

File tree

91 files changed

+6058
-986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+6058
-986
lines changed

CHANGELOG.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
1+
## 25.1.1
2+
* Improved content size management of content blocks.
3+
* Added init time config options:
4+
* `.content.setZoneTimerInterval` to set the frequency of content update calls in seconds.
5+
* `.content.setGlobalContentCallback` to provide a callback that is called when a content is closed.
6+
7+
* Android Specific Changes:
8+
* Improved the custom CertificateTrustManager to handle domain-specific configurations by supporting hostname-aware checkServerTrusted calls.
9+
* Mitigated an issue where after closing a content, they were not being fetched again.
10+
* Mitigated an issue where, the action bar was overlapping with the content display.
11+
12+
* iOS Specific Changes:
13+
* Added dynamic resizing functionality for the content zone
14+
* Fixed an issue where the build UUID and executable name were missing from crash reports
15+
16+
* Updated the underlying Android SDK version to 25.1.1
17+
* Updated the underlying iOS SDK version to 25.1.1
18+
19+
## 25.1.0
20+
* ! Minor breaking change ! `Countly.userDataBulk.save()` method is now optional. SDK will save the cached data with internal triggers regularly.
21+
22+
* Added Content feature methods:
23+
* `enterContentZone`, to start Content checks (Experimental!)
24+
* `exitContentZone`, to stop Content checks (Experimental!)
25+
* Added feedback widget convenience methods to display the first available widget or the one meets the criteria:
26+
* `Countly.feedback.showNPS(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void`
27+
* `Countly.feedback.showSurvey(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void`
28+
* `Countly.feedback.showRating(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void`
29+
* Added config interface `experimental` that provides experimental config options:
30+
* `.experimental.enablePreviousNameRecording()` for reporting previous event/view names
31+
* `.experimental.enableVisibilityTracking()` for reporting app visibility with events
32+
* Added `Countly.deviceId.setID` method for changing device ID based on the device ID type
33+
* Added support for Arrays of primitive types in event segmentation
34+
35+
* Deprecated following SDK calls:
36+
* `Countly.getCurrentDeviceId` (replaced with: `Countly.deviceId.getID`)
37+
* `Countly.getDeviceIDType` (replaced with: `Countly.deviceId.getType`)
38+
* `Countly.changeDeviceId` (replaced with: `Countly.deviceId.setID`)
39+
40+
* Mitigated an issue where a session could have started while the app was in the background when the device ID was changed (non-merge).
41+
* Mitigated an issue where intent redirection checks were disabled by default
42+
* Mitigated an issue crash tracking was not enabled with init config
43+
* Mitigated an issue where app start time tracking was on by default
44+
45+
* Android Specific Changes:
46+
* ! Minor breaking change ! Unsupported types for user properties will now be omitted, they won't be converted to strings.
47+
* Disabled caching for webviews.
48+
* Mitigated an issue in the upload plugin that prevented the upload of a symbol file
49+
* Resolved a problem where revoked consents were sent after changes without merging.
50+
* Mitigated an issue that caused the device ID to be incorrectly set after changes with merging.
51+
* Mitigated an issue where on consent revoke, remote config values were cleared, not anymore.
52+
53+
* iOS Specific Changes:
54+
* Orientation info is now also sent during initialization
55+
* Added visionOS build support
56+
* Updated the SDK to ensure compatibility with the latest server response models
57+
* Improved view tracking capabilities
58+
* Mitigated an issue with the feedback widget URL encoding on iOS 16 and earlier, which prevented the widget from displaying
59+
* Mitigated an issue with content fetch URL encoding on iOS 16 and earlier, which caused the request to fail
60+
* Mitigated an issue where the terms and conditions URL (`tc` key) was sent without double quotes
61+
* Mitigated an issue where consent information was not sent when no consent was given during initialization
62+
* Mitigated an issue where a session did not end when session consent was removed
63+
* Mitigated an issue where pausing a view resulted in a '0' view duration.
64+
* Mitigated an issue where the user provided URLSessionConfiguration was not applied to direct requests
65+
66+
* Updated the underlying Android SDK version to 24.7.8
67+
* Updated the underlying iOS SDK version to 24.7.9
68+
169
## 24.4.1
270
* Added support for Feedback Widget terms and conditions
371
* Added six new configuration options under the 'sdkInternalLimits' interface of 'CountlyConfig':

Countly.d.ts

Lines changed: 110 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
interface Segmentation {
2-
[key: string]: number | string | boolean;
2+
[key: string]: number | string | boolean | (number | string | boolean)[];
33
}
44

55
interface CountlyEventOptions {
@@ -89,6 +89,29 @@ declare module "countly-sdk-react-native-bridge" {
8989
* Countly Feedback Module
9090
*/
9191
namespace feedback {
92+
93+
/**
94+
* Shows the first available NPS widget that meets the criteria.
95+
* @param {String} [nameIDorTag] - name, id, or tag of the widget to show (optional)
96+
* @param {callback} [widgetClosedCallback] - called when the widget is closed (optional)
97+
*/
98+
export function showNPS(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void;
99+
100+
/**
101+
* Shows the first available survey widget that meets the criteria.
102+
* @param {String} [nameIDorTag] - name, id, or tag of the widget to show (optional)
103+
* @param {callback} [widgetClosedCallback] - called when the widget is closed (optional)
104+
*/
105+
export function showSurvey(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void;
106+
107+
/**
108+
* Shows the first available rating widget that meets the criteria.
109+
* @param {String} [nameIDorTag] - name, id, or tag of the widget to show (optional)
110+
* @param {callback} [widgetClosedCallback] - called when the widget is closed (optional)
111+
*/
112+
export function showRating(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void;
113+
114+
92115
/**
93116
* Get a list of available feedback widgets as an array of objects.
94117
* @param {FeedbackWidgetCallback} [onFinished] - returns (retrievedWidgets, error). This parameter is optional.
@@ -106,7 +129,7 @@ declare module "countly-sdk-react-native-bridge" {
106129
*
107130
* @return {ErrorObject} object {error: string or null}
108131
*/
109-
export function presentFeedbackWidget(feedbackWidget: FeedbackWidget, closeButtonText: string, widgetShownCallback: callback, widgetClosedCallback: callback): ErrorObject;
132+
export function presentFeedbackWidget(feedbackWidget: FeedbackWidget, closeButtonText: string, widgetShownCallback: WidgetCallback, widgetClosedCallback: WidgetCallback): ErrorObject;
110133

111134
/**
112135
* Get a feedback widget's data as an object.
@@ -176,6 +199,21 @@ declare module "countly-sdk-react-native-bridge" {
176199
export function cancelEvent(eventName: string): void;
177200
}
178201

202+
/**
203+
* Countly Content Module
204+
*/
205+
namespace content {
206+
/**
207+
* Opt in user for the content fetching and updates
208+
*/
209+
export function enterContentZone(): void;
210+
211+
/**
212+
* Opt out user from the content fetching and updates
213+
*/
214+
export function exitContentZone(): void;
215+
}
216+
179217
/**
180218
* Initialize Countly
181219
*
@@ -387,7 +425,8 @@ declare module "countly-sdk-react-native-bridge" {
387425
export function disableLocation(): string | void;
388426

389427
/**
390-
*
428+
* @deprecated use 'Countly.deviceId.getID' instead of 'Countly.getCurrentDeviceId'
429+
*
391430
* Get currently used device Id.
392431
* Should be called after Countly init
393432
*
@@ -396,6 +435,8 @@ declare module "countly-sdk-react-native-bridge" {
396435
export function getCurrentDeviceId(): Promise<string> | string;
397436

398437
/**
438+
* @deprecated use 'Countly.deviceId.getType' instead of 'Countly.getDeviceIDType'
439+
*
399440
* Get currently used device Id type.
400441
* Should be called after Countly init
401442
*
@@ -404,6 +445,8 @@ declare module "countly-sdk-react-native-bridge" {
404445
export function getDeviceIDType(): Promise<DeviceIdType> | null;
405446

406447
/**
448+
* @deprecated use 'Countly.deviceId.setID' instead of 'Countly.changeDeviceId'
449+
*
407450
* Change the current device id
408451
*
409452
* @param {string} newDeviceID id new device id
@@ -412,6 +455,34 @@ declare module "countly-sdk-react-native-bridge" {
412455
*/
413456
export function changeDeviceId(newDeviceID: string, onServer: boolean): string | void;
414457

458+
namespace deviceId {
459+
/**
460+
*
461+
* Get currently used device ID.
462+
* Should be called after Countly init
463+
*
464+
* @returns {string | null} device ID or null
465+
*/
466+
export function getID(): Promise<string> | string;
467+
468+
/**
469+
*
470+
* Get currently used device ID type.
471+
* Should be called after Countly init
472+
*
473+
* @return {DeviceIdType | null} deviceIdType or null
474+
*/
475+
export function getType(): Promise<DeviceIdType> | null;
476+
477+
/**
478+
* Sets device ID according to the device ID Type.
479+
* If previous ID was Developer Supplied sets it without merge, otherwise with merge.
480+
*
481+
* @param {string} newDeviceID device ID to set
482+
*/
483+
export function setID(newDeviceID: string): void;
484+
}
485+
415486
/**
416487
*
417488
* Set to "true" if you want HTTP POST to be used for all requests
@@ -1097,6 +1168,32 @@ declare module "countly-sdk-react-native-bridge" {
10971168
}
10981169

10991170
declare module "countly-sdk-react-native-bridge/CountlyConfig" {
1171+
interface experimental {
1172+
/**
1173+
* Enables previous name recording for views and events
1174+
*/
1175+
enablePreviousNameRecording(): this;
1176+
1177+
/**
1178+
* Enables app visibility tracking with events.
1179+
*/
1180+
enableVisibilityTracking(): this;
1181+
}
1182+
1183+
interface content {
1184+
/**
1185+
*
1186+
* @param zoneTimerInterval - the interval in seconds to check for new content
1187+
*/
1188+
setZoneTimerInterval(zoneTimerInterval: number): this;
1189+
1190+
/**
1191+
*
1192+
* @param callback - callback to be called when new content is available
1193+
*/
1194+
setGlobalContentCallback(callback: Function): this;
1195+
}
1196+
11001197
/**
11011198
*
11021199
* This class holds APM specific configurations to be used with
@@ -1189,6 +1286,16 @@ declare module "countly-sdk-react-native-bridge/CountlyConfig" {
11891286
*/
11901287
sdkInternalLimits: CountlyConfigSDKInternalLimits;
11911288

1289+
/**
1290+
* getter for experimental features
1291+
*/
1292+
experimental: experimental;
1293+
1294+
/**
1295+
* getter for content features
1296+
*/
1297+
content: content;
1298+
11921299
/**
11931300
* Method to set the server url
11941301
*

Countly.js

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import CountlyConfig from "./CountlyConfig.js";
1010
import CountlyState from "./CountlyState.js";
1111
import Feedback from "./Feedback.js";
1212
import Event from "./Event.js";
13+
import DeviceId from "./DeviceId.js";
1314
import * as L from "./Logger.js";
1415
import * as Utils from "./Utils.js";
1516
import * as Validate from "./Validators.js";
@@ -26,12 +27,15 @@ CountlyState.eventEmitter = eventEmitter;
2627

2728
Countly.feedback = new Feedback(CountlyState);
2829
Countly.events = new Event(CountlyState);
30+
Countly.deviceId = new DeviceId(CountlyState);
2931

3032
let _isCrashReportingEnabled = false;
3133

3234
Countly.userData = {}; // userData interface
3335
Countly.userDataBulk = {}; // userDataBulk interface
3436

37+
Countly.content = {}; // content interface
38+
3539
let _isPushInitialized = false;
3640

3741
/*
@@ -87,6 +91,17 @@ Countly.initWithConfig = async function (countlyConfig) {
8791
return;
8892
}
8993
L.d("initWithConfig, Initializing Countly");
94+
if (countlyConfig.content.contentCallback) {
95+
eventEmitter.addListener("globalContentCallback", (data) => {
96+
L.d(`init configuration, Global content callback called with data: ${data}`);
97+
try {
98+
data = JSON.parse(data);
99+
countlyConfig.content.contentCallback(data.status, data.data);
100+
} catch (error) {
101+
L.e(`init configuration, Error parsing global content callback data: ${error}`);
102+
}
103+
});
104+
}
90105
const args = [];
91106
const argsMap = Utils.configToJson(countlyConfig);
92107
const argsString = JSON.stringify(argsMap);
@@ -456,7 +471,8 @@ Countly.disableLocation = function () {
456471
};
457472

458473
/**
459-
*
474+
* @deprecated use 'Countly.deviceId.getID' instead of 'Countly.getCurrentDeviceId'
475+
*
460476
* Get currently used device Id.
461477
* Should be called after Countly init
462478
*
@@ -474,6 +490,8 @@ Countly.getCurrentDeviceId = async function () {
474490
};
475491

476492
/**
493+
* @deprecated use 'Countly.deviceId.getType' instead of 'Countly.getDeviceIDType'
494+
*
477495
* Get currently used device Id type.
478496
* Should be called after Countly init
479497
*
@@ -490,7 +508,9 @@ Countly.getDeviceIDType = async function () {
490508
};
491509

492510
/**
493-
* Change the current device id
511+
* @deprecated use 'Countly.deviceId.setID' instead of 'Countly.changeDeviceId' for setting device ID.
512+
*
513+
* Change the current device ID
494514
*
495515
* @param {string} newDeviceID id new device id
496516
* @param {boolean} onServer merge device id
@@ -2178,4 +2198,34 @@ Countly.setCustomMetrics = async function (customMetric) {
21782198
}
21792199
};
21802200

2201+
/**
2202+
* Opt in user for the content fetching and updates
2203+
*
2204+
* NOTE: This is an EXPERIMENTAL feature, and it can have breaking changes
2205+
*/
2206+
Countly.content.enterContentZone = function() {
2207+
L.i("enterContentZone, opting for content fetching.");
2208+
if (!_state.isInitialized) {
2209+
const message = "'init' must be called before 'enterContentZone'";
2210+
L.e(`enterContentZone, ${message}`);
2211+
return;
2212+
}
2213+
CountlyReactNative.enterContentZone();
2214+
};
2215+
2216+
/**
2217+
* Opt out user from the content fetching and updates
2218+
*
2219+
* NOTE: This is an EXPERIMENTAL feature, and it can have breaking changes
2220+
*/
2221+
Countly.content.exitContentZone = function() {
2222+
L.i("exitContentZone, opting out from content fetching.");
2223+
if (!_state.isInitialized) {
2224+
const message = "'init' must be called before 'exitContentZone'";
2225+
L.e(`exitContentZone, ${message}`);
2226+
return;
2227+
}
2228+
CountlyReactNative.exitContentZone();
2229+
};
2230+
21812231
export default Countly;

0 commit comments

Comments
 (0)