Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
fef1d7d
iOS Version to 24.7.4
Oct 24, 2024
039a36b
Update Android Version to 24.7.4
Oct 24, 2024
2db9233
update
turtledreams Oct 28, 2024
8407fce
Merge pull request #407 from Countly/creator-update
turtledreams Oct 28, 2024
36149c6
Updated Init Line in Example App
Oct 28, 2024
0867e15
Merge pull request #408 from Countly/ExampleReactVersion
turtledreams Oct 28, 2024
13ba554
Merge branch 'staging' into ContentFeature
Oct 30, 2024
4414aaa
Android Part is Added
Oct 30, 2024
6d07831
iOS Content Added
Oct 30, 2024
6251d57
Changelog Entry
Oct 30, 2024
01837a6
Update CHANGELOG.md
Oct 31, 2024
c2fb99a
Update CHANGELOG.md
Oct 31, 2024
28dddc3
Update Countly.js
Oct 31, 2024
d6a4ec4
Added Content Calls in Example App
Oct 31, 2024
672a592
Merge pull request #406 from Countly/ContentFeature
turtledreams Oct 31, 2024
ce51d88
Example Naming Fix
Oct 31, 2024
7636571
Merge pull request #409 from Countly/ContentExampleFix
turtledreams Oct 31, 2024
374a86d
Device Id Interface Added
Oct 31, 2024
18dccd1
setID call added
Oct 31, 2024
aeb64b8
Renamed Calls
Nov 1, 2024
996546b
Merge branch 'deviceId-Interface' into setId-feature
Nov 1, 2024
eb27479
Requested Changes
Nov 1, 2024
1376bec
Merge branch 'deviceId-Interface' into setId-feature
Nov 1, 2024
1a29b97
setID Updates
Nov 1, 2024
44523b4
Update CHANGELOG.md
Nov 1, 2024
fe3c515
Merge branch 'deviceId-interface' into setId-feature
Nov 2, 2024
36129a1
Updated Comments
Nov 4, 2024
b7fc14d
Updated Comments
Nov 4, 2024
97d3826
return type updated
Nov 4, 2024
f029cf4
Merge branch 'deviceId-interface' into setId-feature
Nov 4, 2024
5e44d38
setID Early Return Added
Nov 4, 2024
f85f224
update
turtledreams Nov 4, 2024
2c1e742
Merge pull request #411 from Countly/setId-feature
turtledreams Nov 4, 2024
a76478b
update
turtledreams Nov 4, 2024
766f87d
Merge pull request #410 from Countly/deviceId-interface
turtledreams Nov 4, 2024
c09d22e
25.0.1
turtledreams Jan 20, 2025
0f65908
config
turtledreams Jan 20, 2025
d8273ec
Merge pull request #443 from Countly/25.01-release-branch
turtledreams Jan 20, 2025
9cd0f75
fixes
turtledreams Feb 3, 2025
5d21e8e
ios
turtledreams Feb 4, 2025
7293b06
ios 25.1.1
turtledreams Feb 4, 2025
e9c5248
content
turtledreams Feb 4, 2025
25b0029
changelog
turtledreams Feb 4, 2025
4d4574a
ios content name
turtledreams Feb 4, 2025
0f939c5
Merge pull request #455 from Countly/content-callback
turtledreams Feb 5, 2025
11f5912
Changelog
turtledreams Feb 5, 2025
4d44d23
Merge pull request #456 from Countly/change-for-5.1.1
turtledreams Feb 5, 2025
0ab4e98
Version update 5.1.1
turtledreams Feb 5, 2025
2b17367
Merge pull request #457 from Countly/version-update-5.1.1
turtledreams Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
## 25.1.1
* Improved content size management of content blocks.
* Added init time config options:
* `.content.setZoneTimerInterval` to set the frequency of content update calls in seconds.
* `.content.setGlobalContentCallback` to provide a callback that is called when a content is closed.

* Android Specific Changes:
* Improved the custom CertificateTrustManager to handle domain-specific configurations by supporting hostname-aware checkServerTrusted calls.
* Mitigated an issue where after closing a content, they were not being fetched again.
* Mitigated an issue where, the action bar was overlapping with the content display.

* iOS Specific Changes:
* Added dynamic resizing functionality for the content zone
* Fixed an issue where the build UUID and executable name were missing from crash reports

* Updated the underlying Android SDK version to 25.1.1
* Updated the underlying iOS SDK version to 25.1.1

## 25.1.0
* ! Minor breaking change ! `Countly.userDataBulk.save()` method is now optional. SDK will save the cached data with internal triggers regularly.

* Added Content feature methods:
* `enterContentZone`, to start Content checks (Experimental!)
* `exitContentZone`, to stop Content checks (Experimental!)
* Added feedback widget convenience methods to display the first available widget or the one meets the criteria:
* `Countly.feedback.showNPS(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void`
* `Countly.feedback.showSurvey(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void`
* `Countly.feedback.showRating(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void`
* Added config interface `experimental` that provides experimental config options:
* `.experimental.enablePreviousNameRecording()` for reporting previous event/view names
* `.experimental.enableVisibilityTracking()` for reporting app visibility with events
* Added `Countly.deviceId.setID` method for changing device ID based on the device ID type
* Added support for Arrays of primitive types in event segmentation

