Skip to content

Commit 84d9f0a

Browse files
authored
Update Sample Apps (#396)
- Sample apps now include usage examples of our new Help Center APIs Co-authored-by: Brian Boyle <>
1 parent 573f96e commit 84d9f0a

File tree

8 files changed

+222
-73
lines changed

8 files changed

+222
-73
lines changed

Examples/Sample-ObjC/Sample-ObjC.xcodeproj/project.pbxproj

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 52;
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
AD5AAA2A1D92A70F00557FDA /* Intercom.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD5AAA291D92A70F00557FDA /* Intercom.framework */; };
11-
AD5AAA2B1D92A70F00557FDA /* Intercom.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AD5AAA291D92A70F00557FDA /* Intercom.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
10+
197ACDC126736AE10024C38C /* Intercom.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 197ACDC026736AE10024C38C /* Intercom.xcframework */; };
1211
ADEBAAA81D3F6D2A0016C6EC /* ITCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ADEBAAA11D3F6D2A0016C6EC /* ITCAppDelegate.m */; };
1312
ADEBAAA91D3F6D2A0016C6EC /* ITCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ADEBAAA31D3F6D2A0016C6EC /* ITCViewController.m */; };
1413
ADEBAAAA1D3F6D2A0016C6EC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ADEBAAA41D3F6D2A0016C6EC /* main.m */; };
@@ -24,16 +23,15 @@
2423
dstPath = "";
2524
dstSubfolderSpec = 10;
2625
files = (
27-
AD5AAA2B1D92A70F00557FDA /* Intercom.framework in Embed Frameworks */,
2826
);
2927
name = "Embed Frameworks";
3028
runOnlyForDeploymentPostprocessing = 0;
3129
};
3230
/* End PBXCopyFilesBuildPhase section */
3331

3432
/* Begin PBXFileReference section */
33+
197ACDC026736AE10024C38C /* Intercom.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Intercom.xcframework; path = ../../Intercom.xcframework; sourceTree = "<group>"; };
3534
1A0F1E081B034B7100DA78D2 /* Sample-ObjC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Sample-ObjC.app"; sourceTree = BUILT_PRODUCTS_DIR; };
36-
AD5AAA291D92A70F00557FDA /* Intercom.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Intercom.framework; path = ../../Intercom.framework; sourceTree = "<group>"; };
3735
ADEBAA9F1D3F6D2A0016C6EC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Sample-ObjC/Info.plist"; sourceTree = SOURCE_ROOT; };
3836
ADEBAAA01D3F6D2A0016C6EC /* ITCAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ITCAppDelegate.h; path = "Sample-ObjC/ITCAppDelegate.h"; sourceTree = SOURCE_ROOT; };
3937
ADEBAAA11D3F6D2A0016C6EC /* ITCAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ITCAppDelegate.m; path = "Sample-ObjC/ITCAppDelegate.m"; sourceTree = SOURCE_ROOT; };
@@ -50,7 +48,7 @@
5048
isa = PBXFrameworksBuildPhase;
5149
buildActionMask = 2147483647;
5250
files = (
53-
AD5AAA2A1D92A70F00557FDA /* Intercom.framework in Frameworks */,
51+
197ACDC126736AE10024C38C /* Intercom.xcframework in Frameworks */,
5452
);
5553
runOnlyForDeploymentPostprocessing = 0;
5654
};
@@ -60,7 +58,7 @@
6058
1A0F1DFF1B034B7100DA78D2 = {
6159
isa = PBXGroup;
6260
children = (
63-
AD5AAA291D92A70F00557FDA /* Intercom.framework */,
61+
197ACDC026736AE10024C38C /* Intercom.xcframework */,
6462
1A0F1E0A1B034B7100DA78D2 /* Sample-ObjC */,
6563
1A0F1E091B034B7100DA78D2 /* Products */,
6664
);
@@ -319,7 +317,10 @@
319317
);
320318
INFOPLIST_FILE = "$(SRCROOT)/Sample-ObjC/Info.plist";
321319
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
322-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
320+
LD_RUNPATH_SEARCH_PATHS = (
321+
"$(inherited)",
322+
"@executable_path/Frameworks",
323+
);
323324
PRODUCT_BUNDLE_IDENTIFIER = "io.intercom.$(PRODUCT_NAME:rfc1034identifier)";
324325
PRODUCT_NAME = "Sample-ObjC";
325326
PROVISIONING_PROFILE = "eceab9ff-a291-4edf-a36e-4be7d6004b75";
@@ -342,7 +343,10 @@
342343
);
343344
INFOPLIST_FILE = "$(SRCROOT)/Sample-ObjC/Info.plist";
344345
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
345-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
346+
LD_RUNPATH_SEARCH_PATHS = (
347+
"$(inherited)",
348+
"@executable_path/Frameworks",
349+
);
346350
PRODUCT_BUNDLE_IDENTIFIER = "io.intercom.$(PRODUCT_NAME:rfc1034identifier)";
347351
PRODUCT_NAME = "Sample-ObjC";
348352
PROVISIONING_PROFILE = "d69d4463-41e8-4e0f-aac6-5caec061a98d";

