Skip to content

Commit c079e8c

Browse files
2 parents f5378f5 + b382dd6 commit c079e8c

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# capacitor-segment
22
- Capacitor wrapper plugin for Segment analytics mobile SDK.
3-
- Currently only implemented on iOS.
3+
- Only implemented on iOS and Android (not for PWA)
44

55
## Installation
66

@@ -15,6 +15,27 @@ $ yarn cap sync
1515
$ npm install @jairemix/capacitor-segment
1616
$ npx cap sync
1717
```
18+
### Android only
19+
After installing and syncing the Capacitor plugin, remember to add it to `MainActivity.java`
20+
```java
21+
// Other Imports
22+
import com.jairemix.capacitor.segment.SegmentPlugin;
23+
24+
public class MainActivity extends BridgeActivity {
25+
26+
@Override
27+
public void onCreate(Bundle savedInstanceState) {
28+
super.onCreate(savedInstanceState);
29+
30+
// Initializes the Bridge
31+
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
32+
add(SegmentPlugin.class);
33+
// Additional plugins you've installed go here
34+
}});
35+
}
36+
37+
}
38+
```
1839

1940
## Example
2041
```ts

0 commit comments

Comments
 (0)