Skip to content

Commit

Permalink
Merge pull request #27 from ust-rajanmarathe/SDKF-2494
Browse files Browse the repository at this point in the history
SDKF-2494 and SDKF-2495: Added more validation for deviceId and MonetateId
  • Loading branch information
Sai-Singamsetty authored Jan 14, 2025
2 parents 29790c8 + 60f94d8 commit 8b9e515
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 25 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion config/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2025.01.02</string>
<string>2025.01.10</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
141 changes: 121 additions & 20 deletions monetate-ios-sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,131 @@
#

Pod::Spec.new do |s|

# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# These will help people to find your library, and whilst it
# can feel like a chore to fill in it's definitely to your advantage. The
# summary should be tweet-length, and the description more in depth.
#

s.name = "monetate-ios-sdk"
s.version = "2025.01.02"
s.version = "2025.01.10"
s.summary = "Provides convenient access to the Engine API"

# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = "Monetate Personalization, powered by Monetate and Certona, is the leading personalization software, recognized by key industry analysts.
From sophisticated A/B testing to AI-driven personalization, harness patented technology to delight your customers with impactful individualized experiences, resulting in increased engagement, conversions, and lifetime value.
Join the 1,000+ brands growing their revenue with Monetate"

s.homepage = "https://www.monetate.com"
s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "Monetate" => "[email protected]" }

s.platform = :ios
s.ios.deployment_target = "12.0"

s.source = {
:git => "https://github.com/monetate/monetate-personalization-ios-sdk-cocoapod.git",
:tag => s.version.to_s
}

s.source_files = "monetate/**/*"
s.swift_version = "5.0"

# Private pod specific configurations
s.static_framework = true
# s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"


# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Licensing your code is important. See http://choosealicense.com for more info.
# CocoaPods will detect a license file if there is a named LICENSE*
# Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
#

s.license = "MIT"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }


# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the authors of the library, with email addresses. Email addresses
# of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
# accepts just a name if you'd rather not provide an email address.
#
# Specify a social_media_url where others can refer to, for example a twitter
# profile URL.
#

s.author = "Monetate"
# Or just: s.author = "DJ DeFiccio"
# s.authors = { "DJ DeFiccio" => "[email protected]" }
# s.social_media_url = "http://twitter.com/DJ DeFiccio"

# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# If this Pod runs only on iOS or OS X, then specify the platform and
# the deployment target. You can optionally include the target after the platform.
#

s.swift_version = '5.0'
s.platform = :ios, "12"

# When using multiple platforms
# s.ios.deployment_target = "5.0"
# s.osx.deployment_target = "10.7"
# s.watchos.deployment_target = "2.0"
# s.tvos.deployment_target = "9.0"


# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the location from where the source should be retrieved.
# Supports git, hg, bzr, svn and HTTP.
#

s.source = { :git => "https://github.com/monetate/monetate-personalization-ios-sdk-cocoapod.git", :tag => "2025.01.10" }


# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# CocoaPods is smart about how it includes source code. For source files
# giving a folder will include any swift, h, m, mm, c & cpp files.
# For header files it will include any header in the folder.
# Not including the public_header_files will make all headers public.
#

s.source_files = "monetate/**/*"

# s.public_header_files = "Classes/**/*.h"


# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# A list of resources included with the Pod. These are copied into the
# target bundle with a build phase script. Anything else will be cleaned.
# You can preserve files from being cleaned, please don't preserve
# non-essential files like tests, examples and documentation.
#

# s.resource = "icon.png"
# s.resources = "Resources/*.png"

# s.preserve_paths = "FilesToSave", "MoreFilesToSave"


# ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Link your library with frameworks, or libraries. Libraries do not include
# the lib prefix of their name.
#

s.framework = "UIKit"
# s.frameworks = "SomeFramework", "AnotherFramework"

# s.library = "iconv"
# s.libraries = "iconv", "xml2"


# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# If your library depends on compiler flags you can set them in the xcconfig hash
# where they will only apply to your library. If you depend on other Podspecs
# you can include multiple dependencies to ensure it works.

s.requires_arc = true

end

# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
# s.dependency "JSONKit", "~> 1.4"

end
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "4F6C3155-41A6-42B9-9BA5-721D40FF0679"
type = "1"
version = "2.0">
</Bucket>
2 changes: 1 addition & 1 deletion monetate-ios-sdkTests/GetActionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class GetActionTests: XCTestCase {
let requestid = "123456"
final var personalization = Personalization(
account: Account(instance: "p", domain: "localhost.org", name: "a-701b337c", shortname: "localhost"),
user: User(deviceId: "62bd2e2d-213d-463f-83bb-12c0b2530a14")
user: User(monetateId: "2.1349157357.1736226061396", deviceId: "62bd2e2d-213d-463f-83bb-12c0b2530a14", customerId: "iehiurhgir")
)

override func setUp() {
Expand Down
2 changes: 1 addition & 1 deletion monetate-ios-sdkTests/ReportTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PersonalizationTests: XCTestCase {

final var personalization = Personalization(
account: Account(instance: "p", domain: "localhost.org", name: "a-701b337c", shortname: "localhost"),
user: User(deviceId: "62bd2e2d-213d-463f-83bb-12c0b2530a14")
user: User(monetateId: "2.1349157357.1736226061396", deviceId: "62bd2e2d-213d-463f-83bb-12c0b2530a14")
)

override func setUp() {
Expand Down
4 changes: 2 additions & 2 deletions monetate/core/Personalization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ public class Personalization {
"channel":account.getChannel(),
"sdkVersion": account.getSDKVersion(),
"events": Utility.createEventBody(queue: self.queue)]
if let val = self.user.monetateId { body["monetateId"] = val }
if let val = self.user.deviceId { body["deviceId"] = val }

if let val = self.user.deviceId { body["deviceId"] = val } else if let val = self.user.monetateId { body["monetateId"] = val }
if let val = self.user.customerId { body["customerId"] = val }
Log.debug("success - \(body.toString!)")

Expand Down

0 comments on commit 8b9e515

Please sign in to comment.