Lune PFM iOS SDK
An SDK to embed Lune enrichment views into your iOS mobile apps
Installation
There are three options to install the LuneSDK. Follow the instructions below for any of the options you prefer:
With that done, you should be able to import the SDK into any of your Swift files as shown below.
import LuneSDK
Swift Package Manager (SPM)
You can add the LuneSDK to your project directly within xcode using Swift Package Manager. To do so:
- Open up your project in xcode, and in the menu bar, click on to File > Add Package Dependencies...
- Paste
https://github.com/Lune-Technologies/lune-pfm-sdk-ios.gitinto the Search Bar at the top-right of the page. - Click on Add Package
- Select the target you want to add the SDK to, if necessary.
- Let Xcode download the package and set everything up.
CocoaPods
To install the LuneSDK into your project using CocoaPods, add the following to your Podfile file:
use_frameworks!
target 'MyApp' do
# Add the LuneSDK pod
pod 'LuneSDK'
# ...
end
Then run pod install to install LuneSDK in your workspace.
warning
Should you encounter an error about the bundle needing signing on Xcode 14, add the following post-install script in your podfile.
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
end
Manually - using raw XCFramework
You can also add the LuneSDK to your project manually, using the raw .xcframework. To do so:
- Add the
.xcframeworkprovided to you into your Xcode project by simply dragging it into the Project navigator. - In the resulting pop-up, ensure that the "Copy items if needed" option is checked and click "Finish"
- Select your project in the Project Navigator, and allow the Targets settings to load.
- Under the General tab, scroll to reveal the Frameworks, Libraries and Embedded Content section.
- In that section, click the dropdown button next to
LuneSDK.xcframeworkand select "Embed and Sign"