Skip to content

jsfrocha/cordova-plugin-segment-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-segment

Cordova plugin for Segment Analytics.

Supports Segment's iOS and Android SDKs.

Usage

Implements (mostly) the same API interface on window.analytics as Analytics.js.

Segment Write Keys

In config.xml, you can put the following preferences:

iOS

  • <preference name="ios_segment_write_key" value="{Segment iOS write key}" />
  • <preference name="ios_segment_debug_write_key" value="{Segment iOS write key}" />

Android

  • <preference name="android_segment_write_key" value="{Segment Android write key}" />
  • <preference name="android_segment_debug_write_key" value="{Segment Android write key}" />

iOS Integrations Setup

This plugin uses cordova-plugin-cocoapods-support to automatically bundle in the Segment iOS SDK through CocaoPods.

The only caveat is that you will need to run the project from AppName.xcworkspace instead of AppName.xcodeproj (this is a limitation introduced by CocoaPods itself).

Also for this reason, if you are using Ionic and its command line tools, ionic build and ionic run will cause the archive build to fail. You will need to manually run the project in Xcode from AppName.xcworkspace.

You might also want to consult official Segment documentation iOS Quickstart.

Android Integrations Setup

Use Gradle: By default, the plugin builds with the analytics-core SDK for Android. To add more your custom integrations, create a build-extras.gradle file in your Android platform root directory and add your segment integration dependencies. See the Android Custom Build Docs for examples.

About

Cordova Plugin - Segment SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published