Skip to content

Commit aeabe0e

Browse files
authored
Merge pull request #170 from erkanyildiz/master
For 20.11.0
2 parents d5c79ff + 4ae4acc commit aeabe0e

28 files changed

+914
-243
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ Thumbs.db
1010
.LSOverride
1111
Countly.xcodeproj/project.xcworkspace/
1212
Countly.xcodeproj/xcuserdata/
13+
.build
14+
.swiftpm

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## 20.11.0
2+
- Added Surveys and NPS feedback widgets
3+
- Added Swift Package Manager support
4+
- Added `replaceAllAppKeysInQueueWithCurrentAppKey` method to replace all app keys in queue with the current app key
5+
- Added `removeDifferentAppKeysFromQueue` method to remove all different app keys from the queue
6+
- Added `deviceIDType` method to be able to check device ID type
7+
- Added precaution and warning for `nil` crash report case
8+
- Added `consents` initial config property
9+
- Added device type metric
10+
- Updated dismiss button design
11+
- Fixed web view autoresizing mask for legacy feedback widgets
12+
- Fixed a missing `CoreLocation` framework import
13+
- Fixed unnecessary recreation of `NSURLSession` instances
14+
- Fixed dismiss button layout
15+
- Changed interface orientation change event consent from `Events` to `UserDetails`
16+
- Changed remote config consent from `Any` to `RemoteConfig`
17+
- Marked `pushTestMode` initial config property as `_Nullable`
18+
19+
- Other various improvements
20+
- Refactored picture upload data extraction
21+
- Suppressed an internal log for interface orientation change
22+
- Updated some constant key declarations for common use
23+
- Updated HeaderDocs, internal logs, inline notes and pragma marks
24+
25+
26+
127
## 20.04.3
228
- Deprecated `recordLocation:`, `recordCity:andISOCountryCode:`, `recordIP:` methods
329
- Added new combined `recordLocation:city:ISOCountryCode:IP:` method for recording location related info

Countly.h

100755100644
Lines changed: 66 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#import <CoreLocation/CoreLocation.h>
99
#import "CountlyUserDetails.h"
1010
#import "CountlyConfig.h"
11+
#import "CountlyFeedbackWidget.h"
1112
#if (TARGET_OS_IOS || TARGET_OS_OSX)
1213
#import <UserNotifications/UserNotifications.h>
1314
#endif
@@ -30,22 +31,12 @@ NS_ASSUME_NONNULL_BEGIN
3031
*/
3132
- (void)startWithConfig:(CountlyConfig *)config;
3233

33-
/**
34-
* Sets new device ID to be persistently stored and used in following requests.
35-
* @discussion Value passed for @c deviceID parameter has to be a non-zero length valid string, otherwise default device ID will be used instead.
36-
* @discussion If value passed for @c deviceID parameter is exactly same to the current device ID, method call is ignored.
37-
* @discussion When passing @c CLYTemporaryDeviceID for @c deviceID parameter, argument for @c onServer parameter does not matter.
38-
* @discussion When setting a new device ID while the current device ID is @c CLYTemporaryDeviceID, argument for @c onServer parameter does not matter.
39-
* @param deviceID New device ID
40-
* @param onServer If set, data on Countly Server will be merged automatically, otherwise device will be counted as a new device
41-
*/
42-
- (void)setNewDeviceID:(NSString * _Nullable)deviceID onServer:(BOOL)onServer;
43-
4434
/**
4535
* Sets new app key to be used in following requests.
4636
* @discussion Before switching to new app key, this method suspends Countly and resumes immediately after.
4737
* @discussion Requests already queued previously will keep using the old app key.
4838
* @discussion New app key needs to be a non-zero length string, otherwise it is ignored.
39+
* @discussion @c recordPushNotificationToken and @c updateRemoteConfigWithCompletionHandler: methods may need to be called again after app key change.
4940
* @param newAppKey New app key
5041
*/
5142
- (void)setNewAppKey:(NSString *)newAppKey;
@@ -65,6 +56,20 @@ NS_ASSUME_NONNULL_BEGIN
6556
*/
6657
- (void)flushQueues;
6758

