Skip to content

Commit 4815ea2

Browse files
committed
release: SDK 1.21.0
1 parent 9ca9011 commit 4815ea2

File tree

65 files changed

+749
-773
lines changed

Some content is hidden

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

65 files changed

+749
-773
lines changed

Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ let package = Package(
1818
targets: [
1919
.binaryTarget(
2020
name: "Batch",
21-
url: "https://download.batch.com/sdk/ios/spm/BatchSDK-ios_spm-xcframework-1.20.0.zip",
22-
checksum: "90c5ed03fab1c1708f54eb6eaa8180962e14659cc76fe0bd7f561273818eec94"
21+
url: "https://download.batch.com/sdk/ios/spm/BatchSDK-ios_spm-xcframework-1.21.0.zip",
22+
checksum: "0e1edfbf2df8952552ae62bcfd1262347554af3c993a38c2d0e4eccbcac28c7b"
2323
)
2424
]
2525
)

Sources/Batch.xcodeproj/project.pbxproj

+24-17
Large diffs are not rendered by default.

Sources/Batch.xcodeproj/xcshareddata/xcschemes/Batch.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1500"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sources/Batch.xcodeproj/xcshareddata/xcschemes/BatchStatic.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sources/Batch.xcodeproj/xcshareddata/xcschemes/BatchTests.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1500"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sources/Batch.xcodeproj/xcshareddata/xcschemes/BatchUniversal.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sources/Batch.xcodeproj/xcshareddata/xcschemes/BatchXCFramework.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1200"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sources/Batch/BatchCore.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ typedef NS_ENUM(NSUInteger, BatchOptOutNetworkErrorPolicy) {
5353
/// ``Batch/BatchPush/disableAutomaticIntegration`` before this method, and follow the "Manual Integration" advanced.
5454
/// - Parameters:
5555
/// - key: Your APP's API Key, LIVE or DEV. You can find it on your dashboard.
56-
+ (void)startWithAPIKey:(NSString *_Nonnull)key NS_AVAILABLE_IOS(8_0);
56+
+ (void)startWithAPIKey:(NSString *_Nonnull)key;
5757

