appsflyer-capacitor-plugin 6.10.3 → 6.12.1-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,8 +14,14 @@
14
14
 
15
15
  ### <a id="plugin-build-for"> This plugin is built for
16
16
 
17
- - Android AppsFlyer SDK **6.10.3**
18
- - iOS AppsFlyer SDK **6.10.1**
17
+ - Android AppsFlyer SDK **6.12.1**
18
+ - iOS AppsFlyer SDK **6.12.1**
19
+
20
+ ## <a id="breaking-changes-6-12-1"> ❗❗ Breaking changes when updating to v6.12.1❗❗
21
+ Starting from v6.12.1, this plugin works only with Capacitor 5. </br>
22
+ 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.
23
+
24
+
19
25
 
20
26
  ## <a id="breaking-changes"> ❗❗ Breaking changes when updating to v6.9.2❗❗
21
27
  Starting from v6.9.2, this plugin works only with Capacitor 4. </br>
@@ -26,22 +26,22 @@ def getPluginBuildVersionFromNpm() {
26
26
 
27
27
  ext {
28
28
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
29
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
30
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
31
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
29
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
30
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
31
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
32
32
  af_sdk_version = getSDKVersionFromNpm()
33
33
  plugin_version = getVersionFromNpm()
34
34
  plugin_build_version = getPluginBuildVersionFromNpm()
35
35
  }
36
36
 
37
37
  buildscript {
38
- ext.kotlin_version = '1.6.10'
38
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.8.20'
39
39
  repositories {
40
40
  google()
41
41
  mavenCentral()
42
42
  }
43
43
  dependencies {
44
- classpath 'com.android.tools.build:gradle:7.2.2'
44
+ classpath 'com.android.tools.build:gradle:8.0.0'
45
45
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
46
46
  classpath 'org.codehaus.groovy:groovy-json:3.0.9'
47
47
  }
@@ -51,10 +51,11 @@ apply plugin: 'com.android.library'
51
51
  apply plugin: 'kotlin-android'
52
52
 
53
53
  android {
54
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
54
+ namespace "capacitor.plugin.appsflyer.sdk"
55
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
55
56
  defaultConfig {
56
57
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
57
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
58
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
58
59
  versionCode Integer.parseInt(plugin_build_version)
59
60
  versionName "$plugin_version"
60
61
  buildConfigField "int", "VERSION_CODE", plugin_build_version
@@ -71,8 +72,11 @@ android {
71
72
  abortOnError false
72
73
  }
73
74
  compileOptions {
74
- sourceCompatibility JavaVersion.VERSION_1_8
75
- targetCompatibility JavaVersion.VERSION_1_8
75
+ sourceCompatibility JavaVersion.VERSION_17
76
+ targetCompatibility JavaVersion.VERSION_17
77
+ }
78
+ buildFeatures {
79
+ buildConfig = true
76
80
  }
77
81
  }
78
82
 
@@ -1,5 +1,5 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="capacitor.plugin.appsflyer.sdk">
2
+ >
3
3
  <uses-permission android:name="android.permission.INTERNET" />
4
4
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5
5
  <uses-permission android:name="com.google.android.gms.permission.AD_ID" />
@@ -3,22 +3,20 @@ package capacitor.plugin.appsflyer.sdk
3
3
  import android.os.Bundle
4
4
  import android.util.Log
5
5
  import com.getcapacitor.JSObject
6
- import com.getcapacitor.PluginCall
7
6
  import org.json.JSONException
8
- import java.util.HashMap
9
7
 
10
8
  object AFHelpers {
11
9
 
12
10
  fun jsonToMap(json: JSObject?): Map<String, Any>? {
13
11
  var newMap: MutableMap<String, Any>? = null
14
12
  json?.run {
15
- newMap = HashMap()
16
- val iterator: Iterator<*> = keys()
17
- while (iterator.hasNext()) {
18
- val key = iterator.next() as String
19
- newMap!![key] = get(key)
20
- }
13
+ newMap = HashMap()
14
+ val iterator: Iterator<*> = keys()
15
+ while (iterator.hasNext()) {
16
+ val key = iterator.next() as String
17
+ newMap!![key] = get(key)
21
18
  }
19
+ }
22
20
  return newMap
23
21
  }
24
22
 
@@ -26,7 +24,7 @@ object AFHelpers {
26
24
  fun jsonToStringMap(json: JSObject?): Map<String, String>? {
27
25
  var newMap: MutableMap<String, String>? = null
28
26
  json?.run {
29
- newMap = HashMap()
27
+ newMap = HashMap()
30
28
  try {
31
29
  val iterator: Iterator<*> = keys()
32
30
  while (iterator.hasNext()) {
@@ -45,14 +43,14 @@ object AFHelpers {
45
43
 
46
44
  fun jsonToBundle(json: JSObject?): Bundle? {
47
45
  val bundle = Bundle()
48
- json?.run {
49
- val iterator: Iterator<*> = keys()
50
- while (iterator.hasNext()) {
51
- val key = iterator.next() as String
52
- val value =get(key) as String
53
- bundle.putString(key,value )
54
- }
46
+ json?.run {
47
+ val iterator: Iterator<*> = keys()
48
+ while (iterator.hasNext()) {
49
+ val key = iterator.next() as String
50
+ val value = get(key) as String
51
+ bundle.putString(key, value)
55
52
  }
53
+ }
56
54
  return bundle
57
55
  }
58
56
 
@@ -9,6 +9,7 @@ import com.appsflyer.deeplink.DeepLinkListener
9
9
  import com.appsflyer.deeplink.DeepLinkResult
10
10
  import com.appsflyer.internal.platform_extension.PluginInfo
11
11
  import com.appsflyer.share.CrossPromotionHelper
12
+ import com.appsflyer.share.LinkGenerator
12
13
  import com.appsflyer.share.ShareInviteHelper
13
14
  import com.getcapacitor.JSObject
14
15
  import com.getcapacitor.Plugin
@@ -245,7 +246,7 @@ class AppsFlyerPlugin : Plugin() {
245
246
  }
246
247
  }
247
248
 
248
- @PluginMethod()
249
+ @PluginMethod
249
250
  fun getAppsFlyerUID(call: PluginCall) {
250
251
  val id = AppsFlyerLib.getInstance().getAppsFlyerUID(context)
251
252
  val obj = JSObject().apply {
@@ -268,7 +269,7 @@ class AppsFlyerPlugin : Plugin() {
268
269
  } ?: run { call.reject("Missing boolean value disable") }
269
270
  }
270
271
 
271
- @PluginMethod()
272
+ @PluginMethod
272
273
  fun stop(call: PluginCall) {
273
274
  val shouldStop = call.getBoolean(AF_STOP)
274
275
  AppsFlyerLib.getInstance().apply {
@@ -283,7 +284,7 @@ class AppsFlyerPlugin : Plugin() {
283
284
  }
284
285
  }
285
286
 
286
- @PluginMethod()
287
+ @PluginMethod
287
288
  fun disableSKAdNetwork(call: PluginCall) {
288
289
  call.unavailable()
289
290
  }
@@ -296,7 +297,7 @@ class AppsFlyerPlugin : Plugin() {
296
297
  } ?: run { call.reject("Missing boolean value shouldDisable") }
297
298
  }
298
299
 
299
- @PluginMethod()
300
+ @PluginMethod
300
301
  fun disableCollectASA(call: PluginCall) {
301
302
  call.unavailable()
302
303
  }
@@ -313,7 +314,7 @@ class AppsFlyerPlugin : Plugin() {
313
314
  }
314
315
  }
315
316
 
316
- @PluginMethod()
317
+ @PluginMethod
317
318
  fun generateInviteLink(call: PluginCall) {
318
319
 
319
320
  val linkGenerator = ShareInviteHelper.generateInviteUrl(context).apply {
@@ -328,7 +329,7 @@ class AppsFlyerPlugin : Plugin() {
328
329
 
329
330
  }
330
331
 
331
- val listener = object : CreateOneLinkHttpTask.ResponseListener {
332
+ val listener = object : LinkGenerator.ResponseListener {
332
333
  override fun onResponse(s: String?) {
333
334
  val obj = JSObject().apply {
334
335
  put(AF_LINK_READY, s)
@@ -388,7 +389,7 @@ class AppsFlyerPlugin : Plugin() {
388
389
  }
389
390
  }
390
391
 
391
- @PluginMethod()
392
+ @PluginMethod
392
393
  fun getSdkVersion(call: PluginCall) {
393
394
  val v = AppsFlyerLib.getInstance().sdkVersion
394
395
  val obj = JSObject().apply {
@@ -397,7 +398,7 @@ class AppsFlyerPlugin : Plugin() {
397
398
  call.resolve(obj)
398
399
  }
399
400
 
400
- @PluginMethod()
401
+ @PluginMethod
401
402
  fun enableFacebookDeferredApplinks(call: PluginCall) {
402
403
  val b = call.getBoolean(AF_FB)
403
404
  if (b != null) {
@@ -412,7 +413,7 @@ class AppsFlyerPlugin : Plugin() {
412
413
  }
413
414
  }
414
415
 
415
- @PluginMethod()
416
+ @PluginMethod
416
417
  fun sendPushNotificationData(call: PluginCall) {
417
418
  val json = call.getObject(AF_PUSH_PAYLOAD)
418
419
  val i = activity.intent
@@ -424,7 +425,7 @@ class AppsFlyerPlugin : Plugin() {
424
425
 
425
426
  }
426
427
 
427
- @PluginMethod()
428
+ @PluginMethod
428
429
  fun logCrossPromoteImpression(call: PluginCall) {
429
430
  val appID =
430
431
  call.getString(AF_APP_ID) ?: return call.reject("cannot extract the appID value")
@@ -445,7 +446,7 @@ class AppsFlyerPlugin : Plugin() {
445
446
 
446
447
  }
447
448
 
448
- @PluginMethod()
449
+ @PluginMethod
449
450
  fun setUserEmails(call: PluginCall) {
450
451
  val emails = call.getArray(AF_EMAILS)?.run {
451
452
  toList<String>().toTypedArray()
@@ -466,7 +467,7 @@ class AppsFlyerPlugin : Plugin() {
466
467
 
467
468
  }
468
469
 
469
- @PluginMethod()
470
+ @PluginMethod
470
471
  fun logLocation(call: PluginCall) {
471
472
  val longitude =
472
473
  call.getDouble(AF_LONGITUDE) ?: return call.reject("cannot extract the longitude value")
@@ -479,7 +480,7 @@ class AppsFlyerPlugin : Plugin() {
479
480
 
480
481
  }
481
482
 
482
- @PluginMethod()
483
+ @PluginMethod
483
484
  fun setPhoneNumber(call: PluginCall) {
484
485
  val phone = call.getString(AF_PHONE) ?: return call.reject("cannot extract the phone value")
485
486
  AppsFlyerLib.getInstance().setPhoneNumber(phone)
@@ -489,7 +490,7 @@ class AppsFlyerPlugin : Plugin() {
489
490
 
490
491
  }
491
492
 
492
- @PluginMethod()
493
+ @PluginMethod
493
494
  fun setPartnerData(call: PluginCall) {
494
495
  val data = AFHelpers.jsonToMap(call.getObject(AF_DATA))
495
496
  ?: return call.reject("cannot extract the data value")
@@ -503,7 +504,7 @@ class AppsFlyerPlugin : Plugin() {
503
504
 
504
505
  }
505
506
 
506
- @PluginMethod()
507
+ @PluginMethod
507
508
  fun logInvite(call: PluginCall) {
508
509
  val data = AFHelpers.jsonToStringMap(call.getObject(AF_EVENT_PARAMETERS))
509
510
  ?: return call.reject("cannot extract the eventParameters value")
@@ -579,9 +580,7 @@ class AppsFlyerPlugin : Plugin() {
579
580
  put("error", s)
580
581
 
581
582
  }
582
-
583
583
  notifyListeners(OAOA_CALLBACK, res)
584
-
585
584
  }
586
585
  }
587
586
  }
@@ -5,7 +5,7 @@ import AppsFlyerLib
5
5
 
6
6
  @objc(AppsFlyerPlugin)
7
7
  public class AppsFlyerPlugin: CAPPlugin {
8
- private let APPSFLYER_PLUGIN_VERSION = "6.10.3"
8
+ private let APPSFLYER_PLUGIN_VERSION = "6.12.1-rc1"
9
9
  private var conversion = true
10
10
  private var oaoa = true
11
11
  private var udl = false
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "appsflyer-capacitor-plugin",
3
- "version": "6.10.3",
4
- "iosSdkVersion": "6.10.1",
5
- "androidSdkVersion": "6.10.3",
6
- "buildNumber": "8",
3
+ "version": "6.12.1-rc1",
4
+ "iosSdkVersion": "6.12.1",
5
+ "androidSdkVersion": "6.12.1",
6
+ "buildNumber": "72",
7
7
  "description": "AppsFlyer SDK plugin for Capacitor",
8
8
  "main": "dist/plugin.cjs.js",
9
9
  "module": "dist/esm/index.js",
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@angular/cli": "^12.1.1",
57
- "@capacitor/android": "^4.0.0",
58
- "@capacitor/core": "^4.0.0",
57
+ "@capacitor/android": "^5.0.0",
58
+ "@capacitor/core": "^5.0.0",
59
59
  "@capacitor/docgen": "^0.2.0",
60
- "@capacitor/ios": "^4.0.0",
60
+ "@capacitor/ios": "^5.0.0",
61
61
  "@ionic/eslint-config": "^0.3.0",
62
62
  "@ionic/prettier-config": "^1.0.1",
63
63
  "@ionic/swiftlint-config": "^1.1.2",
@@ -70,7 +70,7 @@
70
70
  "typescript": "~4.0.3"
71
71
  },
72
72
  "peerDependencies": {
73
- "@capacitor/core": "^4.0.0"
73
+ "@capacitor/core": "^5.0.0"
74
74
  },
75
75
  "prettier": "@ionic/prettier-config",
76
76
  "swiftlint": "@ionic/swiftlint-config",