Examples/Sample-ObjC/Sample-ObjC/Base.lproj/Main.storyboard

Lines changed: 73 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17124"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
77
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
88
</dependencies>
99
<scenes>
@@ -48,17 +48,17 @@
4848
</connections>
4949
</button>
5050
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="olB-3V-k0i">
51-
<rect key="frame" x="132" y="478" width="150" height="44"/>
51+
<rect key="frame" x="124" y="478" width="167" height="44"/>
5252
<constraints>
53-
<constraint firstAttribute="width" constant="150" id="2X7-Ps-dpf"/>
53+
<constraint firstAttribute="width" constant="167" id="2X7-Ps-dpf"/>
5454
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="150" id="EEe-om-itt"/>
5555
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="Hri-KG-sma"/>
5656
<constraint firstAttribute="width" constant="70" id="dMx-VH-sNh"/>
5757
<constraint firstAttribute="height" constant="44" id="jRV-f1-nTP"/>
5858
<constraint firstAttribute="height" constant="44" id="nbZ-mK-eQa"/>
5959
</constraints>
6060
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
61-
<state key="normal" title="Open Intercom">
61+
<state key="normal" title="Open Messenger">
6262
<color key="titleColor" red="0.0" green="0.63921568627450975" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
6363
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
6464
</state>
@@ -72,11 +72,67 @@
7272
</mask>
7373
</variation>
7474
<connections>
75-
<action selector="openIntercomPressed:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="IQb-CZ-THN"/>
75+
<action selector="openMessengerTapped:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="IQb-CZ-THN"/>
76+
</connections>
77+
</button>
78+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ogC-ME-cPV">
79+
<rect key="frame" x="122" y="530" width="170" height="44"/>
80+
<constraints>
81+
<constraint firstAttribute="height" constant="44" id="6FQ-uQ-GrY"/>
82+
<constraint firstAttribute="height" constant="44" id="Ejy-ox-E4h"/>
83+
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="dlK-9o-9g0"/>
84+
<constraint firstAttribute="width" constant="70" id="lGX-z8-tGn"/>
85+
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="150" id="mWl-HU-22x"/>
86+
<constraint firstAttribute="width" constant="170" id="r9D-Bx-Jti"/>
87+
</constraints>
88+
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
89+
<state key="normal" title="Open Help Center">
90+
<color key="titleColor" red="0.0" green="0.63921568630000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
91+
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
92+
</state>
93+
<state key="disabled">
94+
<color key="titleColor" systemColor="lightTextColor"/>
95+
</state>
96+
<variation key="default">
97+
<mask key="constraints">
98+
<exclude reference="Ejy-ox-E4h"/>
99+
<exclude reference="lGX-z8-tGn"/>
100+
</mask>
101+
</variation>
102+
<connections>
103+
<action selector="openHelpCenterTapped:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="t5t-a7-akb"/>
104+
</connections>
105+
</button>
106+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6lg-HO-wA7">
107+
<rect key="frame" x="122" y="582" width="170" height="44"/>
108+
<constraints>
109+
<constraint firstAttribute="width" constant="170" id="E48-gz-NgQ"/>
110+
<constraint firstAttribute="height" constant="44" id="Gng-Yv-Tdn"/>
111+
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="Mi7-fu-CJl"/>
112+
<constraint firstAttribute="width" constant="70" id="Vbi-P7-EYE"/>
113+
<constraint firstAttribute="height" constant="44" id="dQ3-7h-Eg0"/>
114+
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="150" id="dZi-nK-MUL"/>
115+
</constraints>
116+
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
117+
<state key="normal" title="Open Article">
118+
<color key="titleColor" red="0.0" green="0.63921568630000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
119+
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
120+
</state>
121+
<state key="disabled">
122+
<color key="titleColor" systemColor="lightTextColor"/>
123+
</state>
124+
<variation key="default">
125+
<mask key="constraints">
126+
<exclude reference="dQ3-7h-Eg0"/>
127+
<exclude reference="Vbi-P7-EYE"/>
128+
</mask>
129+
</variation>
130+
<connections>
131+
<action selector="openArticle:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="L9z-Iu-kE0"/>
76132
</connections>
77133
</button>
78134
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4JP-JU-5LF">
79-
<rect key="frame" x="154.5" y="530" width="105" height="44"/>
135+
<rect key="frame" x="155" y="652" width="105" height="44"/>
80136
<constraints>
81137
<constraint firstAttribute="width" constant="105" id="F7w-lV-S20"/>
82138
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="105" id="b8R-2C-aks"/>
@@ -99,39 +155,39 @@
99155
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
100156
<constraints>
101157
<constraint firstItem="YRd-xJ-T0x" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="2w8-g7-HTk"/>
158+
<constraint firstItem="6lg-HO-wA7" firstAttribute="leading" secondItem="ogC-ME-cPV" secondAttribute="leading" id="7N8-sj-2Qo"/>
102159
<constraint firstItem="NFh-f8-qS9" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="8Qa-FY-sJe"/>
103160
<constraint firstItem="4JP-JU-5LF" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="Gqa-3a-0ML"/>
161+
<constraint firstItem="ogC-ME-cPV" firstAttribute="centerX" secondItem="olB-3V-k0i" secondAttribute="centerX" constant="-0.5" id="GrO-Lm-unD"/>
162+
<constraint firstItem="ogC-ME-cPV" firstAttribute="top" secondItem="olB-3V-k0i" secondAttribute="bottom" constant="8" id="IuO-ua-3Wz"/>
104163
<constraint firstItem="NFh-f8-qS9" firstAttribute="top" secondItem="YRd-xJ-T0x" secondAttribute="bottom" constant="40" id="pfL-mg-sCI">
105164
<variation key="heightClass=compact-widthClass=compact" constant="20"/>
106165
</constraint>
107166
<constraint firstItem="NFh-f8-qS9" firstAttribute="centerY" secondItem="kh9-bI-dsS" secondAttribute="centerY" id="sl5-ol-stA"/>
108-
<constraint firstItem="olB-3V-k0i" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="uTc-ve-MuO"/>
167+
<constraint firstItem="olB-3V-k0i" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" constant="0.5" id="uTc-ve-MuO"/>
168+
<constraint firstItem="6lg-HO-wA7" firstAttribute="top" secondItem="ogC-ME-cPV" secondAttribute="bottom" constant="8" id="uwg-GD-qNw"/>
109169
<constraint firstItem="olB-3V-k0i" firstAttribute="top" secondItem="NFh-f8-qS9" secondAttribute="bottom" constant="8" id="wkp-4S-uF9"/>
110-
<constraint firstItem="4JP-JU-5LF" firstAttribute="top" secondItem="olB-3V-k0i" secondAttribute="bottom" constant="8" id="z6H-TP-BxB"/>
170+
<constraint firstItem="4JP-JU-5LF" firstAttribute="top" secondItem="olB-3V-k0i" secondAttribute="bottom" constant="130" id="z6H-TP-BxB"/>
111171
</constraints>
112172
</view>
113173
<navigationItem key="navigationItem" id="DNj-Qc-SeE"/>
114174
<connections>
115175
<outlet property="loginButton" destination="NFh-f8-qS9" id="LmV-NW-8Vz"/>
116176
<outlet property="logoutButton" destination="4JP-JU-5LF" id="ddQ-jd-01M"/>
117-
<outlet property="sendMessageButton" destination="olB-3V-k0i" id="b9f-Up-lzG"/>
177+
<outlet property="openArticleButton" destination="6lg-HO-wA7" id="Uyj-K5-b1V"/>
178+
<outlet property="openHelpCenterButton" destination="ogC-ME-cPV" id="5eS-zF-UFi"/>
179+
<outlet property="openMessengerButton" destination="olB-3V-k0i" id="b9f-Up-lzG"/>
118180
</connections>
119181
</viewController>
120182
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
121183
</objects>
122-
<point key="canvasLocation" x="-188" y="86"/>
184+
<point key="canvasLocation" x="-188.40579710144928" y="85.714285714285708"/>
123185
</scene>
124186
</scenes>
125187
<resources>
126188
<image name="Intercom-logo" width="297" height="75"/>
127189
<systemColor name="lightTextColor">
128190
<color white="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
129191
</systemColor>
130-
<systemColor name="lightTextColor">
131-
<color white="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
132-
</systemColor>
133-
<systemColor name="lightTextColor">
134-
<color white="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
135-
</systemColor>
136192
</resources>
137193
</document>

