Skip to content

Commit

Permalink
Merge branch 'staging' of https://github.com/Countly/countly-sdk-ios
Browse files Browse the repository at this point in the history
…into visionos_support
  • Loading branch information
ijunaid committed Oct 24, 2024
2 parents 83e02cb + 9a1dd44 commit 6c1d248
Show file tree
Hide file tree
Showing 68 changed files with 4,322 additions and 865 deletions.
33 changes: 33 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Basic indentation settings
IndentWidth: 2
TabWidth: 2
ContinuationIndentWidth: 4
UseTab: Never
IndentPPDirectives: BeforeHash

# Code formatting rules
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
ColumnLimit: 300

# Blank lines
MaxEmptyLinesToKeep: 1

# Alignment
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignOperands: true
AlignTrailingComments: true

# Import statements
SortIncludes: true
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build the SDK

permissions:
checks: write
pull-requests: write

on:
push:
branches:
- master
- staging
pull_request:
branches:
- master
- staging
jobs:
build:
runs-on: macos-${{ matrix.env.os_version }}
strategy:
fail-fast: false
matrix:
env:
[
{os_version: 14, sdk: "macosx14.5"},
{os_version: 14, sdk: "iphoneos17.5"},
{os_version: 14, sdk: "appletvos17.5"},
{os_version: 14, sdk: "watchos10.5"},
{os_version: 14, sdk: "visionos1.2"},
{os_version: 12, sdk: "iphoneos16.2"},
{os_version: 12, sdk: "macosx13.1"},
{os_version: 12, sdk: "appletvos16.1"},
{os_version: 12, sdk: "visionos1.0"},
{os_version: 12, sdk: "watchos9.1"},
{os_version: 13, sdk: "iphoneos17.2"},
{os_version: 13, sdk: "macosx14.2"},
{os_version: 13, sdk: "appletvos17.2"},
{os_version: 13, sdk: "watchos10.2"},
{os_version: 13, sdk: "visionos1.1"}
]
steps:
# To check the github context
- name: Checkout SDK code
uses: actions/checkout@v4

- name: Build for the sdk ${{ matrix.env.sdk }} on macOS ${{ matrix.env.os_version }}
run: xcodebuild -project Countly.xcodeproj build -sdk ${{ matrix.env.sdk }}

- name: Run the tests for the sdk ${{ matrix.env.sdk }} on macOS ${{ matrix.env.os_version }}
run: echo good #xcodebuild -project Countly.xcodeproj test -destination ${{ matrix.env.destination }} -scheme CountlyTests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Thumbs.db
Countly.xcodeproj/project.xcworkspace/
Countly.xcodeproj/xcuserdata/
.build
build
.swiftpm
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
## x.x.x
* Added `CountlyFeedbacks:` interface with new view methods (Access with `Countly.sharedInstance.feedback`):
* Method to present feedback widget (wih an optional widget selector(name, ID or tag) string and a Callback):
* `presentNPS`
* `presentSurvey`
* `presentRating`
* `getAvailableFeedbackWidgets` method to retrieve available feedback widgets with a completion handler.

* Deprecated `getFeedbackWidgets` method, you should use `[feedback getAvailableFeedbackWidgets:]` method instead

## 24.7.3
* Added current view names to event segmentation based on the `enablePreviousNameRecording` (Experimental!)
* Updated the SDK to ensure compatibility with the latest server response models

## 24.7.2
* Automatic view pause/resumes are changed with stop/start for better data consistency.
* Added the config interface 'experimental' to group experimental features.
* Added a flag (enablePreviousNameRecording) to add previous event and view names as segmentation. (Experimental!)
* Added a flag (enableVisibilityTracking) to add app visibility info to views
* Added Content feature methods:
- enterContentZone, to start Content checks(Experimental!)
- exitContentZone, to stop content checks (Experimental!)

## 24.7.1
* Added `enableTemporaryDeviceIDMode` config and post-initialization methods to enable temporary device ID mode
* Orientation info is now also sent during initialization
* Mitigated an issue where consent information was not sent when no consent was given during initialization
* Mitigated an issue where a session could have started if the SDK was initialized on the background and automatic session tracking was enabled
* Mitigated an issue where a session did not end when session consent was removed
* Mitigated an issue where disabling location did not work

## 24.7.0
* Implemented automatic sending of user properties to the server without requiring an explicit call to the `save` method
* Added `setID` method for changing device ID based on the device ID type
* Enhanced segmentation values to include additional supported data types beyond `NSString`
* Fixed web view caching issue for widgets

* Mitigated an issue where the terms and conditions URL (`tc` key) was sent without double quotes
* Mitigated an issue where remote config values are not updated after enrolling to a variant

