-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from tenjin/dg/release-1.0.5
Release 1.0.5
- Loading branch information
Showing
39 changed files
with
484 additions
and
254 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# React Native Tenjin Plugin | ||
|
||
# Summary | ||
Tenjin's SDK allows users to track events and installs in their apps. To learn more about Tenjin and our product offering, please visit https://www.tenjin.com. | ||
|
||
The Tenjin React Native Plugin allows users to track events and installs in their iOS/Android apps. To learn more about Tenjin and our product offering, please visit https://www.tenjin.com. | ||
|
||
### Notes: | ||
|
||
|
@@ -101,31 +102,74 @@ Parameters: | |
- `name`: String | ||
- `value`: String | ||
|
||
### Get attribution info | ||
```javascript | ||
Tenjin.getAttributionInfo( | ||
(success) => { | ||
console.log(`Attibution info found! ${success}`); | ||
}, | ||
() => { | ||
console.error(`Attribution info failed`); | ||
} | ||
) | ||
``` | ||
Parameters: | ||
- `successCallback`: Callback | ||
- `errorCallback`: Callback | ||
|
||
### Append app subversion | ||
```javascript | ||
Tenjin.appendAppSubversion(subversion) | ||
``` | ||
Parameters: | ||
- `subversion`: Number | ||
|
||
### <a id="ilrd"></a>Impression Level Ad Revenue Integration | ||
### Customer User ID | ||
```javascript | ||
Tenjin.setCustomerUserId(userId) | ||
``` | ||
Parameters: | ||
- `userId`: string | ||
|
||
Tenjin supports the ability to integrate with the Impression Level Ad Revenue (ILRD) feature from, | ||
- AppLovin | ||
- IronSource | ||
- HyperBid | ||
- AdMob | ||
- TopOn | ||
```javascript | ||
Tenjin.getCustomerUserId() | ||
``` | ||
Returns: callback -> `string` | ||
|
||
This feature allows you to receive events which correspond to your ad revenue that is affected by each advertisement show to a user. To enable this feature, follow the below instructions. | ||
### Send AdMob impression (ILRD) | ||
```javascript | ||
Tenjin.eventAdImpressionAdMob(json) | ||
``` | ||
Parameters: | ||
- `json`: JSON | ||
|
||
:warning: **NOTE: ILRD is a paid feature, so please contact your Tenjin account manager to discuss the price at first before sending ILRD events.** | ||
### Send AppLovin impression (ILRD) | ||
```javascript | ||
Tenjin.eventAdImpressionAppLovin(json) | ||
``` | ||
Parameters: | ||
- `json`: JSON | ||
|
||
### <a id="attributionInfo"></a>Attribution Info | ||
### Send HyperBid impression (ILRD) | ||
```javascript | ||
Tenjin.eventAdImpressionHyperBid(json) | ||
``` | ||
Parameters: | ||
- `json`: JSON | ||
|
||
Tenjin supports retrieving of attributes, which are required for developers to get analytics installation id (previously known as tenjin reference id). This parameter can be used when there is no advertising id. | ||
### Send IronSource impression (ILRD) | ||
```javascript | ||
Tenjin.eventAdImpressionIronSource(json) | ||
``` | ||
Parameters: | ||
- `json`: JSON | ||
|
||
:warning: **NOTE: Attribution Info is a paid feature, so please contact your Tenjin account manager if you are interested in.** | ||
### Send TopOn impression (ILRD) | ||
```javascript | ||
Tenjin.eventAdImpressionTopOn(json) | ||
``` | ||
Parameters: | ||
- `json`: JSON | ||
|
||
## Support | ||
If you have any issues with the plugin integration or usage, please contact us to [email protected] |
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 |
---|---|---|
@@ -1,139 +1,78 @@ | ||
buildscript { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.5.3' | ||
} | ||
dependencies { | ||
classpath "com.android.tools.build:gradle:7.2.1" | ||
} | ||
} | ||
|
||
def isNewArchitectureEnabled() { | ||
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" | ||
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: "com.android.library" | ||
|
||
|
||
def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') } | ||
|
||
if (isNewArchitectureEnabled()) { | ||
apply plugin: 'com.facebook.react' | ||
apply plugin: "com.facebook.react" | ||
} | ||
|
||
def getExtOrDefault(name) { | ||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['TenjinSdk_' + name] | ||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Tenjin_" + name] | ||
} | ||
|
||
def getExtOrIntegerDefault(name) { | ||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['TenjinSdk_' + name]).toInteger() | ||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Tenjin_" + name]).toInteger() | ||
} | ||
|
||
android { | ||
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') | ||
|
||
defaultConfig { | ||
minSdkVersion getExtOrIntegerDefault('minSdkVersion') | ||
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') | ||
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
} | ||
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") | ||
|
||
defaultConfig { | ||
minSdkVersion getExtOrIntegerDefault("minSdkVersion") | ||
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") | ||
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
} | ||
} | ||
|
||
lintOptions { | ||
disable 'GradleCompatible' | ||
} | ||
lintOptions { | ||
disable "GradleCompatible" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
google() | ||
|
||
def found = false | ||
def defaultDir = null | ||
def androidSourcesName = 'React Native sources' | ||
|
||
if (rootProject.ext.has('reactNativeAndroidRoot')) { | ||
defaultDir = rootProject.ext.get('reactNativeAndroidRoot') | ||
} else { | ||
defaultDir = new File( | ||
projectDir, | ||
'/../../../node_modules/react-native/android' | ||
) | ||
} | ||
|
||
if (defaultDir.exists()) { | ||
maven { | ||
url defaultDir.toString() | ||
name androidSourcesName | ||
} | ||
|
||
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") | ||
found = true | ||
} else { | ||
def parentDir = rootProject.projectDir | ||
|
||
1.upto(5, { | ||
if (found) return true | ||
parentDir = parentDir.parentFile | ||
|
||
def androidSourcesDir = new File( | ||
parentDir, | ||
'node_modules/react-native' | ||
) | ||
|
||
def androidPrebuiltBinaryDir = new File( | ||
parentDir, | ||
'node_modules/react-native/android' | ||
) | ||
|
||
if (androidPrebuiltBinaryDir.exists()) { | ||
maven { | ||
url androidPrebuiltBinaryDir.toString() | ||
name androidSourcesName | ||
} | ||
|
||
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") | ||
found = true | ||
} else if (androidSourcesDir.exists()) { | ||
maven { | ||
url androidSourcesDir.toString() | ||
name androidSourcesName | ||
} | ||
|
||
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") | ||
found = true | ||
} | ||
}) | ||
} | ||
|
||
if (!found) { | ||
throw new GradleException( | ||
"${project.name}: unable to locate React Native android sources. " + | ||
"Ensure you have you installed React Native as a dependency in your project and try again." | ||
) | ||
} | ||
mavenCentral() | ||
google() | ||
} | ||
|
||
|
||
dependencies { | ||
//noinspection GradleDynamicVersion | ||
implementation "com.facebook.react:react-native:+" | ||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) | ||
implementation files('libs/tenjin.aar') | ||
// From node_modules | ||
// For < 0.71, this will be from the local maven repo | ||
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin | ||
//noinspection GradleDynamicVersion | ||
implementation "com.facebook.react:react-native:+" | ||
implementation 'com.tenjin:android-sdk:1.12.20' | ||
} | ||
|
||
if (isNewArchitectureEnabled()) { | ||
react { | ||
jsRootDir = file("../src/") | ||
libraryName = "Tenjin" | ||
codegenJavaPackageName = "com.reactnativetenjinsdk" | ||
} | ||
react { | ||
jsRootDir = file("../src/") | ||
libraryName = "Tenjin" | ||
codegenJavaPackageName = "com.tenjin" | ||
} | ||
} |
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,5 @@ | ||
Tenjin_kotlinVersion=1.7.0 | ||
Tenjin_minSdkVersion=21 | ||
Tenjin_targetSdkVersion=31 | ||
Tenjin_compileSdkVersion=31 | ||
Tenjin_ndkversion=21.4.7075529 |
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<!-- AndroidManifest.xml --> | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.reactlibrary"> | ||
package="com.tenjin"> | ||
|
||
</manifest> |
Binary file not shown.
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
2 changes: 1 addition & 1 deletion
2
.../java/com/reactlibrary/TenjinPackage.java → ...c/main/java/com/tenjin/TenjinPackage.java
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
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,3 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
// Tenjin.h | ||
|
||
#ifdef RCT_NEW_ARCH_ENABLED | ||
#import "RNTenjinSpec.h" | ||
|
||
@interface Tenjin : NSObject <NativeTenjinSpec> | ||
#else | ||
#import <React/RCTBridgeModule.h> | ||
|
||
@interface Tenjin : NSObject <RCTBridgeModule> | ||
#endif | ||
|
||
@end |
Oops, something went wrong.