* Deprecated following SDK calls:
* `Countly.getCurrentDeviceId` (replaced with: `Countly.deviceId.getID`)
* `Countly.getDeviceIDType` (replaced with: `Countly.deviceId.getType`)
* `Countly.changeDeviceId` (replaced with: `Countly.deviceId.setID`)

* Mitigated an issue where a session could have started while the app was in the background when the device ID was changed (non-merge).
* Mitigated an issue where intent redirection checks were disabled by default
* Mitigated an issue crash tracking was not enabled with init config
* Mitigated an issue where app start time tracking was on by default

* Android Specific Changes:
* ! Minor breaking change ! Unsupported types for user properties will now be omitted, they won't be converted to strings.
* Disabled caching for webviews.
* Mitigated an issue in the upload plugin that prevented the upload of a symbol file
* Resolved a problem where revoked consents were sent after changes without merging.
* Mitigated an issue that caused the device ID to be incorrectly set after changes with merging.
* Mitigated an issue where on consent revoke, remote config values were cleared, not anymore.

* iOS Specific Changes:
* Orientation info is now also sent during initialization
* Added visionOS build support
* Updated the SDK to ensure compatibility with the latest server response models
* Improved view tracking capabilities
* Mitigated an issue with the feedback widget URL encoding on iOS 16 and earlier, which prevented the widget from displaying
* Mitigated an issue with content fetch URL encoding on iOS 16 and earlier, which caused the request to fail
* Mitigated an issue where the terms and conditions URL (`tc` key) was sent without double quotes
* Mitigated an issue where consent information was not sent when no consent was given during initialization
* Mitigated an issue where a session did not end when session consent was removed
* Mitigated an issue where pausing a view resulted in a '0' view duration.
* Mitigated an issue where the user provided URLSessionConfiguration was not applied to direct requests

* Updated the underlying Android SDK version to 24.7.8
* Updated the underlying iOS SDK version to 24.7.9

## 24.4.1
* Added support for Feedback Widget terms and conditions
* Added six new configuration options under the 'sdkInternalLimits' interface of 'CountlyConfig':
Expand Down
113 changes: 110 additions & 3 deletions Countly.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
interface Segmentation {
[key: string]: number | string | boolean;
[key: string]: number | string | boolean | (number | string | boolean)[];
}