## 24.4.2
* Improved crash filtering capabilities to include modifications on the crash report

## 24.4.1
* Added support for Feedback Widget terms and conditions

* Mitigated an issue where SDK limits could affect internal keys
* Mitigated an issue that enabled recording reserved events
* Mitigated an issue where timed events could have no ID
* Mitigated an issue where internal limits were not being applied to some values
* Mitigated an issue where the request queue could overflow while sending a request

* Removed timestamps from crash breadcrumbs

## 24.4.0
* Added `attemptToSendStoredRequests` method to combine all events in event queue into a request and attempt to process stored requests
* Added the iOS privacy manifest to the Countly SDK
Expand Down
4 changes: 2 additions & 2 deletions Countly-PL.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Countly-PL'
s.version = '24.4.0'
s.version = '24.7.3'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
s.homepage = 'https://github.com/Countly/countly-sdk-ios'
Expand All @@ -17,7 +17,7 @@ Pod::Spec.new do |s|

s.subspec 'Core' do |core|
core.source_files = '*.{h,m}'
core.public_header_files = 'Countly.h', 'CountlyUserDetails.h', 'CountlyConfig.h', 'CountlyFeedbackWidget.h', 'CountlyRCData.h', 'CountlyRemoteConfig.h', 'CountlyViewTracking.h', 'CountlyExperimentInformation.h', 'CountlyAPMConfig.h', 'CountlySDKLimitsConfig.h', 'Resettable.h'
core.public_header_files = 'Countly.h', 'CountlyUserDetails.h', 'CountlyConfig.h', 'CountlyFeedbackWidget.h', 'CountlyRCData.h', 'CountlyRemoteConfig.h', 'CountlyViewTracking.h', 'CountlyExperimentInformation.h', 'CountlyAPMConfig.h', 'CountlySDKLimitsConfig.h', 'Resettable.h', "CountlyCrashesConfig.h", "CountlyCrashData.h", "CountlyContentBuilder.h", "CountlyExperimentalConfig.h", "CountlyContentConfig.h", "CountlyFeedbacks.h"
core.preserve_path = 'countly_dsym_uploader.sh'
core.ios.frameworks = ['Foundation', 'UIKit', 'UserNotifications', 'CoreLocation', 'WebKit', 'CoreTelephony', 'WatchConnectivity']
end
Expand Down
41 changes: 32 additions & 9 deletions Countly.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#import "CountlyRemoteConfig.h"
#import "CountlyFeedbackWidget.h"
#import "CountlyViewTracking.h"
#import "CountlyContentBuilder.h"
#import "CountlyFeedbacks.h"
#import "Resettable.h"
#if (TARGET_OS_IOS || TARGET_OS_VISION || TARGET_OS_OSX )
#import <UserNotifications/UserNotifications.h>
Expand Down Expand Up @@ -186,6 +188,15 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)changeDeviceIDWithoutMerge:(NSString * _Nullable)deviceID;

- (void)setID:(NSString *)deviceID;

/**
* This menthod will enable temporary device ID mode
* @discussion All requests will be on hold, but they will be persistently stored.
* @discussion When in temporary device ID mode, method calls for presenting feedback widgets and updating remote config will be ignored.
*/
- (void)enableTemporaryDeviceIDMode;


#pragma mark - Consents

Expand Down Expand Up @@ -291,7 +302,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param key Event key, a non-zero length valid string
* @param segmentation Segmentation key-value pairs of event
*/
- (void)recordEvent:(NSString *)key segmentation:(NSDictionary<NSString *, NSString *> * _Nullable)segmentation;
- (void)recordEvent:(NSString *)key segmentation:(NSDictionary<NSString *, id> * _Nullable)segmentation;

/**
* Records event with given key, segmentation and count.
Expand All @@ -302,7 +313,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param segmentation Segmentation key-value pairs of event
* @param count Count of event occurrences
*/
- (void)recordEvent:(NSString *)key segmentation:(NSDictionary<NSString *, NSString *> * _Nullable)segmentation count:(NSUInteger)count;
- (void)recordEvent:(NSString *)key segmentation:(NSDictionary<NSString *, id> * _Nullable)segmentation count:(NSUInteger)count;

/**
* Records event with given key, segmentation, count and sum.
Expand All @@ -314,7 +325,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param count Count of event occurrences
* @param sum Sum of any specific value for event
*/
- (void)recordEvent:(NSString *)key segmentation:(NSDictionary<NSString *, NSString *> * _Nullable)segmentation count:(NSUInteger)count sum:(double)sum;
- (void)recordEvent:(NSString *)key segmentation:(NSDictionary<NSString *, id> * _Nullable)segmentation count:(NSUInteger)count sum:(double)sum;