Examples/Sample-ObjC/Sample-ObjC/ITCViewController.m

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ @interface ITCViewController () <UIAlertViewDelegate>
1313

1414
@property (nonatomic, weak) IBOutlet UIButton *logoutButton;
1515
@property (nonatomic, weak) IBOutlet UIButton *loginButton;
16-
@property (nonatomic, weak) IBOutlet UIButton *sendMessageButton;
16+
@property (nonatomic, weak) IBOutlet UIButton *openMessengerButton;
17+
@property (weak, nonatomic) IBOutlet UIButton *openArticleButton;
18+
@property (weak, nonatomic) IBOutlet UIButton *openHelpCenterButton;
1719
@property (nonatomic, assign) BOOL loggedIn;
1820

1921
@end
@@ -31,7 +33,9 @@ - (void)setLoggedIn:(BOOL)loggedIn {
3133

3234
self.loginButton.enabled = !loggedIn;
3335
self.logoutButton.enabled = loggedIn;
34-
self.sendMessageButton.enabled = loggedIn;
36+
self.openMessengerButton.enabled = loggedIn;
37+
self.openHelpCenterButton.enabled = loggedIn;
38+
self.openArticleButton.enabled = loggedIn;
3539
}
3640

3741
- (IBAction)loginPressed:(id)sender {
@@ -59,10 +63,18 @@ - (IBAction)logoutPressed:(id)sender {
5963
self.loggedIn = NO;
6064
}
6165

62-
- (IBAction)openIntercomPressed:(id)sender {
66+
- (IBAction)openMessengerTapped:(id)sender {
6367
[Intercom presentMessenger];
6468
}
6569

70+
- (IBAction)openHelpCenterTapped:(id)sender {
71+
[Intercom presentHelpCenter];
72+
}
73+
74+
- (IBAction)openArticle:(id)sender {
75+
[Intercom presentArticle:@"<#ARTICLE_ID#>"];
76+
}
77+
6678
- (void)handleUserLogin:(UIAlertController *)alertController {
6779
//The user pressed login, if they gave us an email, log them in.
6880
UITextField *emailField = alertController.textFields.firstObject;

0 commit comments

Comments
 (0)