Skip to content

Commit f8fa9e3

Browse files
ThomasMengelatteabarisain
authored andcommitted
release: SDK 3.0.0
1 parent 8918333 commit f8fa9e3

File tree

180 files changed

+8958
-1429
lines changed

Some content is hidden

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

180 files changed

+8958
-1429
lines changed

LICENSE.thirdparty

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,29 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2323
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
THE SOFTWARE.
2525

26-
--------
26+
--------
27+
28+
Flight-School/AnyCodable
29+
The MIT License (MIT)
30+
31+
Copyright 2018 Read Evaluate Press, LLC
32+
33+
Permission is hereby granted, free of charge, to any person obtaining a
34+
copy of this software and associated documentation files (the "Software"),
35+
to deal in the Software without restriction, including without limitation
36+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
37+
and/or sell copies of the Software, and to permit persons to whom the
38+
Software is furnished to do so, subject to the following conditions:
39+
40+
The above copyright notice and this permission notice shall be included in
41+
all copies or substantial portions of the Software.
42+
43+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
44+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
48+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
49+
DEALINGS IN THE SOFTWARE.
50+
51+
--------

Package.swift

Lines changed: 2 additions & 2 deletions
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-2.1.0.zip",
22-
checksum: "7e91b40df3e2ce23ebf3b3589771770a9038042a8ccda6785be25e6b9c60307f"
21+
url: "https://download.batch.com/sdk/ios/spm/BatchSDK-ios_spm-xcframework-3.0.0.zip",
22+
checksum: "6a85b851bc483fdccbf4d5b9ee916637ad20bae3ad2cb47f437f56cf2af20d7f"
2323
)
2424
]
2525
)

Sources/Batch.xcodeproj/project.pbxproj

Lines changed: 517 additions & 69 deletions
Large diffs are not rendered by default.

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "501C88F02DA5637900C48E6E"
18+
BuildableName = "UITestAppUITests.xctest"
19+
BlueprintName = "UITestAppUITests"
20+
ReferencedContainer = "container:../UITestApp/UITestApp.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
824
</BuildAction>
925
<TestAction
1026
buildConfiguration = "Debug"
@@ -47,6 +63,15 @@
4763
savedToolIdentifier = ""
4864
useCustomWorkingDirectory = "NO"
4965
debugDocumentVersioning = "YES">
66+
<MacroExpansion>
67+
<BuildableReference
68+
BuildableIdentifier = "primary"
69+
BlueprintIdentifier = "501C88F02DA5637900C48E6E"
70+
BuildableName = "UITestAppUITests.xctest"
71+
BlueprintName = "UITestAppUITests"
72+
ReferencedContainer = "container:../UITestApp/UITestApp.xcodeproj">
73+
</BuildableReference>
74+
</MacroExpansion>
5075
</ProfileAction>
5176
<AnalyzeAction
5277
buildConfiguration = "Debug">

