Skip to content

Commit 9be8c73

Browse files
sunitaprajapati89Sunita Prajapati
andauthored
update: bumped Intercom version to 19.1.2 (#3)
Co-authored-by: Sunita Prajapati <sunita.kuamari@daffodilsw.com>
1 parent d2b4310 commit 9be8c73

5 files changed

Lines changed: 90 additions & 29 deletions

File tree

Example/BasicExample/BasicExample.xcodeproj/project.pbxproj

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
46EDC71327C6B8D200B870D7 /* BasicExampleUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46EDC71227C6B8D200B870D7 /* BasicExampleUITestsLaunchTests.swift */; };
1717
46EDC72127C6B92C00B870D7 /* Segment in Frameworks */ = {isa = PBXBuildFile; productRef = 46EDC72027C6B92C00B870D7 /* Segment */; };
1818
827C512828661FB5000B1B9E /* SegmentIntercom in Frameworks */ = {isa = PBXBuildFile; productRef = 827C512728661FB5000B1B9E /* SegmentIntercom */; };
19+
F6DAD32D2F90D3E9000AF673 /* Intercom in Frameworks */ = {isa = PBXBuildFile; productRef = F6DAD32C2F90D3E9000AF673 /* Intercom */; };
1920
/* End PBXBuildFile section */
2021

