Compare commits

...

7 Commits

Author SHA1 Message Date
d9bd3d8f4d 2.0.2 2023-08-08 16:29:05 +03:00
bcafff0667 fix read me 2023-08-08 16:28:59 +03:00
5c66d1a594 2.0.1 2023-08-08 16:27:05 +03:00
c55d66f0ee fix read me 2023-08-08 16:26:58 +03:00
8b148a3a0d gradle 7 compatibility fast way 2023-08-08 16:21:48 +03:00
NesterovichAlexey
3825b3f1e0
Use false for firstActivationAsUpdate 2021-12-09 13:56:22 +03:00
NesterovichAlexey
b651948d45
fix activation method in README.md 2020-12-22 15:03:52 +03:00
3 changed files with 47 additions and 73 deletions

View File

@ -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).

View File

@ -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
// }
// }
// }

View File

@ -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": {}
}