Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
d9bd3d8f4d | |||
bcafff0667 | |||
5c66d1a594 | |||
c55d66f0ee | |||
8b148a3a0d | |||
|
3825b3f1e0 | ||
|
b651948d45 |
15
README.md
15
README.md
@ -3,25 +3,18 @@ React Native bridge to the [AppMetrica](https://appmetrica.yandex.com/) on both
|
||||
|
||||
## Installation
|
||||
|
||||
1. `npm install react-native-appmetrica --save`
|
||||
2. If React Native version <= 0.59: \
|
||||
`react-native link react-native-appmetrica`
|
||||
3. iOS only
|
||||
* if `${PROJECT_DIR}/ios/Podfile` exists: \
|
||||
`npx pod-install`
|
||||
* if `${PROJECT_DIR}/ios/Podfile` don't exists: \
|
||||
[Setup AppMetrica](https://appmetrica.yandex.com/docs/mobile-sdk-dg/tasks/ios-quickstart.html) and placed frameworks at `${PROJECT_DIR}/ios/Frameworks`
|
||||
1. `npm install @jil/react-native-appmetrica --save`
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import AppMetrica from 'react-native-appmetrica';
|
||||
import AppMetrica from '@ijl/react-native-appmetrica';
|
||||
|
||||
// Starts the statistics collection process.
|
||||
AppMetrica.activateWithConfig({
|
||||
AppMetrica.activate({
|
||||
apiKey: '...KEY...',
|
||||
sessionTimeout: 120,
|
||||
firstActivationAsUpdate: true,
|
||||
firstActivationAsUpdate: false,
|
||||
});
|
||||
|
||||
// Sends a custom event message and additional parameters (optional).
|
||||
|
@ -28,7 +28,7 @@ def safeExtGet(prop, fallback) {
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
buildscript {
|
||||
// The Android Gradle plugin is only required when opening the android folder stand-alone.
|
||||
@ -47,7 +47,7 @@ buildscript {
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
android {
|
||||
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
||||
@ -113,47 +113,47 @@ def configureReactNativePom(def pom) {
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate { project ->
|
||||
// some Gradle build hooks ref:
|
||||
// https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
|
||||
task androidJavadoc(type: Javadoc) {
|
||||
source = android.sourceSets.main.java.srcDirs
|
||||
classpath += files(android.bootClasspath)
|
||||
classpath += files(project.getConfigurations().getByName('compile').asList())
|
||||
include '**/*.java'
|
||||
}
|
||||
// afterEvaluate { project ->
|
||||
// // some Gradle build hooks ref:
|
||||
// // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
|
||||
// task androidJavadoc(type: Javadoc) {
|
||||
// source = android.sourceSets.main.java.srcDirs
|
||||
// classpath += files(android.bootClasspath)
|
||||
// classpath += files(project.getConfigurations().getByName('compile').asList())
|
||||
// include '**/*.java'
|
||||
// }
|
||||
|
||||
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
|
||||
classifier = 'javadoc'
|
||||
from androidJavadoc.destinationDir
|
||||
}
|
||||
// task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
|
||||
// classifier = 'javadoc'
|
||||
// from androidJavadoc.destinationDir
|
||||
// }
|
||||
|
||||
task androidSourcesJar(type: Jar) {
|
||||
classifier = 'sources'
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
include '**/*.java'
|
||||
}
|
||||
// task androidSourcesJar(type: Jar) {
|
||||
// classifier = 'sources'
|
||||
// from android.sourceSets.main.java.srcDirs
|
||||
// include '**/*.java'
|
||||
// }
|
||||
|
||||
android.libraryVariants.all { variant ->
|
||||
def name = variant.name.capitalize()
|
||||
def javaCompileTask = variant.javaCompileProvider.get()
|
||||
// android.libraryVariants.all { variant ->
|
||||
// def name = variant.name.capitalize()
|
||||
// def javaCompileTask = variant.javaCompileProvider.get()
|
||||
|
||||
task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
|
||||
from javaCompileTask.destinationDir
|
||||
}
|
||||
}
|
||||
// task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
|
||||
// from javaCompileTask.destinationDir
|
||||
// }
|
||||
// }
|
||||
|
||||
artifacts {
|
||||
archives androidSourcesJar
|
||||
archives androidJavadocJar
|
||||
}
|
||||
// artifacts {
|
||||
// archives androidSourcesJar
|
||||
// archives androidJavadocJar
|
||||
// }
|
||||
|
||||
task installArchives(type: Upload) {
|
||||
configuration = configurations.archives
|
||||
repositories.mavenDeployer {
|
||||
// Deploy to react-native-event-bridge/maven, ready to publish to npm
|
||||
repository url: "file://${projectDir}/../android/maven"
|
||||
configureReactNativePom pom
|
||||
}
|
||||
}
|
||||
}
|
||||
// task installArchives(type: Upload) {
|
||||
// configuration = configurations.archives
|
||||
// repositories.mavenDeployer {
|
||||
// // Deploy to react-native-event-bridge/maven, ready to publish to npm
|
||||
// repository url: "file://${projectDir}/../android/maven"
|
||||
// configureReactNativePom pom
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
25
package.json
25
package.json
@ -1,35 +1,16 @@
|
||||
{
|
||||
"name": "react-native-appmetrica",
|
||||
"name": "@ijl/react-native-appmetrica",
|
||||
"title": "Yandex AppMetrica React Native Plugin",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.2",
|
||||
"description": "React Native plugin for AppMetrica analytics tool",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/yandexmobile/react-native-appmetrica.git"
|
||||
},
|
||||
"keywords": [
|
||||
"yandex",
|
||||
"appmetrica",
|
||||
"metrica",
|
||||
"analytics",
|
||||
"tracking",
|
||||
"react-native",
|
||||
"ecosystem:react-native",
|
||||
"react-native-ios",
|
||||
"react-native-android"
|
||||
],
|
||||
"author": {
|
||||
"name": "YANDEX LLC"
|
||||
},
|
||||
"license": "MIT",
|
||||
"homepage": "https://appmetrica.yandex.com/docs",
|
||||
"peerDependencies": {
|
||||
"react-native": ">=0.59.0 <1.0.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
}
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user