Sources/Batch/BatchCore.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ typedef NS_OPTIONS(NSUInteger, BatchMigration) {
6262

6363
/// Start Batch.
6464
///
65-
/// You should call this method in `application:didFinishLaunchingWithOptions:` of your `UIApplicationDelegate`
65+
/// You should synchronously call this method in `application:didFinishLaunchingWithOptions:` of your
66+
/// `UIApplicationDelegate`
6667
///
6768
/// - Note: This is the method that triggers the hooking or your Application to automatically handle some lifecycle
6869
/// events. If you run into issues, you can try moving this method before other SDK initializations, or call
6970
/// ``Batch/BatchPush/disableAutomaticIntegration`` before this method, and follow the "Manual Integration" advanced.
7071
/// - Parameters:
7172
/// - key: Your APP's API Key, LIVE or DEV. You can find it on your dashboard.
72-
+ (void)startWithAPIKey:(NSString *_Nonnull)key;
73+
+ (void)startWithAPIKey:(NSString *_Nonnull)key NS_SWIFT_UI_ACTOR;
7374

7475
/// Set if Batch should send its logs to a custom object of yours.
7576
///
@@ -84,7 +85,7 @@ typedef NS_OPTIONS(NSUInteger, BatchMigration) {
8485
/// implementation more easily. If you want to make it accessible in production, you should hide it in a hard to
8586
/// reproduce sequence.
8687
/// - Note: Should be presented modally.
87-
+ (UIViewController *_Nullable)makeDebugViewController;
88+
+ (UIViewController *_Nullable)makeDebugViewController NS_SWIFT_UI_ACTOR;
8889

8990
/// Toogle whether internal logs should be logged or not.
9091
///

Sources/Batch/BatchMessaging.h

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,21 @@
99
#import <Foundation/Foundation.h>
1010

1111
#import <Batch/BatchActions.h>
12+
#import <Batch/BatchMessagingCloseReason.h>
1213

1314
@class BatchInAppMessage, BatchMessage, BatchPushMessage, BatchMessageAction;
1415

16+
@protocol BatchInAppDelegate <NSObject>
17+
18+
@optional
19+
20+
/// Called when an In-App message should be presented to the user.
21+
///
22+
/// - Parameter message: In-App message to show.
23+
- (void)batchInAppMessageReady:(BatchInAppMessage *_Nonnull)message NS_SWIFT_NAME(batchInAppMessageReady(message:));
24+
25+
@end
26+
1527
/// Implement this protocol if you want to be notified of what happens to the messaging view (for example, perform some
1628
/// analytics on show/hide).
1729
@protocol BatchMessagingDelegate <NSObject>
@@ -23,18 +35,6 @@
2335
/// - Parameter messageIdentifier: Analytics message identifier string. Can be nil.
2436
- (void)batchMessageDidAppear:(NSString *_Nullable)messageIdentifier;
2537

26-
/// Called when the message view was dismissed by a user interaction (close button tap, swipe gesture...)
27-
///
28-
/// - Parameter messageIdentifier: Analytics message identifier string. Can be nil.
29-
- (void)batchMessageWasCancelledByUserAction:(NSString *_Nullable)messageIdentifier
30-
NS_SWIFT_NAME(batchMessageWasCancelledByUserAction(_:));
31-
32-
/// Called when the message view was dismissed automatically after the auto closing countdown.
33-
///
34-
/// - Parameter messageIdentifier: Analytics message identifier string. Can be nil.
35-
- (void)batchMessageWasCancelledByAutoclose:(NSString *_Nullable)messageIdentifier
36-
NS_SWIFT_NAME(batchMessageWasCancelledByAutoclose(_:));
37-
3838
/// Called when Batch needs to present a message in automatic mode.
3939
///
4040
/// Implement this method if you need to specify the view controller that will present Batch content.
@@ -52,41 +52,19 @@
5252
/// - action: Action that will be performed. Fields can be nil if the action was only to dismiss the message on tap.
5353
/// __DO NOT__ run the action yourself: the SDK will automatically do it.
5454
/// - identifier: Analytics message identifier string. Can be nil.
55-
/// - index: Index of the action/CTA. If the action comes from the "global tap action", the index
56-
/// will be ``BatchMessageGlobalActionIndex`` If the index is greater than or equal to zero,
55+
/// - ctaIdentifier: Identifier of the action/CTA. If the action comes from the "global tap action", the identifier
56+
/// will be ``BatchMessageGlobalActionIndex``,
5757
/// you can cast the action to ``BatchMessageCTA``
5858
- (void)batchMessageDidTriggerAction:(BatchMessageAction *_Nonnull)action
5959
messageIdentifier:(NSString *_Nullable)identifier
60-
actionIndex:(NSInteger)index;
60+
ctaIdentifier:(NSString *_Nonnull)ctaIdentifier;
6161

6262
/// Called when the message view disappeared from the screen.
6363
///
64-
/// - Parameter messageIdentifier: Analytics message identifier string. Can be nil.
65-
- (void)batchMessageDidDisappear:(NSString *_Nullable)messageIdentifier;
66-
67-
/// Called when an In-App message should be presented to the user.
68-
///
69-
/// - Parameter message: In-App message to show.
70-
- (void)batchInAppMessageReady:(nonnull BatchInAppMessage *)message NS_SWIFT_NAME(batchInAppMessageReady(message:));
71-
72-
/// Called when the message view was closed because of an error.
73-
///
74-
/// - Parameter messageIdentifier: Analytics message identifier string. Can be nil.
75-
- (void)batchMessageWasCancelledByError:(NSString *_Nullable)messageIdentifier
76-
NS_SWIFT_NAME(batchMessageWasCancelledByError(_:));
77-
78-
/// Called when the WebView message view will be dismissed due to the user navigating away or triggering an action
79-
/// (using the Javascript SDK).
80-
///
8164
/// - Parameters:
82-
/// - action: Action that will be performed. Fields can be nil if the action was only to dismiss the message on
83-
/// tap. __DO NOT__ run the action yourself: the SDK will automatically do it. Can be nil.
84-
/// - messageIdentifier: Analytics message identifier string. Can be nil.
85-
/// - analyticsIdentifier: Click analytic identifier. Matches the `analyticsID` parameter of the Javascript call,
86-
/// or the `batchAnalyticsID` query parameter of a link.
87-
- (void)batchWebViewMessageDidTriggerAction:(BatchMessageAction *_Nullable)action
88-
messageIdentifier:(NSString *_Nullable)messageIdentifier
89-
analyticsIdentifier:(NSString *_Nullable)analyticsIdentifier;
65+
/// - messageIdentifier: Analytics message identifier string. Can be nil.
66+
/// - reason: Enum for the different reasons why an In-App message can be closed
67+
- (void)batchMessageDidDisappear:(NSString *_Nullable)messageIdentifier reason:(BatchMessagingCloseReason)reason;
9068

9169
@end
9270

@@ -97,6 +75,9 @@
9775
/// handling In-App messages manually.
9876
@property (class, nullable) id<BatchMessagingDelegate> delegate;
9977

78+
/// Sets Batch's In-App delegate. The delegate is used for handling In-App messages manually
79+
@property (class, nullable) id<BatchInAppDelegate> inAppDelegate;
80+
10081
/// Toggles whether Batch should change the shared `AVAudioSession` configuration by itelf.
10182
///
10283
/// It is used to avoid stopping the user's music when displaying a video inapp,
@@ -107,7 +88,8 @@
10788
/// Default: true
10889
///
10990
/// In-App messaging is not affected by this. If you want to manually display the In-App message, call
110-
/// ``BatchMessaging/setDelegate:`` with a delegate that implement ``BatchMessagingDelegate/batchInAppMessageReady:``.
91+
/// ``BatchMessaging/setDelegate:`` with a delegate that implement
92+
/// ``BatchInAppDelegate/batchInAppMessageReady:``.
11193
/// - Note: If automatic mode is enabled, manual integration methods will not work.
11294
@property (class) BOOL automaticMode;
11395

0 commit comments

Comments
 (0)