Skip to content

Commit 4e1bc94

Browse files
author
Brad Umbaugh
authored
Merge pull request #99 from Iterable/use-frameworks
Clarified Podfile instructions
2 parents c248c3d + b958cc5 commit 4e1bc94

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

README.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,35 @@ For more information, read Iterable's [Setting up iOS Push Notifications](https:
1616

1717
Iterable supports [CocoaPods](https://cocoapods.org) for easy installation. If you don't have it yet, please refer to the CocoaPods [Getting Started](https://guides.cocoapods.org/using/getting-started.html) guide for installation instructions.
1818

19-
To include the Iterable SDK in your project, edit the **Podfile** and add the **Iterable-iOS-SDK** pod to your app target:
19+
To install the Iterable Swift SDK using CocoaPods:
2020

21-
```
22-
pod 'Iterable-iOS-SDK'
23-
```
21+
- Edit your project's **Podfile** and add the **Iterable-iOS-SDK** pod to
22+
your app target.
23+
- If you'll be using media attachments on iOS push notifications, add the
24+
**Iterable-iOS-AppExtensions** pod to your project's extension target.
2425

25-
If you want to include a Iterable Rich Notification Extension, you will also need to include the **Iterable-iOS-AppExtensions** pod in your extension target:
26+
Example **Podfile**:
2627

27-
```
28-
pod 'Iterable-iOS-AppExtensions'
29-
```
28+
```ruby
29+
platform :ios, '11.0'
3030

31-
Please look at the included sample [**Podfile**](https://github.com/Iterable/swift-sdk/blob/master/sample-apps/swift-sample-app/Podfile?raw=true).
31+
# You must include the following line for both Objective-C and Swift
32+
# projects. If you cannot use this option for your target, install
33+
# the Iterable SDK in your project manually
34+
use_frameworks!
35+
36+
target 'swift-sample-app' do
37+
pod 'Iterable-iOS-SDK'
38+
end
39+
40+
target 'swift-sample-app-notification-extension' do
41+
pod 'Iterable-iOS-AppExtensions'
42+
end
43+
```
3244

33-
Congratulations! You have now imported Iterable SDK into your project!
45+
You you must include `use_frameworks!` in your **Podfile**, no matter if
46+
your app is based on Swift or Objective-C. If you cannot use this in your
47+
project, install the SDK [manually](#manual-installation).
3448

3549
## Manual installation
3650

@@ -49,7 +63,7 @@ IterableAppExtensions.framework
4963

5064
![Linking](https://github.com/Iterable/swift-sdk/blob/master/images/app-extension-linked-framework.png?raw=true)
5165

52-
3. In build settings, set **Always Embed Swift Standard Libraries** setting to **Yes**. This is required for Objective-C projects.
66+
3. In build settings, set **Always Embed Swift Standard Libraries** setting to **Yes**. This is necessary for both Swift and Objective-C projects.
5367

5468
![Linking](https://github.com/Iterable/swift-sdk/blob/master/images/build-setting.png?raw=true)
5569

@@ -226,7 +240,7 @@ See Apple's [UserNotifications framework](https://developer.apple.com/documentat
226240

227241
The Iterable iOS SDK provides an implementation that handles media attachments and action buttons:
228242

229-
1. Include `Iterable-iOS-AppExtensions` in your podfile as explained above.
243+
1. Include `Iterable-iOS-AppExtensions` in your **Podfile** as explained above.
230244
2. Create a new target of type notification service extension in your Xcode project/solution.
231245
3. If you are calling Iterable SDK from Swift, all you need to do is inherit the `NotificationService` class (auto generated by Xcode) from the `ITBNotificationServiceExtension` class. If you are using Objective-C, you will have to delegate to the provided implementation. See the example below:
232246

sample-apps/objc-sample-app/Podfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
platform :ios, '11.0'
22

3-
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
3+
# You must include the following line for both Objective-C and Swift
4+
# projects. If you cannot use this option for your target, install
5+
# the Iterable SDK in your project manually.
46
use_frameworks!
57

68
target 'objc-sample-app' do

sample-apps/swift-sample-app/Podfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
platform :ios, '11.0'
22

3-
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
3+
# You must include the following line for both Objective-C and Swift
4+
# projects. If you cannot use this option for your target, install
5+
# the Iterable SDK in your project manually
46
use_frameworks!
57

68
target 'swift-sample-app' do

0 commit comments

Comments
 (0)