5858
/// Handles an URL, if applicable.
5959
///
@@ -70,15 +70,17 @@ typedef NS_ENUM(NSUInteger, BatchOptOutNetworkErrorPolicy) {
7070

7171
/// Access the default user profile object.
7272
///
73+
/// - Deprecated: Please use Batch User instead
7374
/// - Returns: An instance of ``BatchUserProfile``, or nil
7475
+ (BatchUserProfile *_Nullable)defaultUserProfile
7576
__attribute__((warn_unused_result, deprecated("Please use Batch User instead")))NS_AVAILABLE_IOS(8_0);
7677

77-
/// Control whether Batch should try to use the IDFA or if you forbid it to. (default = YES)
78-
/// - Warning: If you disable this, you might not be able to use IDFA based debugging in your dashboard.
78+
/// As Batch has removed support for automatic IDFA collection, this method does nothing. The SDK will not collect the
79+
/// IDFA from the system.
80+
/// - Warning: This method has been deprecated
7981
/// - Parameters:
80-
/// - use: YES if Batch can try to use the IDFA, NO if you don't want Batch to use the IDFA.
81-
+ (void)setUseIDFA:(BOOL)use NS_AVAILABLE_IOS(8_0);
82+
/// - use: This parameter doesn't do anything
83+
+ (void)setUseIDFA:(BOOL)use __attribute__((deprecated));
8284

8385
/// Set if Batch can use advanced device identifiers (default = YES)
8486
///
@@ -87,18 +89,16 @@ typedef NS_ENUM(NSUInteger, BatchOptOutNetworkErrorPolicy) {
8789
/// - Device model
8890
/// - Device brand
8991
/// - Carrier name
90-
/// - Important: Disabling this does not automatically disable IDFA collection, please use the appropriate methods to
91-
/// control this.
9292
/// - Parameters:
9393
/// - use: YES if Batch can try to use advanced device information, NO if you don't
94-
+ (void)setUseAdvancedDeviceInformation:(BOOL)use NS_AVAILABLE_IOS(8_0);
94+
+ (void)setUseAdvancedDeviceInformation:(BOOL)use;
9595

9696
/// Set if Batch should send its logs to a custom object of yours.
9797
///
9898
/// - Important: Be careful with your implementation: setting this can impact stability and performance. You should only
9999
/// use it if you know what you are doing.
100100
/// - Parameter loggerDelegate: An object implementing ``Batch/BatchLoggerDelegate``. Weakly retained.
101-
+ (void)setLoggerDelegate:(id<BatchLoggerDelegate> _Nullable)loggerDelegate NS_AVAILABLE_IOS(8_0);
101+
+ (void)setLoggerDelegate:(id<BatchLoggerDelegate> _Nullable)loggerDelegate;
102102

103103
/// Get the debug view controller.
104104
///
@@ -208,7 +208,7 @@ typedef NS_ENUM(NSUInteger, BatchOptOutNetworkErrorPolicy) {
208208
/// - Important: Make sure to only include the desired subdomain and the top-level domain. Don’t include path and query
209209
/// components or a trailing slash (/).
210210
/// - Parameter domains: An array of your supported associated domains.
211-
+ (void)setAssociatedDomains:(NSArray<NSString *> *_Nonnull)domains NS_AVAILABLE_IOS(8_0);
211+
+ (void)setAssociatedDomains:(NSArray<NSString *> *_Nonnull)domains;
212212

213213
@end
214214

Sources/Batch/BatchCore.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ + (BatchUserProfile *)defaultUserProfile {
4343
return sharedInstance;
4444
}
4545

46-
// Set if Batch can try to use IDFA (default = YES)
46+
// Set if Batch can try to use IDFA. Deprecated.
4747
+ (void)setUseIDFA:(BOOL)use {
48-
[BACenterMulticastDelegate setUseIDFA:use];
48+
[BALogger publicForDomain:nil message:@"Ignoring 'setUseIDFA' API call: Batch has removed support for IDFA."];
4949
}
5050

51-
+ (void)setLoggerDelegate:(id<BatchLoggerDelegate>)loggerDelegate NS_AVAILABLE_IOS(8_0) {
51+
+ (void)setLoggerDelegate:(id<BatchLoggerDelegate>)loggerDelegate {
5252
[[[BACoreCenter instance] configuration] setLoggerDelegate:loggerDelegate];
5353
}
5454

Sources/Batch/BatchPush.h

+22-23
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
8585
/// You can call this method from any thread.
8686
/// - Warning: __Deprecated:__ This method is deprectaed. You don't need to do anything else besides removing this call,
8787
/// Batch Push will still work as expected.
88-
+ (void)setupPush NS_AVAILABLE_IOS(8_0)
88+
+ (void)setupPush
8989
__attribute__((deprecated("setupPush is deprecated. You don't need to do anything else besides removing this call, "
9090
"Batch Push will still work as expected.")));
9191

@@ -95,7 +95,7 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
9595
/// system settings. Default value is: `BatchNotificationTypeBadge | BatchNotificationTypeSound |
9696
/// BatchNotificationTypeAlert`.
9797
/// - Parameter type: A bit mask specifying the types of notifications the app accepts.
98-
+ (void)setRemoteNotificationTypes:(BatchNotificationType)type NS_AVAILABLE_IOS(8_0);
98+
+ (void)setRemoteNotificationTypes:(BatchNotificationType)type;
9999

100100
/// Method to trigger the iOS popup that asks the user if they wants to allow notifications to be displayed, then
101101
/// get a Push token.
@@ -105,7 +105,7 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
105105
/// You should call this at a strategic moment, like at the end of your welcome.
106106
///
107107
/// Batch will automatically ask for a push token when the user replies.
108-
+ (void)requestNotificationAuthorization NS_AVAILABLE_IOS(8_0);
108+
+ (void)requestNotificationAuthorization;
109109

110110
/// Method to ask iOS for a provisional notification authorization.
111111
///
@@ -116,15 +116,15 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
116116
/// from the statusbar when unlocked.
117117
///
118118
/// This method does nothing on iOS 11 or lower.
119-
+ (void)requestProvisionalNotificationAuthorization NS_AVAILABLE_IOS(8_0);
119+
+ (void)requestProvisionalNotificationAuthorization;
120120

121121
/// Ask iOS to refresh the push token. If the app didn't prompt the user for consent yet, this will not be done.
122122
///
123123
/// You should call this at the start of your app, to make sure Batch always gets a valid token after app updates.
124-
+ (void)refreshToken NS_AVAILABLE_IOS(8_0);
124+
+ (void)refreshToken;
125125

126126
/// Open the system settings on your applications' notification settings.
127-
+ (void)openSystemNotificationSettings NS_AVAILABLE_IOS(8_0);
127+
+ (void)openSystemNotificationSettings;
128128

129129
/// Method to trigger the iOS popup that asks the user if they wants to allow Push Notifications, then get a Push token.
130130
/// (Deprecated)
@@ -135,7 +135,7 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
135135
/// Equivalent to calling ``BatchPush/requestNotificationAuthorization``
136136
/// - Warning: __Deprecated:__ This method is deprectaed. Use ``BatchPush/requestNotificationAuthorization`` and
137137
/// ``BatchPush/refreshToken`` separately. More info in our documentation.
138-
+ (void)registerForRemoteNotifications NS_AVAILABLE_IOS(8_0)__attribute__((
138+
+ (void)registerForRemoteNotifications __attribute__((
139139
deprecated("Use requestNotificationAuthorization and refreshToken separately. More info in our documentation.")));
140140

141141
/// Method to trigger the iOS popup that asks the user if they want to allow Push Notifications and register to APNS.
@@ -152,8 +152,8 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
152152
/// - Warning: __Deprecated:__ Use ``BatchPush/setNotificationsCategories:`` and
153153
/// ``BatchPush/registerForRemoteNotifications`` separately.
154154
+ (void)registerForRemoteNotificationsWithCategories:(nullable NSSet *)categories
155-
NS_AVAILABLE_IOS(8_0)
156-
__attribute__((deprecated("Use setNotificationCategories and registerForRemoteNotifications separately.")));
155+
156+
__attribute__((deprecated("Use setNotificationCategories and registerForRemoteNotifications separately.")));
157157

158158
/// Set the notification action categories to iOS.
159159
///
@@ -164,19 +164,19 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
164164
/// groups of actions a notification may include. If you try to register `UIUserNotificationCategory` instances on iOS
165165
/// 10, Batch will automatically do a best effort conversion to `UNNotificationCategory`. If you don't want this
166166
/// behaviour, please use the standard `UIApplication` methods.
167-
+ (void)setNotificationsCategories:(nullable NSSet *)categories NS_AVAILABLE_IOS(8_0);
167+
+ (void)setNotificationsCategories:(nullable NSSet *)categories;
168168

169169
/// Clear the application's badge on the homescreen.
170170
///
171171
/// You do not need to call this if you already called ``BatchPush/dismissNotifications``.
172-
+ (void)clearBadge NS_AVAILABLE_IOS(8_0);
172+
+ (void)clearBadge;
173173

174174
/// Clear the app's notifications in the notification center. Also clears your badge.
175175
///
176176
/// Call this when you want to remove the notifications. Your badge is removed afterwards, so if you want one, you need
177177
/// to set it up again.
178178
/// - Important: Be careful, this method also clears your badge.
179-
+ (void)dismissNotifications NS_AVAILABLE_IOS(8_0);
179+
+ (void)dismissNotifications;
180180

181181
/// Set whether Batch Push should automatically try to handle deeplinks.
182182
///
@@ -190,37 +190,37 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
190190
/// - Important: If Batch is set to handle your deeplinks, it will *automatically* call the fetch completion handler (if
191191
/// applicable) with `UIBackgroundFetchResultNewData.
192192
/// - Parameter handleDeeplinks: Whether Batch should handle deeplinks automatically.
193-
+ (void)enableAutomaticDeeplinkHandling:(BOOL)handleDeeplinks NS_AVAILABLE_IOS(8_0);
193+
+ (void)enableAutomaticDeeplinkHandling:(BOOL)handleDeeplinks;
194194

195195
/// Get Batch Push's deeplink from a notification's userInfo.
196196
///
197197
/// - Parameter userData The notification's payload.
198198
/// - Returns: Batch's Deeplink, or nil if not found.
199-
+ (nullable NSString *)deeplinkFromUserInfo:(nonnull NSDictionary *)userData NS_AVAILABLE_IOS(8_0);
199+
+ (nullable NSString *)deeplinkFromUserInfo:(nonnull NSDictionary *)userData;
200200

201201
/// Get the last known push token.
202202
///
203203
/// Your application should still register for remote notifications once per launch, in order to keep this value valid.
204204
/// - Important: The returned token might be outdated and invalid if this method is called too early in your application
205205
/// lifecycle.
206206
/// - Returns: A push token, nil if unavailable.
207-
+ (nullable NSString *)lastKnownPushToken NS_AVAILABLE_IOS(8_0);
207+
+ (nullable NSString *)lastKnownPushToken;
208208

209209
/// Disable the push's automatic integration.
210210
///
211211
/// If you call this, you are responsible of forwarding your application's delegate and
212212
/// `UNUserNotificationCenterDelegate` calls to Batch. If you don't, some parts of the SDK and Dashboard will break.
213213
/// Calling this method automatically calls `disableAutomaticNotificationCenterIntegration`.
214214
/// - Important: This must be called before you start Batch, or it will have no effect.
215-
+ (void)disableAutomaticIntegration NS_AVAILABLE_IOS(8_0);
215+
+ (void)disableAutomaticIntegration;
216216

217217
/// Registers a device token to Batch.
218218
///
219219
/// You should call this method in `application:didRegisterForRemoteNotificationsWithDeviceToken:`.
220220
/// - Important: If you didn't call ``BatchPush/disableAutomaticIntegration``, this method will have no effect.
221221
/// If you called it but don't implement this method, Batch's push features will __NOT__ work.
222222
/// - Parameter token: The untouched `deviceToken` NSData argument given to you in the application delegate method.
223-
+ (void)handleDeviceToken:(nonnull NSData *)token NS_AVAILABLE_IOS(8_0);
223+
+ (void)handleDeviceToken:(nonnull NSData *)token;
224224

225225
/// Check if the received push is a Batch one.
226226
///
@@ -229,7 +229,7 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
229229
/// - Parameter userInfo: The untouched `userInfo` NSDictionary argument given to you in the application delegate
230230
/// method.
231231
/// - Returns: Wheter it is a Batch'sPush. If it returns true, you should not handle the push.
232-
+ (BOOL)isBatchPush:(nonnull NSDictionary *)userInfo NS_AVAILABLE_IOS(8_0);
232+
+ (BOOL)isBatchPush:(nonnull NSDictionary *)userInfo;
233233

234234
/// Make Batch process a notification. (Deprecated)
235235
///
@@ -255,8 +255,7 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
255255
/// - userInfo: The untouched `userInfo` NSDictionary argument given to you in the application delegate method.
256256
/// - identifier: The action's identifier. Used for tracking purposes: it can match your raw action name, or be a more
257257
/// user-friendly string.
258-
+ (void)handleNotification:(nonnull NSDictionary *)userInfo
259-
actionIdentifier:(nullable NSString *)identifier NS_AVAILABLE_IOS(8_0);
258+
+ (void)handleNotification:(nonnull NSDictionary *)userInfo actionIdentifier:(nullable NSString *)identifier;
260259

261260
#pragma clang diagnostic push
262261
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -289,7 +288,7 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
289288
+ (void)handleUserNotificationCenter:(nonnull UNUserNotificationCenter *)center
290289
willPresentNotification:(nonnull UNNotification *)notification
291290
willShowSystemForegroundAlert:(BOOL)willShowSystemForegroundAlert
292-
NS_AVAILABLE_IOS(10_0)NS_SWIFT_NAME(handle(userNotificationCenter:willPresent:willShowSystemForegroundAlert:));
291+
NS_SWIFT_NAME(handle(userNotificationCenter:willPresent:willShowSystemForegroundAlert:));
293292

294293
/// Make Batch process a background notification open/action.
295294
///
@@ -299,8 +298,8 @@ typedef NS_ENUM(NSUInteger, BatchNotificationSource) {
299298
/// - center: Original center argument.
300299
/// - response: Original response argument.
301300
+ (void)handleUserNotificationCenter:(nonnull UNUserNotificationCenter *)center
302-
didReceiveNotificationResponse:(nonnull UNNotificationResponse *)response NS_AVAILABLE_IOS(10_0)
303-
NS_SWIFT_NAME(handle(userNotificationCenter:didReceive:));
301+
didReceiveNotificationResponse:(nonnull UNNotificationResponse *)response
302+
NS_SWIFT_NAME(handle(userNotificationCenter:didReceive:));
304303

305304
@end
306305

Sources/Batch/BatchPush.m

-5
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,11 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
199199
if (self.showForegroundNotifications) {
200200
options = UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound;
201201

202-
// TODO: Remove ifdef once we Xcode 12 supports macOS 11 Big Sur
203-
#ifdef __IPHONE_14_0
204202
if (@available(iOS 14.0, *)) {
205203
options = options | UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner;
206204
} else {
207205
options = options | UNNotificationPresentationOptionAlert;
208206
}
209-
#else
210-
options = options | UNNotificationPresentationOptionAlert;
211-
#endif
212207
}
213208

214209
if (completionHandler) {

Sources/Batch/BatchUser.h

+5
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ typedef NS_ENUM(NSUInteger, BatchEmailSubscriptionState) {
236236
/// - Parameter identifier: User identifier.
237237
- (void)setIdentifier:(nullable NSString *)identifier;
238238

239+
/// Set the user attribution identifier.
240+
///
241+
/// - Parameter attributionID: A valid UUID string or null to reset.
242+
- (void)setAttributionIdentifier:(nullable NSString *)attributionID;
243+
239244
/// Set the user email.
240245
///
241246
/// - Important: This method requires to already have a registered identifier for the user

Sources/Batch/BatchUser.m

+4
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ - (void)setIdentifier:(nullable NSString *)identifier {
233233
[_backingImpl setIdentifier:identifier];
234234
}
235235

236+
- (void)setAttributionIdentifier:(nullable NSString *)attributionID {
237+
[_backingImpl setAttributionIdentifier:attributionID];
238+
}
239+
236240
- (BOOL)setEmail:(nullable NSString *)email error:(NSError **)error {
237241
return [_backingImpl setEmail:email error:error];
238242
}

Sources/Batch/Defined.h

+3-11
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@
2323
} \
2424
*error = nil;
2525

26-
// Enable IDFA related code
27-
// Even though IDFA collection is based on AdSupport being linked to the app,
28-
// some users might want to remove all IDFA references from the code.
29-
// This is a quick hack until we properly move towards IDFA collection into a plugin.
30-
// Note: this does NOT remove AppTrackingTransparency related code
31-
#ifndef BATCH_ENABLE_IDFA
32-
#define BATCH_ENABLE_IDFA 1
33-
#endif
34-
3526
// BAVersion, BALevel and BAMessagingLevel have moved into Version.h and have been renamed
3627
// Their values are not documented there because the Info.plist header parser is pretty dumb and will include comments
3728
// If you need to get the user facing BAVersion, use BACoreCenter.sdkVersion
@@ -67,15 +58,16 @@
6758
#define kParametersSystemPreviousAppVersionKey @"app.version.previous"
6859

6960
#define kParametersIDsPatternKey @"app.ids.pattern"
70-
#define kParametersIDsPatternValue \
71-
@"s,da,ada,did,cus,tath,dla,dre,dtz,osv,de,apv,apc,bid,pl,lvl,mlvl,pid,plv,brv,attid_e"
61+
#define kParametersIDsPatternValue @"s,da,did,cus,idfa,dla,dre,dtz,osv,de,apv,apc,bid,pl,lvl,mlvl,pid,plv,brv"
7262

7363
#define kParametersAdvancedIDsPatternKey @"app.ids.pattern_advanced"
7464
#define kParametersAdvancedIDsPatternValue @"dty,sop"
7565

7666
#define kParametersCustomUserIDKey @"app.id.custom"
7767
#define kParametersAppLanguageKey @"app.language"
7868
#define kParametersAppRegionKey @"app.region"
69+
#define kParametersAttributionIDKey @"app.id.attribution"
70+
7971
#define kParametersAppProfileVersionKey @"app.profile.version"
8072

8173
#define kParametersDateFormat @"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS'Z'"

Sources/Batch/Kernel/Helpers/BAPartialApplicationDelegate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
2828
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
2929

3030
- (void)application:(UIApplication *)application
31-
didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings NS_AVAILABLE_IOS(8_0);
31+
didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
3232

3333
#pragma clang diagnostic pop
3434

0 commit comments

Comments
 (0)