-
Notifications
You must be signed in to change notification settings - Fork 377
adding new swift plugin docs for 1flow #5369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
## Adding the dependency | ||
|
||
### Through Xcode | ||
|
||
In the Xcode `File` menu, click `Add Packages`. You'll see a dialog where you can search for Swift packages. In the search field, enter the URL to this repository. | ||
``` | ||
https://github.com/1Flow-Inc/segment-1flow-ios.git | ||
``` | ||
|
||
|
||
You'll then have the option to pin to a version, or specific branch, as well as which project in your workspace to add it to. Once you've made your selections, click the `Add Package` button. | ||
|
||
### Through Package.swift | ||
|
||
Open your Package.swift file and add the following to the `dependencies` section: | ||
|
||
``` | ||
.package( | ||
name: "Segment", | ||
url: "https://github.com/1Flow-Inc/segment-1flow-ios.git", | ||
from: "1.0.0" | ||
), | ||
``` | ||
|
||
## Using the Plugin in your App | ||
|
||
Open the file where you setup and configure the Analytics-Swift library. Add this plugin to the list of imports. | ||
|
||
``` | ||
import Segment | ||
import SegmentOneFlow // <-- Add this line | ||
``` | ||
|
||
Just under your Analytics-Swift library setup, call `analytics.add(plugin: ...)` to add an instance of the plugin to the Analytics timeline. | ||
|
||
``` | ||
let analytics = Analytics(configuration: Configuration(writeKey: "<YOUR WRITE KEY>") | ||
.flushAt(3) | ||
.trackApplicationLifecycleEvents(true)) | ||
analytics.add(plugin: OneFlowDestination()) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohantryskybox I have added this page as we provide each swift plugin a unique page. Can you confirm these setup instructions are accurate for your plugin?
For more context, this is in line with the setup instructions shown for all the other swift plugins:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tcgilbert
This looks good.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but will wait for an answer to the open question to merge this
Thank you for your contribution! Your pull request is merged, but may take a day or two to appear on the site. |
Proposed changes
1flow is launching a swift plugin, creating the page on their behalf
Merge timing
asap