diff --git a/.github/workflows/build-apps-workflow.yml b/.github/workflows/build-apps-workflow.yml
index fc7f6f4..486fed3 100644
--- a/.github/workflows/build-apps-workflow.yml
+++ b/.github/workflows/build-apps-workflow.yml
@@ -13,7 +13,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
- java-version: '11'
+ java-version: '17'
- name: Setup Node.js
uses: actions/setup-node@v3
@@ -39,7 +39,7 @@ jobs:
gradle wrapper
echo "ls: $(ls)"
chmod +x ./gradlew
- ./gradlew wrapper --gradle-version 7.6.1
+ ./gradlew wrapper --gradle-version 8.0.2
./gradlew clean assembleRelease
# Build-Capacitor-ios:
diff --git a/.github/workflows/deploy-to-QA.yml b/.github/workflows/deploy-to-QA.yml
index f82a279..eefe4d2 100644
--- a/.github/workflows/deploy-to-QA.yml
+++ b/.github/workflows/deploy-to-QA.yml
@@ -69,4 +69,4 @@ jobs:
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$JIRA_FIXED_VERSION"
CHANGES=$(cat "$JIRA_FIXED_VERSION-releasenotes".txt)
- curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"${{env.JIRA_FIXED_VERSION}}"'", "deploy_type": "QA", "install_tag": "QA", "git_branch": "'"$RELEASE_BRANCH_NAME"'", "changes_and_fixes": "'"$CHANGES"'", "plugin_version": "'"${{env.PLUGIN_VERSION}}"'", "android_dependency": "'"$ANDROID_SDK_VERSION"'", "ios_dependency": "'"$IOS_SDK_VERSION"'"}' "$SLACK_TOKEN"
+ curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"$JIRA_FIXED_VERSION"'", "deploy_type": "QA", "install_tag": "QA", "git_branch": "'"$RELEASE_BRANCH_NAME"'", "changes_and_fixes": "'"$CHANGES"'", "plugin_version": "'"${{env.PLUGIN_VERSION}}"'", "android_dependency": "'"$ANDROID_SDK_VERSION"'", "ios_dependency": "'"$IOS_SDK_VERSION"'"}' "$SLACK_TOKEN"
diff --git a/.github/workflows/release-Production-workflow.yml b/.github/workflows/release-Production-workflow.yml
index bd37fc8..0cdd1ae 100644
--- a/.github/workflows/release-Production-workflow.yml
+++ b/.github/workflows/release-Production-workflow.yml
@@ -96,4 +96,4 @@ jobs:
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$JIRA_FIXED_VERSION"
CHANGES=$(cat "$JIRA_FIXED_VERSION-releasenotes".txt)
- curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"${{env.JIRA_FIXED_VERSION}}"'", "deploy_type": "Production", "install_tag": "latest", "git_branch": "'"$RELEASE_BRANCH_NAME"'", "changes_and_fixes": "'"$CHANGES"'", "plugin_version": "'"${{env.PLUGIN_VERSION}}"'", "android_dependency": "'"$ANDROID_SDK_VERSION"'", "ios_dependency": "'"$IOS_SDK_VERSION"'"}' "$SLACK_TOKEN"
+ curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"$JIRA_FIXED_VERSION"'", "deploy_type": "Production", "install_tag": "latest", "git_branch": "'"$RELEASE_BRANCH_NAME"'", "changes_and_fixes": "'"$CHANGES"'", "plugin_version": "'"${{env.PLUGIN_VERSION}}"'", "android_dependency": "'"$ANDROID_SDK_VERSION"'", "ios_dependency": "'"$IOS_SDK_VERSION"'"}' "$SLACK_TOKEN"
diff --git a/.gitignore b/.gitignore
index be7e018..5f4df65 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,10 @@
# node files
dist
node_modules
-
+examples/CapacitorReact/android
+examples/CapacitorReact/ios
+examples/CapacitorReact/node_modules
+examples/CapacitorReact/package-lock.json
# iOS files
Pods
Podfile.lock
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 43f79b2..d474e5b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 6.12.1
+ Release date: *2023-07-31*
+
+- Capacitor >> Update version to Capacitor v5
+
## 6.10.3
Release date: *2023-05-01*
diff --git a/README.md b/README.md
index 63847e3..a28ccc7 100644
--- a/README.md
+++ b/README.md
@@ -14,8 +14,14 @@
### This plugin is built for
-- Android AppsFlyer SDK **6.10.3**
-- iOS AppsFlyer SDK **6.10.1**
+- Android AppsFlyer SDK **6.12.1**
+- iOS AppsFlyer SDK **6.12.1**
+
+## ❗❗ Breaking changes when updating to v6.12.1❗❗
+Starting from v6.12.1, this plugin works only with Capacitor 5.
+If you are still interested in using Capacitor 4, please follow the instructions [here](/docs/Installation.md#cap4) to install the latest version that supports Capacitor 4.
+
+
## ❗❗ Breaking changes when updating to v6.9.2❗❗
Starting from v6.9.2, this plugin works only with Capacitor 4.
diff --git a/android/build.gradle b/android/build.gradle
index d841a3b..e5481c5 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -26,22 +26,22 @@ def getPluginBuildVersionFromNpm() {
ext {
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
af_sdk_version = getSDKVersionFromNpm()
plugin_version = getVersionFromNpm()
plugin_build_version = getPluginBuildVersionFromNpm()
}
buildscript {
- ext.kotlin_version = '1.6.10'
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.8.20'
repositories {
google()
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.2.2'
+ classpath 'com.android.tools.build:gradle:8.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.codehaus.groovy:groovy-json:3.0.9'
}
@@ -51,10 +51,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
+ namespace "capacitor.plugin.appsflyer.sdk"
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
defaultConfig {
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
versionCode Integer.parseInt(plugin_build_version)
versionName "$plugin_version"
buildConfigField "int", "VERSION_CODE", plugin_build_version
@@ -71,8 +72,11 @@ android {
abortOnError false
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+ buildFeatures {
+ buildConfig = true
}
}
diff --git a/android/gradle.properties b/android/gradle.properties
index 0566c22..92710f3 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -20,5 +20,4 @@ org.gradle.jvmargs=-Xmx1536m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
-# Automatically convert third-party libraries to use AndroidX
-android.enableJetifier=true
+
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 92f06b5..3796d3c 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
index 0927432..d6f639c 100644
--- a/android/src/main/AndroidManifest.xml
+++ b/android/src/main/AndroidManifest.xml
@@ -1,5 +1,5 @@
+ >
diff --git a/android/src/main/java/capacitor/plugin/appsflyer/sdk/AFHelpers.kt b/android/src/main/java/capacitor/plugin/appsflyer/sdk/AFHelpers.kt
index f042436..6094f4f 100644
--- a/android/src/main/java/capacitor/plugin/appsflyer/sdk/AFHelpers.kt
+++ b/android/src/main/java/capacitor/plugin/appsflyer/sdk/AFHelpers.kt
@@ -3,22 +3,20 @@ package capacitor.plugin.appsflyer.sdk
import android.os.Bundle
import android.util.Log
import com.getcapacitor.JSObject
-import com.getcapacitor.PluginCall
import org.json.JSONException
-import java.util.HashMap
object AFHelpers {
fun jsonToMap(json: JSObject?): Map? {
var newMap: MutableMap? = null
json?.run {
- newMap = HashMap()
- val iterator: Iterator<*> = keys()
- while (iterator.hasNext()) {
- val key = iterator.next() as String
- newMap!![key] = get(key)
- }
+ newMap = HashMap()
+ val iterator: Iterator<*> = keys()
+ while (iterator.hasNext()) {
+ val key = iterator.next() as String
+ newMap!![key] = get(key)
}
+ }
return newMap
}
@@ -26,7 +24,7 @@ object AFHelpers {
fun jsonToStringMap(json: JSObject?): Map? {
var newMap: MutableMap? = null
json?.run {
- newMap = HashMap()
+ newMap = HashMap()
try {
val iterator: Iterator<*> = keys()
while (iterator.hasNext()) {
@@ -45,14 +43,14 @@ object AFHelpers {
fun jsonToBundle(json: JSObject?): Bundle? {
val bundle = Bundle()
- json?.run {
- val iterator: Iterator<*> = keys()
- while (iterator.hasNext()) {
- val key = iterator.next() as String
- val value =get(key) as String
- bundle.putString(key,value )
- }
+ json?.run {
+ val iterator: Iterator<*> = keys()
+ while (iterator.hasNext()) {
+ val key = iterator.next() as String
+ val value = get(key) as String
+ bundle.putString(key, value)
}
+ }
return bundle
}
diff --git a/android/src/main/java/capacitor/plugin/appsflyer/sdk/AppsFlyerPlugin.kt b/android/src/main/java/capacitor/plugin/appsflyer/sdk/AppsFlyerPlugin.kt
index 1fd75ab..1a317b2 100644
--- a/android/src/main/java/capacitor/plugin/appsflyer/sdk/AppsFlyerPlugin.kt
+++ b/android/src/main/java/capacitor/plugin/appsflyer/sdk/AppsFlyerPlugin.kt
@@ -9,6 +9,7 @@ import com.appsflyer.deeplink.DeepLinkListener
import com.appsflyer.deeplink.DeepLinkResult
import com.appsflyer.internal.platform_extension.PluginInfo
import com.appsflyer.share.CrossPromotionHelper
+import com.appsflyer.share.LinkGenerator
import com.appsflyer.share.ShareInviteHelper
import com.getcapacitor.JSObject
import com.getcapacitor.Plugin
@@ -245,7 +246,7 @@ class AppsFlyerPlugin : Plugin() {
}
}
- @PluginMethod()
+ @PluginMethod
fun getAppsFlyerUID(call: PluginCall) {
val id = AppsFlyerLib.getInstance().getAppsFlyerUID(context)
val obj = JSObject().apply {
@@ -268,7 +269,7 @@ class AppsFlyerPlugin : Plugin() {
} ?: run { call.reject("Missing boolean value disable") }
}
- @PluginMethod()
+ @PluginMethod
fun stop(call: PluginCall) {
val shouldStop = call.getBoolean(AF_STOP)
AppsFlyerLib.getInstance().apply {
@@ -283,7 +284,7 @@ class AppsFlyerPlugin : Plugin() {
}
}
- @PluginMethod()
+ @PluginMethod
fun disableSKAdNetwork(call: PluginCall) {
call.unavailable()
}
@@ -296,7 +297,7 @@ class AppsFlyerPlugin : Plugin() {
} ?: run { call.reject("Missing boolean value shouldDisable") }
}
- @PluginMethod()
+ @PluginMethod
fun disableCollectASA(call: PluginCall) {
call.unavailable()
}
@@ -313,7 +314,7 @@ class AppsFlyerPlugin : Plugin() {
}
}
- @PluginMethod()
+ @PluginMethod
fun generateInviteLink(call: PluginCall) {
val linkGenerator = ShareInviteHelper.generateInviteUrl(context).apply {
@@ -328,7 +329,7 @@ class AppsFlyerPlugin : Plugin() {
}
- val listener = object : CreateOneLinkHttpTask.ResponseListener {
+ val listener = object : LinkGenerator.ResponseListener {
override fun onResponse(s: String?) {
val obj = JSObject().apply {
put(AF_LINK_READY, s)
@@ -388,7 +389,7 @@ class AppsFlyerPlugin : Plugin() {
}
}
- @PluginMethod()
+ @PluginMethod
fun getSdkVersion(call: PluginCall) {
val v = AppsFlyerLib.getInstance().sdkVersion
val obj = JSObject().apply {
@@ -397,7 +398,7 @@ class AppsFlyerPlugin : Plugin() {
call.resolve(obj)
}
- @PluginMethod()
+ @PluginMethod
fun enableFacebookDeferredApplinks(call: PluginCall) {
val b = call.getBoolean(AF_FB)
if (b != null) {
@@ -412,7 +413,7 @@ class AppsFlyerPlugin : Plugin() {
}
}
- @PluginMethod()
+ @PluginMethod
fun sendPushNotificationData(call: PluginCall) {
val json = call.getObject(AF_PUSH_PAYLOAD)
val i = activity.intent
@@ -424,7 +425,7 @@ class AppsFlyerPlugin : Plugin() {
}
- @PluginMethod()
+ @PluginMethod
fun logCrossPromoteImpression(call: PluginCall) {
val appID =
call.getString(AF_APP_ID) ?: return call.reject("cannot extract the appID value")
@@ -445,7 +446,7 @@ class AppsFlyerPlugin : Plugin() {
}
- @PluginMethod()
+ @PluginMethod
fun setUserEmails(call: PluginCall) {
val emails = call.getArray(AF_EMAILS)?.run {
toList().toTypedArray()
@@ -466,7 +467,7 @@ class AppsFlyerPlugin : Plugin() {
}
- @PluginMethod()
+ @PluginMethod
fun logLocation(call: PluginCall) {
val longitude =
call.getDouble(AF_LONGITUDE) ?: return call.reject("cannot extract the longitude value")
@@ -479,7 +480,7 @@ class AppsFlyerPlugin : Plugin() {
}
- @PluginMethod()
+ @PluginMethod
fun setPhoneNumber(call: PluginCall) {
val phone = call.getString(AF_PHONE) ?: return call.reject("cannot extract the phone value")
AppsFlyerLib.getInstance().setPhoneNumber(phone)
@@ -489,7 +490,7 @@ class AppsFlyerPlugin : Plugin() {
}
- @PluginMethod()
+ @PluginMethod
fun setPartnerData(call: PluginCall) {
val data = AFHelpers.jsonToMap(call.getObject(AF_DATA))
?: return call.reject("cannot extract the data value")
@@ -503,7 +504,7 @@ class AppsFlyerPlugin : Plugin() {
}
- @PluginMethod()
+ @PluginMethod
fun logInvite(call: PluginCall) {
val data = AFHelpers.jsonToStringMap(call.getObject(AF_EVENT_PARAMETERS))
?: return call.reject("cannot extract the eventParameters value")
@@ -579,9 +580,7 @@ class AppsFlyerPlugin : Plugin() {
put("error", s)
}
-
notifyListeners(OAOA_CALLBACK, res)
-
}
}
}
diff --git a/docs/Installation.md b/docs/Installation.md
index 30acbcf..5cb4e95 100644
--- a/docs/Installation.md
+++ b/docs/Installation.md
@@ -7,6 +7,18 @@ The plugin available via npm. To install the plugin, please run the following co
npm install appsflyer-capacitor-plugin
npx cap sync
```
+## Capacitor 4 - Latest Version
+The latest version that supports Capacitor 4 uses the following SDK versions:
+- Android AppsFlyer SDK **6.10.3️**
+- iOS AppsFlyer SDK **6.10.1️**
+
+The plugin available via npm under the tag `latest-4`. To install the plugin, please run the following commands in your project root directory.
+
+ ```bash
+ npm install appsflyer-capacitor-plugin@latest-4
+ npx cap sync
+ ```
+
## Capacitor 3 - Latest Version
The latest version that supports Capacitor 3 uses the following SDK versions:
diff --git a/examples/CapacitorReact/package.json b/examples/CapacitorReact/package.json
index 7fa4bd9..d163fab 100644
--- a/examples/CapacitorReact/package.json
+++ b/examples/CapacitorReact/package.json
@@ -3,13 +3,13 @@
"version": "0.0.1",
"private": true,
"dependencies": {
- "@capacitor/android": "^4.0.0",
- "@capacitor/app": "^4.0.0",
- "@capacitor/core": "^4.0.0",
- "@capacitor/haptics": "^4.0.0",
- "@capacitor/ios": "^4.0.0",
- "@capacitor/keyboard": "^4.0.0",
- "@capacitor/status-bar": "^4.0.0",
+ "@capacitor/android": "^5.0.0",
+ "@capacitor/app": "^5.0.0",
+ "@capacitor/core": "^5.0.0",
+ "@capacitor/haptics": "^5.0.0",
+ "@capacitor/ios": "^5.0.0",
+ "@capacitor/keyboard": "^5.0.0",
+ "@capacitor/status-bar": "^5.0.0",
"@ionic/react": "^5.5.0",
"@ionic/react-router": "^5.5.0",
"@testing-library/jest-dom": "^5.11.9",
@@ -51,7 +51,8 @@
"eject": "react-scripts eject",
"installFromNpm": "npm install appsflyer-capacitor-plugin && npx cap sync",
"installQA": "npm install appsflyer-capacitor-plugin@QA && npx cap sync",
- "removePlugin": "npm uninstall appsflyer-capacitor-plugin && npx cap sync"
+ "removePlugin": "npm uninstall appsflyer-capacitor-plugin && npx cap sync",
+ "installLocal": "npm install ../../ && npx cap sync"
},
"eslintConfig": {
"extends": [
@@ -72,7 +73,7 @@
]
},
"devDependencies": {
- "@capacitor/cli": "^4.0.0"
+ "@capacitor/cli": "^5.0.0"
},
"description": "An Ionic project"
}
diff --git a/ios/Plugin/AppsFlyerPlugin.swift b/ios/Plugin/AppsFlyerPlugin.swift
index 39d1d4d..8207035 100644
--- a/ios/Plugin/AppsFlyerPlugin.swift
+++ b/ios/Plugin/AppsFlyerPlugin.swift
@@ -5,7 +5,7 @@ import AppsFlyerLib
@objc(AppsFlyerPlugin)
public class AppsFlyerPlugin: CAPPlugin {
- private let APPSFLYER_PLUGIN_VERSION = "6.10.3"
+ private let APPSFLYER_PLUGIN_VERSION = "6.12.1"
private var conversion = true
private var oaoa = true
private var udl = false
diff --git a/package.json b/package.json
index 762d92a..4084cf5 100644
--- a/package.json
+++ b/package.json
@@ -1,9 +1,9 @@
{
"name": "appsflyer-capacitor-plugin",
- "version": "6.10.3",
- "iosSdkVersion": "6.10.1",
- "androidSdkVersion": "6.10.3",
- "buildNumber": "8",
+ "version": "6.12.1",
+ "iosSdkVersion": "6.12.1",
+ "androidSdkVersion": "6.12.1",
+ "buildNumber": "10",
"description": "AppsFlyer SDK plugin for Capacitor",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
@@ -54,10 +54,10 @@
},
"devDependencies": {
"@angular/cli": "^12.1.1",
- "@capacitor/android": "^4.0.0",
- "@capacitor/core": "^4.0.0",
+ "@capacitor/android": "^5.0.0",
+ "@capacitor/core": "^5.0.0",
"@capacitor/docgen": "^0.2.0",
- "@capacitor/ios": "^4.0.0",
+ "@capacitor/ios": "^5.0.0",
"@ionic/eslint-config": "^0.3.0",
"@ionic/prettier-config": "^1.0.1",
"@ionic/swiftlint-config": "^1.1.2",
@@ -70,7 +70,7 @@
"typescript": "~4.0.3"
},
"peerDependencies": {
- "@capacitor/core": "^4.0.0"
+ "@capacitor/core": "^5.0.0"
},
"prettier": "@ionic/prettier-config",
"swiftlint": "@ionic/swiftlint-config",