diff --git a/AEPMessaging/Sources/MessagingEdgeEventType.swift b/AEPMessaging/Sources/MessagingEdgeEventType.swift index 3ae76a14..c2e42cd9 100644 --- a/AEPMessaging/Sources/MessagingEdgeEventType.swift +++ b/AEPMessaging/Sources/MessagingEdgeEventType.swift @@ -15,14 +15,6 @@ import Foundation /// Provides mapping to XDM EventType strings needed for Experience Event requests @objc(AEPMessagingEdgeEventType) public enum MessagingEdgeEventType: Int { - @available(*, deprecated, message: "Use 'dismiss' instead.") - case inappDismiss = 0 - @available(*, deprecated, message: "Use 'interact' instead.") - case inappInteract = 1 - @available(*, deprecated, message: "Use 'trigger' instead.") - case inappTrigger = 2 - @available(*, deprecated, message: "Use 'display' instead.") - case inappDisplay = 3 case pushApplicationOpened = 4 case pushCustomAction = 5 case dismiss = 6 @@ -32,13 +24,13 @@ public enum MessagingEdgeEventType: Int { public func toString() -> String { switch self { - case .inappDismiss, .dismiss: + case .dismiss: return MessagingConstants.XDM.Inbound.EventType.DISMISS - case .inappTrigger, .trigger: + case .trigger: return MessagingConstants.XDM.Inbound.EventType.TRIGGER - case .inappInteract, .interact: + case .interact: return MessagingConstants.XDM.Inbound.EventType.INTERACT - case .inappDisplay, .display: + case .display: return MessagingConstants.XDM.Inbound.EventType.DISPLAY case .pushCustomAction: return MessagingConstants.XDM.Push.EventType.CUSTOM_ACTION @@ -73,13 +65,13 @@ extension MessagingEdgeEventType { /// Used to generate `propositionEventType` payload in outgoing proposition interaction events var propositionEventType: String { switch self { - case .inappDismiss, .dismiss: + case .dismiss: return MessagingConstants.XDM.Inbound.PropositionEventType.DISMISS - case .inappInteract, .interact: + case .interact: return MessagingConstants.XDM.Inbound.PropositionEventType.INTERACT - case .inappTrigger, .trigger: + case .trigger: return MessagingConstants.XDM.Inbound.PropositionEventType.TRIGGER - case .inappDisplay, .display: + case .display: return MessagingConstants.XDM.Inbound.PropositionEventType.DISPLAY case .pushApplicationOpened, .pushCustomAction: return "" diff --git a/AEPMessaging/Tests/FunctionalTests/InAppMessagingEventTests.swift b/AEPMessaging/Tests/FunctionalTests/InAppMessagingEventTests.swift index acc62b0a..c7a4e71f 100644 --- a/AEPMessaging/Tests/FunctionalTests/InAppMessagingEventTests.swift +++ b/AEPMessaging/Tests/FunctionalTests/InAppMessagingEventTests.swift @@ -243,7 +243,7 @@ class InAppMessagingEventTests: XCTestCase, AnyCodableAsserts { extension InAppMessagingEventTests: MessagingDelegate { func onShow(message: Showable) { - currentMessage?.track("clicked", withEdgeEventType: .inappInteract) + currentMessage?.track("clicked", withEdgeEventType: .interact) } func onDismiss(message: Showable) { diff --git a/AEPMessaging/Tests/UnitTests/MessagingEdgeEventTypeTests.swift b/AEPMessaging/Tests/UnitTests/MessagingEdgeEventTypeTests.swift index 3847deed..b84b0499 100644 --- a/AEPMessaging/Tests/UnitTests/MessagingEdgeEventTypeTests.swift +++ b/AEPMessaging/Tests/UnitTests/MessagingEdgeEventTypeTests.swift @@ -50,42 +50,6 @@ class MessagingEdgeEventTypeTests: XCTestCase { XCTAssertEqual(value, .display) XCTAssertEqual("decisioning.propositionDisplay", value?.toString()) } - - func testInAppDismiss_Deprecated() throws { - // setup - let value = MessagingEdgeEventType(rawValue: 0) - - // verify - XCTAssertEqual(value, .inappDismiss) - XCTAssertEqual("decisioning.propositionDismiss", value?.toString()) - } - - func testInAppInteract_Deprecated() throws { - // setup - let value = MessagingEdgeEventType(rawValue: 1) - - // verify - XCTAssertEqual(value, .inappInteract) - XCTAssertEqual("decisioning.propositionInteract", value?.toString()) - } - - func testInAppTrigger_Deprecated() throws { - // setup - let value = MessagingEdgeEventType(rawValue: 2) - - // verify - XCTAssertEqual(value, .inappTrigger) - XCTAssertEqual("decisioning.propositionTrigger", value?.toString()) - } - - func testInAppDisplay_Deprecated() throws { - // setup - let value = MessagingEdgeEventType(rawValue: 3) - - // verify - XCTAssertEqual(value, .inappDisplay) - XCTAssertEqual("decisioning.propositionDisplay", value?.toString()) - } func testPushApplicationOpened() throws { // setup @@ -177,22 +141,6 @@ class MessagingEdgeEventTypeTests: XCTestCase { XCTAssertEqual("trigger", MessagingEdgeEventType.trigger.propositionEventType) } - func testPropEventTypeDismiss_Deprecated() throws { - XCTAssertEqual("dismiss", MessagingEdgeEventType.inappDismiss.propositionEventType) - } - - func testPropEventTypeDisplay_Deprecated() throws { - XCTAssertEqual("display", MessagingEdgeEventType.inappDisplay.propositionEventType) - } - - func testPropEventTypeInteract_Deprecated() throws { - XCTAssertEqual("interact", MessagingEdgeEventType.inappInteract.propositionEventType) - } - - func testPropEventTypeTrigger_Deprecated() throws { - XCTAssertEqual("trigger", MessagingEdgeEventType.inappTrigger.propositionEventType) - } - func testPropEventTypePushCases() throws { XCTAssertEqual("", MessagingEdgeEventType.pushCustomAction.propositionEventType) XCTAssertEqual("", MessagingEdgeEventType.pushApplicationOpened.propositionEventType) diff --git a/Documentation/README.md b/Documentation/README.md index fe92269b..e9f14995 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -2,10 +2,8 @@ ### Prerequisites -- Code-based Experiences (Beta) - - [Getting started](./sources/exd-cbe-beta/getting-started.md) - - [APIs usage](./sources/exd-cbe-beta/apis-usage.md) - - [Test app setup](./sources/exd-cbe-beta/testapp-setup.md) +- Code-based Experiences + - [APIs usage](./sources/exd-cbe-beta/apis-usage.md) - Push Messaging - [Enable push notifications in your app](./sources/prerequisite/enable-push-notifications.md) - Push and In-app Messaging diff --git a/Documentation/sources/exd-cbe-beta/getting-started.md b/Documentation/sources/exd-cbe-beta/getting-started.md deleted file mode 100644 index 8df5d276..00000000 --- a/Documentation/sources/exd-cbe-beta/getting-started.md +++ /dev/null @@ -1,88 +0,0 @@ -# Getting started with AEPMessaging SDK - -### [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) - -```ruby -# Podfile -use_frameworks! - -# for app development, include all the following pods -target 'YOUR_TARGET_NAME' do - pod 'AEPMessaging', :git => 'https://github.com/adobe/aepsdk-messaging-ios.git', :branch => 'exd-cbe-beta' - pod 'AEPEdge' - pod 'AEPCore' -end -``` - -Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type: - -```ruby -$ pod install -``` - -### [Swift Package Manager](https://github.com/apple/swift-package-manager) - -To add the AEPMessaging Package to your application, from the Xcode 15 menu select: - -`File > Add Package Dependencies...` - -> **Note**: the menu options may vary depending on the version of Xcode being used. - -Enter the URL for the AEPMessaging package repository: `https://github.com/adobe/aepsdk-messaging-ios.git`. - -For `Dependency Rule`, select `Branch`. - -Alternatively, if your project has a `Package.swift` file, you can add AEPMessaging directly to your dependencies: - -``` -dependencies: [ - .package(url: "https://github.com/adobe/aepsdk-messaging-ios.git", .branch("exd-cbe-beta")) -], -targets: [ - .target(name: "YourTarget", - dependencies: ["AEPMessaging"], - path: "your/path") -] -``` - -### Binaries - -Select `exd-cbe-beta` branch and clone the repository (or download ZIP). To generate `AEPMessaging.xcframework`, run the following command from the root directory: - -``` -make archive -``` - -This will generate an XCFramework under the `build` folder. Drag and drop `AEPMessaging.xcframework` to your app target. - -### Import and register the Messaging extension - -Import the AEPMessaging framework and its dependencies, then register the Messaging extension and dependencies in the `application(_: didFinishLaunchingWithOptions:)` method in the `AppDelegate`: - -```swift -import AEPMessaging -import AEPCore -import AEPEdge -import AEPEdgeIdentity - -class AppDelegate: UIResponder, UIApplicationDelegate { - func application(_ application: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // optionally enable debug logging - MobileCore.setLogLevel(.trace) - - // create a list of extensions that will be registered - let extensions = [ - Messaging.self, - Identity.self, - Edge.self - ] - - MobileCore.registerExtensions(extensions) { - // use the Environment file ID assigned for this application from Adobe Data Collection (formerly Adobe Launch) - MobileCore.configureWith(appId: "") - } - - return true - } -} -``` \ No newline at end of file diff --git a/Documentation/sources/exd-cbe-beta/testapp-setup.md b/Documentation/sources/exd-cbe-beta/testapp-setup.md deleted file mode 100644 index 9e1227fc..00000000 --- a/Documentation/sources/exd-cbe-beta/testapp-setup.md +++ /dev/null @@ -1,21 +0,0 @@ -# Test app setup - -## Setup - -Please follow the below setup steps for iOS apps: - -1. Install Xcode - https://developer.apple.com/xcode/ -2. Get the Messaging SwiftUI test app from the GitHub repository - https://github.com/adobe/aepsdk-messaging-ios by following one of the below options. - - Option 1: Clone the code from https://github.com/adobe/aepsdk-messaging-ios.git. Checkout `exd-cbe-beta` branch. - ![Clone the repository](../../assets/clone-the-repo.png) - - Option 2: Select the `exd-cbe-beta` branch and download the code ZIP file. - ![Download the ZIP](../../assets/download-zip.png) -3. Open the root directory, run `make open` command to open the Messaging workspace file in Xcode. -4. Configure the app for the following: - - Set the `ENVIRONMENT_FILE_ID` value in MessagingDemoAppSwiftUIApp.swift (located in TestApps/MessagingDemoAppSwiftUI directory) for the appropriate environment. - ![Configure Environment file ID](../../assets/configure-environment-file-id.png) - - Modify the surface path in CodeBasedOffersView.swift (located in TestApps/MessagingDemoAppSwiftUI directory). - ![Configure surface path](../../assets/configure-surface-path.png) -5. Select the build scheme `MessagingDemoAppSwiftUI` for the app target and select the preferred simulator, then run the app. -![Run app](../../assets/run-app.png) -6. In the testapp, select the `Code Experiences` tab from the tab bar. You should see the Code-based experiences for your configured surface (mobileapp://com.adobe.MessagingDemoApp/). \ No newline at end of file diff --git a/Podfile b/Podfile index b14bde7f..999c658b 100644 --- a/Podfile +++ b/Podfile @@ -36,7 +36,7 @@ def app_main pod 'AEPEdge' pod 'AEPEdgeIdentity' pod 'AEPEdgeConsent' - pod 'AEPAssurance', :git => 'https://github.com/adobe/aepsdk-assurance-ios.git', :branch => 'staging' + pod 'AEPAssurance' end def app_dev @@ -50,6 +50,10 @@ def app_dev pod 'AEPAssurance', :git => 'https://github.com/adobe/aepsdk-assurance-ios.git', :branch => 'staging' end +def test_utils + pod 'AEPTestUtils', :git => 'https://github.com/adobe/aepsdk-testutils-ios.git', :tag => '5.0.0' +end + # ================== # TARGET DEFINITIONS # ================== @@ -72,25 +76,25 @@ end target 'UnitTests' do lib_main - pod 'AEPTestUtils', :git => 'https://github.com/adobe/aepsdk-testutils-ios.git', :tag => '5.0.0' + test_utils end target 'FunctionalTests' do app_main - pod 'AEPTestUtils', :git => 'https://github.com/adobe/aepsdk-testutils-ios.git', :tag => '5.0.0' + test_utils end target 'E2EFunctionalTests' do app_main - pod 'AEPTestUtils', :git => 'https://github.com/adobe/aepsdk-testutils-ios.git', :tag => '5.0.0' + test_utils end target 'FunctionalTestApp' do app_main - pod 'AEPTestUtils', :git => 'https://github.com/adobe/aepsdk-testutils-ios.git', :tag => '5.0.0' + test_utils end target 'E2EFunctionalTestApp' do app_main - pod 'AEPTestUtils', :git => 'https://github.com/adobe/aepsdk-testutils-ios.git', :tag => '5.0.0' + test_utils end diff --git a/Podfile.lock b/Podfile.lock index 78d90996..12640afd 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -25,7 +25,7 @@ PODS: - SwiftLint (0.52.0) DEPENDENCIES: - - AEPAssurance (from `https://github.com/adobe/aepsdk-assurance-ios.git`, branch `staging`) + - AEPAssurance - AEPCore - AEPEdge - AEPEdgeConsent @@ -39,6 +39,7 @@ DEPENDENCIES: SPEC REPOS: trunk: + - AEPAssurance - AEPCore - AEPEdge - AEPEdgeConsent @@ -50,17 +51,11 @@ SPEC REPOS: - SwiftLint EXTERNAL SOURCES: - AEPAssurance: - :branch: staging - :git: https://github.com/adobe/aepsdk-assurance-ios.git AEPTestUtils: :git: https://github.com/adobe/aepsdk-testutils-ios.git :tag: 5.0.0 CHECKOUT OPTIONS: - AEPAssurance: - :commit: ba663aa783d14c039626af88f3159fb47f3bae4a - :git: https://github.com/adobe/aepsdk-assurance-ios.git AEPTestUtils: :git: https://github.com/adobe/aepsdk-testutils-ios.git :tag: 5.0.0 @@ -78,6 +73,6 @@ SPEC CHECKSUMS: AEPTestUtils: 20495b368da57904ca2e9f241d1d8b114f9887b5 SwiftLint: 13280e21cdda6786ad908dc6e416afe5acd1fcb7 -PODFILE CHECKSUM: 9f1f3ac6017df6b5467fecddd383dea2045b102c +PODFILE CHECKSUM: 3d7e4dc0e436ffe270cfe06e63fbe8b0564df0e3 COCOAPODS: 1.14.3 diff --git a/README.md b/README.md index 8a8be569..08e1e21d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,10 @@ -# Adobe Experience Platform - Messaging extension for iOS (Beta feature - Experience Decisioning in Code Based Experiences) +# Adobe Experience Platform - Messaging extension for iOS [![Cocoapods](https://img.shields.io/github/v/release/adobe/aepsdk-messaging-ios?label=CocoaPods&logo=apple&logoColor=white&color=orange&sort=semver)](https://cocoapods.org/pods/AEPMessaging) [![SPM](https://img.shields.io/github/v/release/adobe/aepsdk-messaging-ios?label=SPM&logo=apple&logoColor=white&color=orange&sort=semver)](https://github.com/adobe/aepsdk-messaging-ios/releases) [![CircleCI](https://img.shields.io/circleci/project/github/adobe/aepsdk-messaging-ios/main.svg?logo=circleci&label=Build)](https://circleci.com/gh/adobe/workflows/aepsdk-messaging-ios) -## Beta feature acknowledgment - -By using the AEPMessaging SDK (“Beta feature”), you hereby acknowledge that the Beta is provided “as is” without warranty of any kind. Adobe shall have no obligation to maintain, correct, update, change, modify or otherwise support the Beta. You are advised to use caution and not to rely in any way on the correct functioning or performance of such Beta and/or accompanying materials. - ## About this project Adobe Experience Platform (AEP) Messaging Extension is an extension for the [Adobe Experience Platform Swift SDK](https://github.com/adobe/aepsdk-core-ios). diff --git a/TestApps/MessagingDemoApp/AppDelegate.swift b/TestApps/MessagingDemoApp/AppDelegate.swift index 1b9eddbf..41727204 100644 --- a/TestApps/MessagingDemoApp/AppDelegate.swift +++ b/TestApps/MessagingDemoApp/AppDelegate.swift @@ -49,10 +49,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD // configure MobileCore.configureWith(appId: "") // set `messaging.useSandbox` to "true" to test push notifications in debug environment (Apps signed with Development Certificate) - #if DEBUG - let debugConfig = ["messaging.useSandbox": true] - MobileCore.updateConfigurationWith(configDict: debugConfig) - #endif +// #if DEBUG +// let debugConfig = ["messaging.useSandbox": true] +// MobileCore.updateConfigurationWith(configDict: debugConfig) +// #endif } registerForPushNotifications(application) diff --git a/TestApps/MessagingDemoApp/ViewController.swift b/TestApps/MessagingDemoApp/ViewController.swift index 30cf8f09..edf54ca6 100644 --- a/TestApps/MessagingDemoApp/ViewController.swift +++ b/TestApps/MessagingDemoApp/ViewController.swift @@ -30,11 +30,13 @@ class ViewController: UIViewController { } @IBAction func triggerFullscreen(_: Any) { - MobileCore.track(action: "fullscreen", data: ["testFullscreen": "true"]) + MobileCore.track(action: "once", data: nil) +// MobileCore.track(action: "fullscreen", data: ["testFullscreen": "true"]) } @IBAction func triggerModal(_: Any) { - MobileCore.track(action: "triggerModal", data: ["testModal": "true"]) + MobileCore.track(action: "migrate", data: nil) +// MobileCore.track(action: "triggerModal", data: ["testModal": "true"]) } @IBAction func triggerBannerTop(_: Any) { @@ -71,7 +73,7 @@ class ViewController: UIViewController { // see Assets/nativeMethodCallingSample.html for an example of how to call this method message?.handleJavascriptMessage("buttonClicked") { content in print("magical handling of our content from js! content is: \(content ?? "empty")") - message?.track(content as? String, withEdgeEventType: .inappInteract) + message?.track(content as? String, withEdgeEventType: .interact) } // if using the webview for something, make sure to dispatch back to the main thread @@ -92,12 +94,12 @@ class ViewController: UIViewController { // if we're not showing the message now, we can save it for later if !showMessages { currentMessage = message - currentMessage?.track("message suppressed", withEdgeEventType: .inappTrigger) + currentMessage?.track("message suppressed", withEdgeEventType: .trigger) } else if autoDismiss { currentMessage = message let _ = Timer.scheduledTimer(withTimeInterval: 5.0, repeats: false) { timer in timer.invalidate() - self.currentMessage?.track("test for reporting", withEdgeEventType: .inappInteract) + self.currentMessage?.track("test for reporting", withEdgeEventType: .interact) self.currentMessage?.dismiss() } } diff --git a/TestApps/MessagingDemoAppSwiftUI/MessagingDemoAppSwiftUIApp.swift b/TestApps/MessagingDemoAppSwiftUI/MessagingDemoAppSwiftUIApp.swift index 3ecb096f..e14ec114 100644 --- a/TestApps/MessagingDemoAppSwiftUI/MessagingDemoAppSwiftUIApp.swift +++ b/TestApps/MessagingDemoAppSwiftUI/MessagingDemoAppSwiftUIApp.swift @@ -21,13 +21,8 @@ import AEPMessaging import SwiftUI final class AppDelegate: NSObject, UIApplicationDelegate { - // change bundle id to com.steveb.iamStagingTester to work on staging - // stage -// private let ENVIRONMENT_FILE_ID = "staging/1b50a869c4a2/bcd1a623883f/launch-e44d085fc760-development" - // change bundle id to com.adobe.MessagingDemoAppSwiftUI to work on prod - // prod - private let ENVIRONMENT_FILE_ID = "3149c49c3910/b6541e5e6301/launch-f7ac0a320fb3-development" + private let ENVIRONMENT_FILE_ID = "" func application(_ application: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { MobileCore.setLogLevel(.trace)