Skip to content

Commit

Permalink
dev -> main (v3.1.0) (#102)
Browse files Browse the repository at this point in the history
* Added support for returning analytics payload and response tokens in TargetRequest callback. (#100)

* Added support for returning analytics payload and response tokens in TargetRequest callback.

* Fixed linting/ formatting issues

* swift format fix for redundant parenthesis

* minor doc fixes and test update

* Implemented feedback

* Prepare for release + other updates (#101)

* Prepare for release + codecov fixes

* script fixes

* updated config.yml

* Doc updates + minor fix (#103)

* Doc updates + minor fix

* minor feedback fix
  • Loading branch information
swarna04 authored Aug 5, 2021
1 parent 72e2ef7 commit 3147a05
Show file tree
Hide file tree
Showing 39 changed files with 1,728 additions and 457 deletions.
18 changes: 13 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ jobs:
# restore pods related caches
- restore_cache:
keys:
- cocoapods-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Podfile.lock" }}
- cocoapods-cache-v1-{{ arch }}-{{ .Branch }}
- cocoapods-cache-v1
- cocoapods-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "Podfile.lock" }}
- cocoapods-cache-v5-{{ arch }}-{{ .Branch }}
- cocoapods-cache-v5

# install CocoaPods - using default CocoaPods version, not the bundle
- run:
Expand All @@ -47,7 +47,7 @@ jobs:
# save pods related files
- save_cache:
name: Saving CocoaPods Cache
key: cocoapods-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Podfile.lock" }}
key: cocoapods-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "Podfile.lock" }}
paths:
- ./Pods
- ~/.cocoapods
Expand Down Expand Up @@ -76,4 +76,12 @@ jobs:
# code coverage
- run:
name: Upload Code Coverage Report
command: bash <(curl -s https://codecov.io/bash) -v -X s3 -c -D "./build/out" -J "AEPTarget"
command: make codecov

# verify XCFramework archive builds
- run:
name: Build XCFramework
command: |
if [ "${CIRCLE_BRANCH}" == "main" ]; then
make archive
fi
20 changes: 15 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ on:
default: '3.0.0'

action_tag:
description: 'create tag ("no" to skip)'
description: 'create tag? ("no" to skip)'
required: true
default: 'yes'

release_AEPTarget:
description: 'release AEPTarget Pod? ("no" to skip)'
required: true
default: 'yes'

Expand All @@ -24,6 +29,9 @@ jobs:
- name: Install jq
run: brew install jq

- name: Install cocoapods
run: gem install cocoapods

- name: Check version in Podspec
run: |
set -eo pipefail
Expand All @@ -40,13 +48,16 @@ jobs:
set -eo pipefail
echo SPM integration test starts:
make test-SPM-integration
- name: podspec file verification
if: ${{ github.event.inputs.action_tag == 'yes' }}
run: |
set -eo pipefail
echo podspec file verification starts:
make test-podspec
- uses: release-drafter/release-drafter@v5
#https://github.com/release-drafter/release-drafter/commit/fe52e97d262833ae07d05efaf1a239df3f1b5cd4
- uses: release-drafter/release-drafter@fe52e97d262833ae07d05efaf1a239df3f1b5cd4
if: ${{ github.event.inputs.action_tag == 'yes' }}
with:
name: v${{ github.event.inputs.tag }}
Expand All @@ -56,11 +67,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Pods
- name: Publish Pods - AEPTarget
if: ${{ github.event.inputs.release_AEPTarget == 'yes' }}
run: |
set -eo pipefail
gem install cocoapods
pod lib lint AEPTarget.podspec --allow-warnings --swift-version=5.1
pod trunk push AEPTarget.podspec --allow-warnings --swift-version=5.1
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
2 changes: 1 addition & 1 deletion AEPTarget.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPTarget"
s.version = "3.0.0"
s.version = "3.1.0"
s.summary = "Experience Platform Target extension for Adobe Experience Platform Mobile SDK. Written and maintained by Adobe."
s.description = <<-DESC
The Experience Platform Target extension provides APIs that allow use of the Target product in the Adobe Experience Platform SDK.
Expand Down
4 changes: 2 additions & 2 deletions AEPTarget.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.0.0;
MARKETING_VERSION = 3.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.target;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1190,7 +1190,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.0.0;
MARKETING_VERSION = 3.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.adobe.aep.target;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
23 changes: 18 additions & 5 deletions AEPTarget/Sources/Target+PublicAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import Foundation

@objc public extension Target {
/// true if the response content event listener is already registered, false otherwise
private static var isResponseListenerRegister: Bool = false
#if DEBUG
static var isResponseListenerRegister: Bool = false
#else
private static var isResponseListenerRegister: Bool = false
#endif

/// `Dictionary` to keep track of pending target request
@nonobjc
private static var pendingTargetRequest: ThreadSafeDictionary<String, TargetRequest> = ThreadSafeDictionary()
Expand Down Expand Up @@ -96,6 +101,8 @@ import Foundation
// If the callback is present call with default content
if let callback = request.contentCallback {
callback(request.defaultContent)
} else if let callback = request.contentWithDataCallback {
callback(request.defaultContent, nil)
}
Log.debug(label: Target.LOG_TAG, "TargetRequest removed because mboxName is empty.")
continue
Expand Down Expand Up @@ -290,7 +297,7 @@ import Foundation

/// Handles the response event with event name as `TargetConstants.EventName.TARGET_REQUEST_RESPONSE`
/// - Parameters:
/// - event: Response content event with content
/// - event: Response content event with content and optional data payload
private static func handleResponseEvent(_ event: Event) {
if event.name != TargetConstants.EventName.TARGET_REQUEST_RESPONSE {
return
Expand All @@ -311,11 +318,17 @@ import Foundation
return
}

guard let callback = targetRequest.contentCallback else {
if let callback = targetRequest.contentCallback {
let content = event.data?[TargetConstants.EventDataKeys.TARGET_CONTENT] as? String ?? targetRequest.defaultContent
callback(content)
} else if let callback = targetRequest.contentWithDataCallback {
let content = event.data?[TargetConstants.EventDataKeys.TARGET_CONTENT] as? String ?? targetRequest.defaultContent
let responsePayload = event.data?[TargetConstants.EventDataKeys.TARGET_DATA_PAYLOAD] as? [String: Any]

callback(content, responsePayload)
} else {
Log.warning(label: LOG_TAG, "Missing callback for target request with pair id the \(responsePairId)")
return
}
let content = event.data?[TargetConstants.EventDataKeys.TARGET_CONTENT] as? String ?? targetRequest.defaultContent
callback(content)
}
}
Loading

0 comments on commit 3147a05

Please sign in to comment.