59+
/**
60+
* Replaces all requests with a different app key with the current app key.
61+
* @discussion In request queue, if there are any request whose app key is different than the current app key,
62+
* @discussion these requests' app key will be replaced with the current app key.
63+
*/
64+
- (void)replaceAllAppKeysInQueueWithCurrentAppKey;
65+
66+
/**
67+
* Removes all requests with a different app key in request queue.
68+
* @discussion In request queue, if there are any request whose app key is different than the current app key,
69+
* @discussion these requests will be removed from request queue.
70+
*/
71+
- (void)removeDifferentAppKeysFromQueue;
72+
6873
/**
6974
* Starts session and sends @c begin_session request with default metrics for manual session handling.
7075
* @discussion This method needs to be called for starting a session only if @c manualSessionHandling flag is set on initial configuration.
@@ -102,6 +107,37 @@ NS_ASSUME_NONNULL_BEGIN
102107

103108

104109

110+
#pragma mark - Device ID
111+
112+
/**
113+
* Returns current device ID being used for tracking.
114+
* @discussion Device ID can be used for handling data export and/or removal requests as part of data privacy compliance.
115+
*/
116+
- (NSString *)deviceID;
117+
118+
/**
119+
* Returns current device ID type.
120+
* @discussion Device ID type can be one of the following:
121+
* @discussion @c CLYDeviceIDTypeCustom : Custom device ID set by app developer.
122+
* @discussion @c CLYDeviceIDTypeTemporary : Temporary device ID. See @c CLYTemporaryDeviceID for details.
123+
* @discussion @c CLYDeviceIDTypeIDFV : Default device ID type used by the SDK on iOS and tvOS.
124+
* @discussion @c CLYDeviceIDTypeNSUUID : Default device ID type used by the SDK on watchOS and macOS.
125+
*/
126+
- (CLYDeviceIDType)deviceIDType;
127+
128+
/**
129+
* Sets new device ID to be persistently stored and used in following requests.
130+
* @discussion Value passed for @c deviceID parameter has to be a non-zero length valid string, otherwise default device ID will be used instead.
131+
* @discussion If value passed for @c deviceID parameter is exactly same to the current device ID, method call is ignored.
132+
* @discussion When passing @c CLYTemporaryDeviceID for @c deviceID parameter, argument for @c onServer parameter does not matter.
133+
* @discussion When setting a new device ID while the current device ID is @c CLYTemporaryDeviceID, argument for @c onServer parameter does not matter.
134+
* @param deviceID New device ID
135+
* @param onServer If set, data on Countly Server will be merged automatically, otherwise device will be counted as a new device
136+
*/
137+
- (void)setNewDeviceID:(NSString * _Nullable)deviceID onServer:(BOOL)onServer;
138+
139+
140+
105141
#pragma mark - Consents
106142

107143
/**
@@ -153,12 +189,6 @@ NS_ASSUME_NONNULL_BEGIN
153189
*/
154190
- (void)cancelConsentForAllFeatures;
155191

156-
/**
157-
* Returns current device ID being used for tracking.
158-
* @discussion Device ID can be used for handling data export and/or removal requests as part of data privacy compliance.
159-
*/
160-
- (NSString *)deviceID;
161-
162192

163193

164194
#pragma mark - Events
@@ -311,7 +341,8 @@ NS_ASSUME_NONNULL_BEGIN
311341

312342
/**
313343
* Records push notification token to Countly Server for current device ID.
314-
* @discussion Can be used to re-send push notification token for current device ID, after a new user logs in and device ID changes, without waiting for the app to be restarted.
344+
* @discussion Can be used to re-send push notification token for current device ID, without waiting for the app to be restarted.
345+
* @discussion For cases like a new user logs in and device ID changes, or a new app key is set.
315346
* @discussion In general, push notification token is handled automatically and this method does not need to be called manually.
316347
*/
317348
- (void)recordPushNotificationToken;
@@ -504,7 +535,7 @@ NS_ASSUME_NONNULL_BEGIN
504535

505536

506537

507-
#pragma mark - Star Rating
538+
#pragma mark - Feedbacks
508539
#if (TARGET_OS_IOS)
509540
/**
510541
* Shows star-rating dialog manually and executes completion block after user's action.
@@ -518,17 +549,30 @@ NS_ASSUME_NONNULL_BEGIN
518549
* Presents feedback widget with given ID in a WKWebView placed in a UIViewController.
519550
* @discussion First, the availability of the feedback widget will be checked asynchronously.
520551
* @discussion If the feedback widget with given ID is available, it will be modally presented.
521-
* @discussion Otherwise, @c completionHandler will be called with an @c NSError.
522-
* @discussion @c completionHandler will also be called with @c nil when feedback widget is dismissed by user.
552+
* @discussion Otherwise, @c completionHandler will be executed with an @c NSError.
553+
* @discussion @c completionHandler will also be executed with @c nil when feedback widget is dismissed by user.
523554
* @discussion Calls to this method will be ignored and @c completionHandler will not be executed if:
524-
* @discussion - Consent for @c CLYConsentStarRating is not given, while @c requiresConsent flag is set on initial configuration.
555+
* @discussion - Consent for @c CLYConsentFeedback is not given, while @c requiresConsent flag is set on initial configuration.
525556
* @discussion - Current device ID is @c CLYTemporaryDeviceID.
526557
* @discussion - @c widgetID is not a non-zero length valid string.
558+
* @discussion This is a legacy method for presenting Rating type feedback widgets only.
559+
* @discussion Passing widget ID's of Survey or NPS type feedback widgets will not work.
527560
* @param widgetID ID of the feedback widget created on Countly Server.
528561
* @param completionHandler A completion handler block to be executed when feedback widget is dismissed by user or there is an error.
529562
*/
530563
- (void)presentFeedbackWidgetWithID:(NSString *)widgetID completionHandler:(void (^)(NSError * error))completionHandler;
531564

565+
/**
566+
* Fetches a list of available feedback widgets.
567+
* @discussion When feedback widgets are fetched succesfully, @c completionHandler will be exeuted with an array of @c CountlyFeedbackWidget objects.
568+
* @discussion Otherwise, @c completionHandler will be executed with an @c NSError.
569+
* @discussion Calls to this method will be ignored and @c completionHandler will not be executed if:
570+
* @discussion - Consent for @c CLYConsentFeedback is not given, while @c requiresConsent flag is set on initial configuration.
571+
* @discussion - Current device ID is @c CLYTemporaryDeviceID.
572+
* @param completionHandler A completion handler block to be executed when list is fetched successfully or there is an error.
573+
*/
574+
- (void)getFeedbackWidgets:(void (^)(NSArray <CountlyFeedbackWidget *> *feedbackWidgets, NSError *error))completionHandler;
575+
532576
#endif
533577

534578

0 commit comments

Comments
 (0)