1 min read

Manual Setup

Last Updated - Platform 21.0 - SDK 16.0

To 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

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.

  1. If you have not set up Fastlane then follow the PoqTooling setup steps.
  2. Create a new Project.yml file in the root directory and add the following, replacing AppName 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

  1. Open your Project.yml.
  2. Check that you have the PoqSDK and PoqPlatform in the packages section (see previous snippet).
  3. Add feature frameworks to the dependencies section of your templateTarget following their getting started guides.

Set up the PoqSDK

  1. Create your AppModule by implementing the PoqModule interface. The AppModule 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    }}

  1. Create your AppDelegate as a subclass of BaseAppDelegate. Register the default PoqSDK modules and your AppModule 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