forked from adobe/react-native-acpanalytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e5c3519
Showing
44 changed files
with
16,614 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"presets": ["flow", "react-native"], | ||
"plugins": [ | ||
["module-resolver", { | ||
"root": [ "./js/" ] | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
[ignore] | ||
; We fork some components by platform | ||
.*/*[.]android.js | ||
|
||
; Ignore "BUCK" generated dirs | ||
<PROJECT_ROOT>/\.buckd/ | ||
|
||
; Ignore unexpected extra "@providesModule" | ||
.*/node_modules/.*/node_modules/fbjs/.* | ||
|
||
; Ignore templates for 'react-native init' | ||
<PROJECT_ROOT>/node_modules/react-native/local-cli/.* | ||
|
||
; Ignore polyfills | ||
<PROJECT_ROOT>/node_modules/react-native/Libraries/polyfills/.* | ||
|
||
; Ignore various node_modules | ||
<PROJECT_ROOT>/node_modules/metro/.* | ||
|
||
; Ignore RN jest | ||
<PROJECT_ROOT>/node_modules/react-native/.* | ||
|
||
; Ignore Example | ||
<PROJECT_ROOT>/sample/* | ||
|
||
|
||
[include] | ||
<PROJECT_ROOT>/node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes | ||
|
||
[libs] | ||
node_modules/react-native/Libraries/react-native/react-native-interface.js | ||
node_modules/react-native/flow | ||
flow-typed/ | ||
|
||
[options] | ||
module.system=haste | ||
|
||
emoji=true | ||
|
||
munge_underscores=true | ||
|
||
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' | ||
|
||
module.system.node.resolve_dirname=node_modules | ||
module.system.node.resolve_dirname=./src/ | ||
|
||
module.file_ext=.js | ||
module.file_ext=.jsx | ||
module.file_ext=.json | ||
module.file_ext=.native.js | ||
|
||
suppress_type=$FlowIssue | ||
suppress_type=$FlowFixMe | ||
suppress_type=$FixMe | ||
|
||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError | ||
|
||
esproposal.decorators=ignore | ||
|
||
module.name_mapper.extension='png' -> 'emptyObject' | ||
module.name_mapper='^react-navigation$' -> 'emptyObject' | ||
|
||
; https://github.com/facebook/react-native/issues/14927 | ||
module.name_mapper='^./link/link$' -> 'emptyObject' | ||
|
||
[version] | ||
0.92.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pbxproj -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
|
||
# Xcode | ||
# | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
project.xcworkspace | ||
|
||
|
||
# Android/IntelliJ | ||
# | ||
build/ | ||
.idea | ||
.gradle | ||
local.properties | ||
*.iml | ||
|
||
# BUCK | ||
buck-out/ | ||
\.buckd/ | ||
*.keystore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sample/ | ||
.github/ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
|
||
# bourbon-platform-react-native-analytics | ||
|
||
https://wiki.corp.adobe.com/display/adms/React+Native | ||
|
||
|
||
## Setup | ||
|
||
`npm install` | ||
|
||
#### Andriod | ||
|
||
Open `android/build.gradle` in Android studio | ||
|
||
#### iOS: | ||
|
||
Open `ios/RCTACPAnalytics.xcodeproj` | ||
|
||
Note: This the Xcode project does not include all dependencies to build. If you want to build the project you should run `pod install` then open the workspace. | ||
|
||
|
||
## Installation | ||
|
||
You need to install the SDK with [npm](https://www.npmjs.com/) and configure the native Android/iOS project in your react native project. | ||
|
||
### 1. Create React Native project | ||
|
||
First create a React Native project: | ||
|
||
```bash | ||
react-native init MyReactApp | ||
``` | ||
|
||
### 2. Install JavaScript packages | ||
|
||
Install and link the `react-native-acpanalytics` package: | ||
|
||
```bash | ||
npm install react-native-acpanalytics | ||
react-native link react-native-acpanalytics | ||
``` | ||
|
||
### 3. Configure native projects | ||
|
||
#### 3.1 Android project | ||
|
||
Navigate to `MainApplication.java` under `app/src/main/java/com/<project name>/` and add a call to `RCTACPCoreModule.setApplication()` inside of `onCreate()`. | ||
|
||
```java | ||
import com.adobe.marketing.mobile.reactnative.RCTACPCorePackage; // import the package | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
//... | ||
RCTACPCoreModule.setApplication(this); // add this line | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
### [Analytics](https://aep-sdks.gitbook.io/docs/using-mobile-extensions/mobile-core) | ||
|
||
##### Getting the extension version: | ||
|
||
```javascript | ||
ACPAnalytics.extensionVersion().then(version => console.log("AMSDK: ACPAnalytics version: " + version)); | ||
``` | ||
|
||
##### Registering the extension with Core: | ||
|
||
```javascript | ||
ACPAnalytics.registerExtension(); | ||
``` | ||
|
||
##### Get the tracking identifier | ||
|
||
```javascript | ||
ACPAnalytics.getTrackingIdentifier().then(identifier => console.log("AMSDK: Tracking identifier: " + identifier)); | ||
``` | ||
##### Send queued hits | ||
|
||
```javascript | ||
ACPAnalytics.sendQueuedHits(); | ||
``` | ||
|
||
##### Get the queue size | ||
|
||
```javascript | ||
ACPAnalytics.getQueueSize().then(size => console.log("AMSDK: Queue size: " + size)); | ||
``` | ||
|
||
##### Set the custom visitor identifier | ||
|
||
```javascript | ||
ACPAnalytics.setVisitorIdentifier("yourVisitorId"); | ||
``` | ||
|
||
##### Get the custom visitor identifier | ||
|
||
```javascript | ||
ACPAnalytics.getVisitorIdentifier().then(vid => console.log("AMSDK: Visitor identifier: " + vid)); | ||
``` | ||
|
||
##### Track app actions | ||
|
||
```javascript | ||
ACPCore.trackAction(TODO); | ||
``` | ||
|
||
##### Track app states | ||
|
||
```javascript | ||
ACPCore.trackState(TODO); | ||
``` | ||
|
||
## License | ||
|
||
See LICENSE.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
buildscript { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.1.3' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
// buildToolsVersion "23.0.1" | ||
|
||
defaultConfig { | ||
minSdkVersion 16 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
repositories { | ||
google() | ||
jcenter() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation "com.facebook.react:react-native:+" | ||
implementation 'com.adobe.marketing.mobile:analytics:1.+' | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Tue Jan 29 15:04:54 MST 2019 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip |
Oops, something went wrong.