interface CountlyEventOptions {
Expand Down Expand Up @@ -89,6 +89,29 @@ declare module "countly-sdk-react-native-bridge" {
* Countly Feedback Module
*/
namespace feedback {

/**
* Shows the first available NPS widget that meets the criteria.
* @param {String} [nameIDorTag] - name, id, or tag of the widget to show (optional)
* @param {callback} [widgetClosedCallback] - called when the widget is closed (optional)
*/
export function showNPS(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void;

/**
* Shows the first available survey widget that meets the criteria.
* @param {String} [nameIDorTag] - name, id, or tag of the widget to show (optional)
* @param {callback} [widgetClosedCallback] - called when the widget is closed (optional)
*/
export function showSurvey(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void;

/**
* Shows the first available rating widget that meets the criteria.
* @param {String} [nameIDorTag] - name, id, or tag of the widget to show (optional)
* @param {callback} [widgetClosedCallback] - called when the widget is closed (optional)
*/
export function showRating(nameIDorTag?: string, widgetClosedCallback?: WidgetCallback): void;


/**
* Get a list of available feedback widgets as an array of objects.
* @param {FeedbackWidgetCallback} [onFinished] - returns (retrievedWidgets, error). This parameter is optional.
Expand All @@ -106,7 +129,7 @@ declare module "countly-sdk-react-native-bridge" {
*
* @return {ErrorObject} object {error: string or null}
*/
export function presentFeedbackWidget(feedbackWidget: FeedbackWidget, closeButtonText: string, widgetShownCallback: callback, widgetClosedCallback: callback): ErrorObject;
export function presentFeedbackWidget(feedbackWidget: FeedbackWidget, closeButtonText: string, widgetShownCallback: WidgetCallback, widgetClosedCallback: WidgetCallback): ErrorObject;

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

/**
* Countly Content Module
*/
namespace content {
/**
* Opt in user for the content fetching and updates
*/
export function enterContentZone(): void;

/**
* Opt out user from the content fetching and updates
*/
export function exitContentZone(): void;
}

/**
* Initialize Countly
*
Expand Down Expand Up @@ -387,7 +425,8 @@ declare module "countly-sdk-react-native-bridge" {
export function disableLocation(): string | void;

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

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

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

namespace deviceId {
/**
*
* Get currently used device ID.
* Should be called after Countly init
*
* @returns {string | null} device ID or null
*/
export function getID(): Promise<string> | string;

/**
*
* Get currently used device ID type.
* Should be called after Countly init
*
* @return {DeviceIdType | null} deviceIdType or null
*/
export function getType(): Promise<DeviceIdType> | null;

/**
* Sets device ID according to the device ID Type.
* If previous ID was Developer Supplied sets it without merge, otherwise with merge.
*
* @param {string} newDeviceID device ID to set
*/
export function setID(newDeviceID: string): void;
}

/**
*
* Set to "true" if you want HTTP POST to be used for all requests
Expand Down Expand Up @@ -1097,6 +1168,32 @@ declare module "countly-sdk-react-native-bridge" {
}

declare module "countly-sdk-react-native-bridge/CountlyConfig" {
interface experimental {
/**
* Enables previous name recording for views and events
*/
enablePreviousNameRecording(): this;

/**
* Enables app visibility tracking with events.
*/
enableVisibilityTracking(): this;
}

interface content {
/**
*
* @param zoneTimerInterval - the interval in seconds to check for new content
*/
setZoneTimerInterval(zoneTimerInterval: number): this;

/**
*
* @param callback - callback to be called when new content is available
*/
setGlobalContentCallback(callback: Function): this;
}

/**
*
* This class holds APM specific configurations to be used with
Expand Down Expand Up @@ -1189,6 +1286,16 @@ declare module "countly-sdk-react-native-bridge/CountlyConfig" {
*/
sdkInternalLimits: CountlyConfigSDKInternalLimits;

/**
* getter for experimental features
*/
experimental: experimental;

/**
* getter for content features
*/
content: content;

/**
* Method to set the server url
*
Expand Down
54 changes: 52 additions & 2 deletions Countly.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import CountlyConfig from "./CountlyConfig.js";
import CountlyState from "./CountlyState.js";
import Feedback from "./Feedback.js";
import Event from "./Event.js";
import DeviceId from "./DeviceId.js";
import * as L from "./Logger.js";
import * as Utils from "./Utils.js";
import * as Validate from "./Validators.js";
Expand All @@ -26,12 +27,15 @@ CountlyState.eventEmitter = eventEmitter;

Countly.feedback = new Feedback(CountlyState);
Countly.events = new Event(CountlyState);
Countly.deviceId = new DeviceId(CountlyState);

let _isCrashReportingEnabled = false;

Countly.userData = {}; // userData interface
Countly.userDataBulk = {}; // userDataBulk interface

Countly.content = {}; // content interface

let _isPushInitialized = false;

/*
Expand Down Expand Up @@ -87,6 +91,17 @@ Countly.initWithConfig = async function (countlyConfig) {
return;
}
L.d("initWithConfig, Initializing Countly");
if (countlyConfig.content.contentCallback) {
eventEmitter.addListener("globalContentCallback", (data) => {
L.d(`init configuration, Global content callback called with data: ${data}`);
try {
data = JSON.parse(data);
countlyConfig.content.contentCallback(data.status, data.data);
} catch (error) {
L.e(`init configuration, Error parsing global content callback data: ${error}`);
}
});
}
const args = [];
const argsMap = Utils.configToJson(countlyConfig);
const argsString = JSON.stringify(argsMap);
Expand Down Expand Up @@ -456,7 +471,8 @@ Countly.disableLocation = function () {
};

/**
*
* @deprecated use 'Countly.deviceId.getID' instead of 'Countly.getCurrentDeviceId'
*
* Get currently used device Id.
* Should be called after Countly init
*
Expand All @@ -474,6 +490,8 @@ Countly.getCurrentDeviceId = async function () {
};

/**
* @deprecated use 'Countly.deviceId.getType' instead of 'Countly.getDeviceIDType'
*
* Get currently used device Id type.
* Should be called after Countly init
*
Expand All @@ -490,7 +508,9 @@ Countly.getDeviceIDType = async function () {
};

/**
* Change the current device id
* @deprecated use 'Countly.deviceId.setID' instead of 'Countly.changeDeviceId' for setting device ID.
*
* Change the current device ID
*
* @param {string} newDeviceID id new device id
* @param {boolean} onServer merge device id
Expand Down Expand Up @@ -2178,4 +2198,34 @@ Countly.setCustomMetrics = async function (customMetric) {
}
};

/**
* Opt in user for the content fetching and updates
*
* NOTE: This is an EXPERIMENTAL feature, and it can have breaking changes
*/
Countly.content.enterContentZone = function() {
L.i("enterContentZone, opting for content fetching.");
if (!_state.isInitialized) {
const message = "'init' must be called before 'enterContentZone'";
L.e(`enterContentZone, ${message}`);
return;
}
CountlyReactNative.enterContentZone();
};

/**
* Opt out user from the content fetching and updates
*
* NOTE: This is an EXPERIMENTAL feature, and it can have breaking changes
*/
Countly.content.exitContentZone = function() {
L.i("exitContentZone, opting out from content fetching.");
if (!_state.isInitialized) {
const message = "'init' must be called before 'exitContentZone'";
L.e(`exitContentZone, ${message}`);
return;
}
CountlyReactNative.exitContentZone();
};

export default Countly;
Loading