2122
/* Begin PBXContainerItemProxy section */
@@ -54,6 +55,7 @@
5455
buildActionMask = 2147483647;
5556
files = (
5657
46EDC72127C6B92C00B870D7 /* Segment in Frameworks */,
58+
F6DAD32D2F90D3E9000AF673 /* Intercom in Frameworks */,
5759
827C512828661FB5000B1B9E /* SegmentIntercom in Frameworks */,
5860
);
5961
runOnlyForDeploymentPostprocessing = 0;
@@ -153,11 +155,13 @@
153155
buildRules = (
154156
);
155157
dependencies = (
158+
F66C32C82F90D5760077958F /* PBXTargetDependency */,
156159
);
157160
name = BasicExample;
158161
packageProductDependencies = (
159162
46EDC72027C6B92C00B870D7 /* Segment */,
160163
827C512728661FB5000B1B9E /* SegmentIntercom */,
164+
F6DAD32C2F90D3E9000AF673 /* Intercom */,
161165
);
162166
productName = BasicExample;
163167
productReference = 46EDC6F227C6B8D100B870D7 /* BasicExample.app */;
@@ -207,7 +211,7 @@
207211
attributes = {
208212
BuildIndependentTargetsInParallel = 1;
209213
LastSwiftUpdateCheck = 1320;
210-
LastUpgradeCheck = 1320;
214+
LastUpgradeCheck = 1620;
211215
TargetAttributes = {
212216
46EDC6F127C6B8D100B870D7 = {
213217
CreatedOnToolsVersion = 13.2.1;
@@ -233,6 +237,7 @@
233237
mainGroup = 46EDC6E927C6B8D100B870D7;
234238
packageReferences = (
235239
46EDC71F27C6B92C00B870D7 /* XCRemoteSwiftPackageReference "analytics-swift" */,
240+
F6DAD32B2F90D293000AF673 /* XCRemoteSwiftPackageReference "intercom-ios-sp" */,
236241
);
237242
productRefGroup = 46EDC6F327C6B8D100B870D7 /* Products */;
238243
projectDirPath = "";
@@ -311,6 +316,10 @@
311316
target = 46EDC6F127C6B8D100B870D7 /* BasicExample */;
312317
targetProxy = 46EDC70D27C6B8D200B870D7 /* PBXContainerItemProxy */;
313318
};
319+
F66C32C82F90D5760077958F /* PBXTargetDependency */ = {
320+
isa = PBXTargetDependency;
321+
productRef = F66C32C72F90D5760077958F /* Intercom */;
322+
};
314323
/* End PBXTargetDependency section */
315324

316325
/* Begin XCBuildConfiguration section */
@@ -351,6 +360,7 @@
351360
DEBUG_INFORMATION_FORMAT = dwarf;
352361
ENABLE_STRICT_OBJC_MSGSEND = YES;
353362
ENABLE_TESTABILITY = YES;
363+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
354364
GCC_C_LANGUAGE_STANDARD = gnu11;
355365
GCC_DYNAMIC_NO_PIC = NO;
356366
GCC_NO_COMMON_BLOCKS = YES;
@@ -412,6 +422,7 @@
412422
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
413423
ENABLE_NS_ASSERTIONS = NO;
414424
ENABLE_STRICT_OBJC_MSGSEND = YES;
425+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
415426
GCC_C_LANGUAGE_STANDARD = gnu11;
416427
GCC_NO_COMMON_BLOCKS = YES;
417428
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -489,7 +500,6 @@
489500
46EDC71A27C6B8D200B870D7 /* Debug */ = {
490501
isa = XCBuildConfiguration;
491502
buildSettings = {
492-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
493503
BUNDLE_LOADER = "$(TEST_HOST)";
494504
CODE_SIGN_STYLE = Automatic;
495505
CURRENT_PROJECT_VERSION = 1;
@@ -508,7 +518,6 @@
508518
46EDC71B27C6B8D200B870D7 /* Release */ = {
509519
isa = XCBuildConfiguration;
510520
buildSettings = {
511-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
512521
BUNDLE_LOADER = "$(TEST_HOST)";
513522
CODE_SIGN_STYLE = Automatic;
514523
CURRENT_PROJECT_VERSION = 1;
@@ -527,7 +536,6 @@
527536
46EDC71D27C6B8D200B870D7 /* Debug */ = {
528537
isa = XCBuildConfiguration;
529538
buildSettings = {
530-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
531539
CODE_SIGN_STYLE = Automatic;
532540
CURRENT_PROJECT_VERSION = 1;
533541
GENERATE_INFOPLIST_FILE = YES;
@@ -544,7 +552,6 @@
544552
46EDC71E27C6B8D200B870D7 /* Release */ = {
545553
isa = XCBuildConfiguration;
546554
buildSettings = {
547-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
548555
CODE_SIGN_STYLE = Automatic;
549556
CURRENT_PROJECT_VERSION = 1;
550557
GENERATE_INFOPLIST_FILE = YES;
@@ -608,6 +615,14 @@
608615
kind = branch;
609616
};
610617
};
618+
F6DAD32B2F90D293000AF673 /* XCRemoteSwiftPackageReference "intercom-ios-sp" */ = {
619+
isa = XCRemoteSwiftPackageReference;
620+
repositoryURL = "https://github.com/intercom/intercom-ios-sp";
621+
requirement = {
622+
kind = exactVersion;
623+
version = 19.1.2;
624+
};
625+
};
611626
/* End XCRemoteSwiftPackageReference section */
612627

613628
/* Begin XCSwiftPackageProductDependency section */
@@ -620,6 +635,16 @@
620635
isa = XCSwiftPackageProductDependency;
621636
productName = SegmentIntercom;
622637
};
638+
F66C32C72F90D5760077958F /* Intercom */ = {
639+
isa = XCSwiftPackageProductDependency;
640+
package = F6DAD32B2F90D293000AF673 /* XCRemoteSwiftPackageReference "intercom-ios-sp" */;
641+
productName = Intercom;
642+
};
643+
F6DAD32C2F90D3E9000AF673 /* Intercom */ = {
644+
isa = XCSwiftPackageProductDependency;
645+
package = F6DAD32B2F90D293000AF673 /* XCRemoteSwiftPackageReference "intercom-ios-sp" */;
646+
productName = Intercom;
647+
};
623648
/* End XCSwiftPackageProductDependency section */
624649
};
625650
rootObject = 46EDC6EA27C6B8D100B870D7 /* Project object */;

Example/BasicExample/BasicExample.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 16 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.resolved

Lines changed: 17 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let package = Package(
77
name: "SegmentIntercom",
88
platforms: [
99
.macOS("10.15"),
10-
.iOS("13.0"),
10+
.iOS("15.0"),
1111
.tvOS("11.0"),
1212
.watchOS("7.1")
1313
],
@@ -27,8 +27,8 @@ let package = Package(
2727
),
2828
.package(
2929
name: "Intercom",
30-
url: "https://github.com/intercom/intercom-ios",
31-
from: "12.4.3"
30+
url: "https://github.com/intercom/intercom-ios-sp",
31+
from: "19.1.2"
3232
)
3333
],
3434
targets: [

Sources/SegmentIntercom/IntercomDestination.swift

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Created by Cody Garvin on 9/21/21.
22

33
import Segment
4-
import Intercom
54
import CoreMedia
5+
import Intercom
66

77
// Copyright (c) 2022 Twilio
88
//
@@ -54,9 +54,27 @@ public class IntercomDestination: DestinationPlugin {
5454
public func identify(event: IdentifyEvent) -> IdentifyEvent? {
5555

5656
if let userId = event.userId {
57-
Intercom.registerUser(withUserId: userId)
57+
let userAttributes = ICMUserAttributes()
58+
userAttributes.userId = userId
59+
Intercom.loginUser(with: userAttributes) { result in
60+
switch result {
61+
case .success:
62+
print("Logged in")
63+
case .failure(let error):
64+
print("Failed: \(error.localizedDescription)")
65+
}
66+
}
67+
5868
} else if let _ = event.anonymousId {
59-
Intercom.registerUnidentifiedUser()
69+
70+
Intercom.loginUnidentifiedUser { result in
71+
switch result {
72+
case .success:
73+
print("Logged in anonymously")
74+
case .failure(let error):
75+
print("Failed: \(error.localizedDescription)")
76+
}
77+
}
6078
}
6179

6280
if let integration = event.integrations?.dictionaryValue?["Intercom"] as? [AnyHashable: Any],
@@ -126,8 +144,8 @@ public class IntercomDestination: DestinationPlugin {
126144

127145
let userAttributes = ICMUserAttributes()
128146
userAttributes.companies = [company]
129-
130-
Intercom.updateUser(userAttributes)
147+
148+
Intercom.updateUser(with: userAttributes)
131149

132150
return event
133151
}
@@ -200,7 +218,7 @@ private extension IntercomDestination {
200218
}
201219

202220
userAttributes.customAttributes = customAttributes
203-
Intercom.updateUser(userAttributes)
221+
Intercom.updateUser(with: userAttributes)
204222
}
205223

206224
func setCompanyAttributes(_ company: [String: Any]) -> ICMCompany {

0 commit comments

Comments
 (0)