Skip to content

Commit 042ebe4

Browse files
authored
Merge pull request #4202 from segmentio/niallzato-patch-2
Document multiple instance support
2 parents 8df397f + cebfd34 commit 042ebe4

File tree

1 file changed

+14
-0
lines changed
  • src/connections/sources/catalog/libraries/mobile/swift-ios

1 file changed

+14
-0
lines changed

src/connections/sources/catalog/libraries/mobile/swift-ios/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,20 @@ Segment supports these destinations for Analytics Swift, with more to come:
455455
No, only the plugins listed above are supported in device-mode for Analytics-Swift.
456456
### Will I still see device-mode integrations listed as `false` in the integrations object?
457457
When you successfully package a plugin in device-mode, you will no longer see the integration listed as `false` in the integrations object for a Segment event. This logic is now packaged in the event metadata, and is not surfaced in the Segment debugger.
458+
### Does the Analytics-Swift mobile library support multiple instances of Segment on the device?
459+
The Analytics-Swift mobile library supports multiple instances of Segment on the device. For example, you may wish to send some events to one source and other events to another:
460+
```swift
461+
let configuration1 = Configuration(writeKey: "WRITE_KEY1")
462+
.trackApplicationLifecycleEvents(true)
463+
.flushInterval(10)
464+
465+
let configuration2 = Configuration(writeKey: "WRITE_KEY2")
466+
.trackApplicationLifecycleEvents(false)
467+
.flushInterval(1)
468+
469+
analytics1 = Analytics(configuration: configuration1)
470+
analytics2 = Analytics(configuration: configuration2)
471+
```
458472

459473
## Changelog
460474
[View the Analytics-Swift changelog on GitHub](https://github.com/segmentio/analytics-swift/releases){:target="_blank"}.

0 commit comments

Comments
 (0)