Все коллекции
Onboarding.Online SDK integration
Manual for adding swift-onboarding-sdk to the existing project. UI interface - Storyboard
Manual for adding swift-onboarding-sdk to the existing project. UI interface - Storyboard
В
Автор: Валерия Зимницкая
Обновлено больше недели назад
  1. Open the required project, go to the dependency settings: “Project -> Package dependency”

    1.1 Click the “+” (Add package dependency) button.

  2. You will see the “Apple swift packages” window.

    Paste the link https://github.com/onboarding-online/swift-onboarding-sdk in the “Search or Enter Package URL” field.

  3. Xcode will show the settings for adding SDK. Make sure the settings look like this “Dependency rule -> branch : main” and click the “Add package” button.

  4. You will see the library verification window. Wait till the verification ends and click “Add package.”


    The package integration has been completed. Only a few code lines remain to be added to your project!

  5. If you use Interface -> Storyboard (Point 6) for the project initializing:
    12.1. Open the AppDelegate file (or wherever you want to add an onboarding launcher: ScreenService).
    12.2 Add to the file header the following:
    import OnboardingiOSSDK
    12.3 Find the function:
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

    }

    12.4 Add the piece of code to it:
    OnboardingService.shared.startOnboarding(projectId: "",

    localJSONFileName: "",

    useLocalJSONAfterTimeout: 1.0) { onboardingResults in

    print(onboardingResults)

    }

  6. If you have already obtained an onboarding.online service project, download the json file of your onboarding Onboarding.online-> project -> onboarding -> json

  7. Drag the file into your Xcode project. After that, a settings window for adding a file will appear.

  8. Select "Copy if needed," "Create groups" and click "Finish."

  9. Add the file name to the onboarding launch function:
    16.1 Open the "AppDelegate" file (or wherever you want to add an onboarding launcher: ScreenService);
    16.2 Add the name of the json file you have downloaded.
    OnboardingService.shared.startOnboarding(projectId: "",

    localJSONFileName: "onboarding-v#1-23",

    useLocalJSONAfterTimeout: 1.0) { data in

    }

  10. Click the run button, wait for the simulator to launch, and enjoy your first onboarding!

Нашли ответ на свой вопрос?