Skip to content

Commit 00b0cb1

Browse files
committed
Updating readme
1 parent b1a74fb commit 00b0cb1

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

README.md

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# RNSegmentIOAnalytics
1+
# React Native Analytics
22

3-
Written by Tal Kain <[email protected]>
3+
Written by Tal Kain <[email protected]>, Tony Xiao <[email protected]> and other contributors.
44

5-
Based on SegmentIO (https://segment.com) Analytics project.
5+
Based on Segment (https://segment.com) Analytics project.
66
See [iOS SDK](https://github.com/segmentio/analytics-ios) and [Android SDK](https://github.com/segmentio/analytics-android).
77

88

99
## iOS Installation
10-
1. Download and install the npm package by running `npm install --save react-native-segment-io-analytics`
10+
1. Download and install the npm package by running `npm install --save react-native-analytics`
1111
2. In your Podfile, add `pod "Analytics"` to your project.
1212
3. Inside Xcode (make sure you've opened your `.xcworkspace` file), go to the project navigator and right click `Libraries` -> `Add Files to [your project's name]`.
13-
4. Go to `node_modules` -> `react-native-segment-io-analytics` -> and choose the `RNSegmentIOAnalytics.xcodeproj` file.
14-
5. Make sure your project links to *libAnalytics.a* and *libRNSegmentIOAnalytics.a* (The libraries should be listed under "Build Phases -> Link Binary With Libraries").
13+
4. Go to `node_modules/react-native-analytics/ios` -> and choose the `RNAnalytics` folder.
14+
5. Make sure your project links to *libAnalytics.a* (The libraries should be listed under "Build Phases -> Link Binary With Libraries". Should happen automatically if you use cocoapods).
1515

1616
## Android Installation
17-
1. Download and install the npm package by running `npm install --save react-native-segment-io-analytics`
17+
1. Download and install the npm package by running `npm install --save react-native-analytics`
1818
2. If using [rnpm](https://github.com/rnpm/rnpm), run `rnpm link`. Otherwise add to `android/app/src/main/java/com/your-app-name/MainActivity.java`:
1919

2020
```java
@@ -31,16 +31,16 @@ import com.smore.RNSegmentIOAnalytics.RNSegmentIOAnalyticsPackage; // <-- add th
3131

3232
## Usage sample
3333
```javascript
34-
var RNSegmentIOAnalytics = require('react-native-segment-io-analytics');
35-
36-
var segmentIOWriteKey = "SEGMENT_IO_WRITE_KEY";
37-
var flushEverySecondsCount = 1;
38-
RNSegmentIOAnalytics.setup(segmentIOWriteKey, flushEverySecondsCount);
39-
RNSegmentIOAnalytics.identifyUser("testing", {"name":"test name"});
40-
RNSegmentIOAnalytics.track("test track", {"name":"test track with name"});
41-
RNSegmentIOAnalytics.screen("test screen", {"screenType":"SCREEN NAME"});
42-
RNSegmentIOAnalytics.flush();
43-
RNSegmentIOAnalytics.reset();
34+
import Analytics from 'react-native-analytics'
35+
36+
const segmentIOWriteKey = "SEGMENT_IO_WRITE_KEY"
37+
const flushEverySecondsCount = 1
38+
Analytics.setup(segmentIOWriteKey, flushEverySecondsCount)
39+
Analytics.identify("testing", {"name":"test name"})
40+
Analytics.track("test track", {"name":"test track with name"})
41+
Analytics.screen("test screen", {"screenType":"SCREEN NAME"})
42+
Analytics.flush()
43+
Analytics.reset()
4444
```
4545

4646
## Documentation
@@ -54,12 +54,6 @@ ld: '......./Pods/GoogleIDFASupport/Libraries/libAdIdAccessLibrary.a(TAGActualAd
5454
```
5555
There are instructions for fixing it here: https://stackoverflow.com/questions/31395260/google-analytics-libadidaccess-a-does-not-contain-bitcode
5656

57-
## Deployment
58-
Deploying the project can be done using ```npm publish``` command.
59-
Read more about it here: https://gist.github.com/coolaj86/1318304
60-
6157
## License
6258

6359
This project is released under the [MIT License](http://www.opensource.org/licenses/MIT).
64-
65-
The copyright notice from Segment's project is in the *analytics-ios.LICENSE* file

0 commit comments

Comments
 (0)