/**
* Records event with given key, segmentation, count, sum and duration.
Expand All @@ -327,7 +338,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param sum Sum of any specific value for event
* @param duration Duration of event in seconds
*/
- (void)recordEvent:(NSString *)key segmentation:(NSDictionary<NSString *, NSString *> * _Nullable)segmentation count:(NSUInteger)count sum:(double)sum duration:(NSTimeInterval)duration;
- (void)recordEvent:(NSString *)key segmentation:(NSDictionary<NSString *, id> * _Nullable)segmentation count:(NSUInteger)count sum:(double)sum duration:(NSTimeInterval)duration;

/**
* Starts a timed event with given key to be ended later. Duration of timed event will be calculated on ending.
Expand All @@ -354,7 +365,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param count Count of event occurrences
* @param sum Sum of any specific value for event
*/
- (void)endEvent:(NSString *)key segmentation:(NSDictionary<NSString *, NSString *> * _Nullable)segmentation count:(NSUInteger)count sum:(double)sum;
- (void)endEvent:(NSString *)key segmentation:(NSDictionary<NSString *, id> * _Nullable)segmentation count:(NSUInteger)count sum:(double)sum;

/**
* Cancels a previously started timed event with given key.
Expand Down Expand Up @@ -463,7 +474,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param stackTrace Stack trace to be recorded
* @param segmentation Crash segmentation to override @c crashSegmentation set on initial configuration
*/
- (void)recordException:(NSException *)exception isFatal:(BOOL)isFatal stackTrace:(NSArray * _Nullable)stackTrace segmentation:(NSDictionary<NSString *, NSString *> * _Nullable)segmentation;
- (void)recordException:(NSException *)exception isFatal:(BOOL)isFatal stackTrace:(NSArray * _Nullable)stackTrace segmentation:(NSDictionary<NSString *, id> * _Nullable)segmentation;

/**
* Records a Swift error with given stack trace.
Expand All @@ -481,7 +492,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param stackTrace Stack trace to be recorded
* @param segmentation Crash segmentation to override @c crashSegmentation set on initial configuration
*/
- (void)recordError:(NSString *)errorName isFatal:(BOOL)isFatal stackTrace:(NSArray * _Nullable)stackTrace segmentation:(NSDictionary<NSString *, NSString *> * _Nullable)segmentation;
- (void)recordError:(NSString *)errorName isFatal:(BOOL)isFatal stackTrace:(NSArray * _Nullable)stackTrace segmentation:(NSDictionary<NSString *, id> * _Nullable)segmentation;

/**
* Records a handled exception manually.
Expand Down Expand Up @@ -540,7 +551,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param viewName Name of the view visited, a non-zero length valid string
* @param segmentation Custom segmentation key-value pairs
*/
- (void)recordView:(NSString *)viewName segmentation:(NSDictionary<NSString *, NSString *> *)segmentation DEPRECATED_MSG_ATTRIBUTE("Use '[views startView/startAutoStoppedView:]' method instead!");
- (void)recordView:(NSString *)viewName segmentation:(NSDictionary<NSString *, id> *)segmentation DEPRECATED_MSG_ATTRIBUTE("Use '[views startView/startAutoStoppedView:]' method instead!");

#if (TARGET_OS_IOS || TARGET_OS_VISION || TARGET_OS_TV )
/**
Expand Down Expand Up @@ -666,8 +677,20 @@ NS_ASSUME_NONNULL_BEGIN
* @discussion - Current device ID is @c CLYTemporaryDeviceID.
* @param completionHandler A completion handler block to be executed when list is fetched successfully or there is an error.
*/
- (void)getFeedbackWidgets:(void (^)(NSArray <CountlyFeedbackWidget *> * __nullable feedbackWidgets, NSError * __nullable error))completionHandler;
- (void)getFeedbackWidgets:(void (^)(NSArray <CountlyFeedbackWidget *> * __nullable feedbackWidgets, NSError * __nullable error))completionHandler DEPRECATED_MSG_ATTRIBUTE("Use '[feedback getAvailableFeedbackWidgets:]' method instead!");

/**
* This is an experimental feature and it can have breaking changes
* Interface variable to access content functionalities.
* @discussion Content interface for developer to interact with SDK.
*/
- (CountlyContentBuilder *_Nonnull) content;

/**
* Interface variable to access feedback widget functionalities.
* @discussion Feedback widget interface for developer to interact with SDK.
*/
- (CountlyFeedbacks *) feedback;
#endif


Expand Down
Loading

0 comments on commit 6c1d248

Please sign in to comment.