1 min read
Manual Setup
Last Updated - Platform 21.0 - SDK 16.0To simplify setup and development we have developed a set of utilities using Fastlane. We recommend using XcodeGen along with PoqTooling for a good developer experience and quick set up.
Before you begin
To start using the PoqSDK, you will need access to our private GitHub repositories.
Add the PoqSDK to your repository
- Using XcodeGen and PoqTooling
- Using Swift Package Manager
XcodeGen is a project generation tool that is easy to work with. The following uses Swift Package Manager and requires PoqTooling to be set up.
- If you have not set up Fastlane then follow the PoqTooling setup steps.
- Create a new
Project.yml
file in the root directory and add the following, replacingAppName
with your own.
name: AppNameinclude: - Fastlane/Resources/Generation/Project.yml
settings: base: MARKETING_VERSION: 1.0.0
packages: PoqSDK: url: https://github.com/poqcommerce/Poq.iOS.SDK.git from: 16.0.0 PoqPlatform: url: https://github.com/poqcommerce/Poq.iOS.Platform.git version: 21.0.0
targetTemplates: application: type: application platform: iOS templates: - app+poq settings: base: ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon CODE_SIGN_ENTITLEMENTS: Configuration/${target_name}.entitlements INFOPLIST_FILE: Configuration/${target_name}-Info.plist dependencies: sources: - Sources
targets: AppName: templates: - application settings: base: PRODUCT_BUNDLE_IDENTIFIER: com.organisation.appname
- Open your
Project.yml
. - Check that you have the
PoqSDK
andPoqPlatform
in thepackages
section (see previous snippet). - Add feature frameworks to the
dependencies
section of yourtemplateTarget
following their getting started guides.
Set up the PoqSDK
- Create your
AppModule
by implementing thePoqModule
interface. TheAppModule
is responsible for setting up the app by hooking into lifecycle events.
import PoqFoundationimport UIKit
class AppModule: PoqModule { var bundle: Bundle { .main } func didAddToPlatform() { // Override feature dependencies. setUpDependencies() } func setUpDependencies() {} func createViewController(forName name: String) -> UIViewController? { // Override initial and tab view controllers. return nil }}
- Create your
AppDelegate
as a subclass ofBaseAppDelegate
. Register the default PoqSDK modules and yourAppModule
using the following code.
import PoqAnalyticsimport PoqFoundationimport PoqNetworkingimport PoqPlatformimport UIKit
@UIApplicationMainclass AppDelegate: BaseAppDelegate { override func setupModules() { // Register the core modules to set up the default platform behaviour. PoqPlatform.shared.addModule(PoqPlatformModule()) PoqPlatform.shared.addModule(PoqNetworkingModule()) PoqPlatform.shared.addModule(PoqAnalyticsModule()) // Register any integration modules here. // PoqPlatform.shared.addModule(PoqFirebaseModule()) // Register your app's module last. PoqPlatform.shared.addModule(AppModule()) }}
You have manually set up the PoqSDK.
Next steps
- Check out available features.
- Style your app with app styling.
- Add third-party integrations.