Skip to content

Commit a6b45ab

Browse files
sebastiansimsonaalekzmarkzegarelli
authored
Update castle docs include mobile destinations (#4782)
* Update Castle destination documentation, include instructions for mobile * Add castle kotlin instructions * Update supported platforms * Update formatting and syntax --------- Co-authored-by: Alexander Simson <[email protected]> Co-authored-by: markzegarelli <[email protected]>
1 parent 91c62cc commit a6b45ab

File tree

1 file changed

+57
-3
lines changed
  • src/connections/destinations/catalog/castle

1 file changed

+57
-3
lines changed

src/connections/destinations/catalog/castle/index.md

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ id: 56a8f566e954a874ca44d3b0
44
---
55
[Castle](https://castle.io/?utm_source=segmentio&utm_medium=docs&utm_campaign=partners){:target="_blank"} monitors every step of the customer journey to help visualize and proactively block fraud that would otherwise fly under the radar. Types of fraud or abuse that can be managed include bots, fake accounts, multi-accounting, and account sharing.
66

7+
The Castle destination source code is available on GitHub. Source code for the following integrations are available:
8+
9+
- [iOS](https://github.com/castle/analytics-ios-integration-castle){:target="_blank"}
10+
- [Android](https://github.com/castle/analytics-kotlin-integration-castle){:target="_blank"}
11+
- [Web](https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/castle){:target="_blank"}
12+
713
Castle maintains this destination. For any issues with the destination, contact the [Castle support team](mailto:[email protected]).
814

915
## Getting Started
@@ -16,11 +22,61 @@ Calls are now visible in Castle dashboards in real-time.
1622

1723
> info ""
1824
> Castle ingests Segment Client-side events. Server-side events are dropped and not processed.
19-
> Castle only supports web integrations through Segment, but is in the process of working on mobile support.
25+
> Castle supports web, Android and iOS integrations through Segment.
26+
27+
### iOS
28+
29+
1. Add the Castle Segment dependency
30+
31+
- With Xcode:
32+
33+
In the Xcode **File** menu, click **Add Packages**. In the resulting dialog dialog where you can search for Swift packages. In the search field, enter the URL to this repository: `https://github.com/castle/analytics-ios-integration-castle`
34+
2035

36+
You can optionally pin the package to a specific branch or version, and select the project in your workspace to which you'll add the package. When you're done, click **Add Package**.
37+
38+
- With Package.swift:
2139

40+
```
41+
.package(
42+
name: "SegmentCastle",
43+
url: "https://github.com/castle/analytics-ios-integration-castle",
44+
from: "1.0.0"
45+
),
46+
```
47+
48+
2. Next, add the Castle destination to your analytics instance:
2249

50+
```swift
51+
let analytics = Analytics(configuration: Configuration(writeKey: "<YOUR_WRITE_KEY_HERE>"))
52+
53+
let castleDestination = CastleDestination(userJwt: "<USER_JWT>")
54+
analytics.add(plugin: castleDestination)
55+
```
56+
57+
### Android
2358
59+
1. You can add the Castle Segment dependency two ways:
60+
61+
- Add this line to your gradle file:
62+
63+
```
64+
implementation 'com.segment.analytics.kotlin.destinations:castle:<latest_version>'
65+
```
66+
67+
- Add the following for Kotlin DSL:
68+
69+
```
70+
implementation("com.segment.analytics.kotlin.destinations:castle:<latest_version>")
71+
```
72+
73+
2. Next, add the Castle destination to your analytics instance:
74+
75+
```kotlin
76+
analytics = Analytics("<YOUR WRITE KEY>", applicationContext)
77+
analytics.add(plugin = CastleDestination(userJwt = "<USER_JWT>"))
78+
```
79+
2480

2581
## Page
2682

@@ -30,8 +86,6 @@ If you're not familiar with the Segment Specs, take a look to understand what th
3086
analytics.page()
3187
```
3288

33-
34-
3589
Segment sends Page calls to Castle as `$page` events.
3690

3791

0 commit comments

Comments
 (0)