appsflyer-capacitor-plugin 6.5.2-rc1 → 6.8.0-rc2
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/CHANGELOG.md +10 -1
- package/README.md +2 -2
- package/android/build.gradle +3 -3
- package/android/src/main/AndroidManifest.xml +2 -1
- package/android/src/main/java/capacitor/plugin/appsflyer/sdk/AFHelpers.kt +1 -1
- package/android/src/main/java/capacitor/plugin/appsflyer/sdk/AppsFlyerConstants.kt +59 -63
- package/android/src/main/java/capacitor/plugin/appsflyer/sdk/AppsFlyerPlugin.kt +65 -103
- package/dist/esm/definitions.d.ts +6 -0
- package/ios/Plugin/AppsFlyerPlugin.swift +4 -0
- package/package.json +2 -2
- package/src/definitions.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Release Notes
|
|
2
|
-
### 6.
|
|
2
|
+
### 6.8.0-rc2
|
|
3
|
+
Release date: *2022-July-20*
|
|
4
|
+
- Updated AppsFlyer Android SDK to v6.8.0
|
|
5
|
+
- Updated AppsFlyer iOS SDK to v6.8.0
|
|
6
|
+
|
|
7
|
+
**Overview and Highlights:**
|
|
8
|
+
- Capacitor >> update SDKs versions
|
|
9
|
+
- Capacitor >> readme >> add AD_ID docs
|
|
10
|
+
- Capacitor >> Android >> add `setDisableNetworkData` API
|
|
11
|
+
### 6.5.2
|
|
3
12
|
Release date: *2022-February-07*
|
|
4
13
|
- Updated AppsFlyer Android SDK to v6.5.2
|
|
5
14
|
- Updated AppsFlyer iOS SDK to v6.5.2
|
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
### <a id="plugin-build-for"> This plugin is built for
|
|
16
16
|
|
|
17
|
-
- Android AppsFlyer SDK **6.
|
|
18
|
-
- iOS AppsFlyer SDK **6.
|
|
17
|
+
- Android AppsFlyer SDK **6.5.2️**
|
|
18
|
+
- iOS AppsFlyer SDK **6.8.0️**
|
|
19
19
|
|
|
20
20
|
<!---
|
|
21
21
|
## <a id="breaking-changes"> ❗❗ Breaking changes when updating to ✏️v*.*.*✏️❗❗
|
package/android/build.gradle
CHANGED
|
@@ -22,10 +22,10 @@ apply plugin: 'com.android.library'
|
|
|
22
22
|
apply plugin: 'kotlin-android'
|
|
23
23
|
|
|
24
24
|
android {
|
|
25
|
-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
25
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
|
|
26
26
|
defaultConfig {
|
|
27
27
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
|
|
28
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
28
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
|
|
29
29
|
versionCode 1
|
|
30
30
|
versionName "1.0"
|
|
31
31
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -62,7 +62,7 @@ dependencies {
|
|
|
62
62
|
implementation "androidx.core:core-ktx:1.6.0"
|
|
63
63
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
64
64
|
|
|
65
|
-
implementation 'com.appsflyer:af-android-sdk:6.
|
|
65
|
+
implementation 'com.appsflyer:af-android-sdk:6.8.0'
|
|
66
66
|
implementation "com.android.installreferrer:installreferrer:2.2"
|
|
67
67
|
|
|
68
68
|
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
package="capacitor.plugin.appsflyer.sdk">
|
|
3
3
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
4
4
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
5
|
-
<uses-permission android:name="android.permission.
|
|
5
|
+
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
|
|
6
|
+
|
|
6
7
|
</manifest>
|
|
@@ -1,65 +1,61 @@
|
|
|
1
1
|
package capacitor.plugin.appsflyer.sdk
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
3
|
+
const val TAG = "AppsFlyer_6.3.50_Cap"
|
|
4
|
+
const val AF_APP_ID = "appID"
|
|
5
|
+
const val AF_DEV_KEY = "devKey"
|
|
6
|
+
const val AF_DEBUG = "isDebug"
|
|
7
|
+
const val AF_CONVERSION_LISTENER = "registerConversionListener"
|
|
8
|
+
const val AF_OAOA = "registerConversionListener"
|
|
9
|
+
const val AF_UDL = "registerOnDeepLink"
|
|
10
|
+
const val AF_EVENT_NAME = "eventName"
|
|
11
|
+
const val AF_EVENT_VALUE = "eventValue"
|
|
12
|
+
const val CONVERSION_CALLBACK = "conversion_callback"
|
|
13
|
+
const val OAOA_CALLBACK = "oaoa_callback"
|
|
14
|
+
const val UDL_CALLBACK = "udl_callback"
|
|
15
|
+
const val AF_CUID = "cuid"
|
|
16
|
+
const val AF_CURRENCY_CODE = "currencyCode"
|
|
17
|
+
const val AF_TOKEN = "token"
|
|
18
|
+
const val AF_ONELINK_ID = "onelinkID"
|
|
19
|
+
const val AF_ONELINK_DOMAIN = "domains"
|
|
20
|
+
const val AF_DEEPLINK_URLS = "urls"
|
|
21
|
+
const val AF_UID = "uid"
|
|
22
|
+
const val AF_ANONYMIZE_USER = "anonymizeUser"
|
|
23
|
+
const val AF_DISABLE = "shouldDisable"
|
|
24
|
+
const val AF_STOP = "stop"
|
|
25
|
+
const val AF_IS_STOP = "isStopped"
|
|
26
|
+
const val AF_PATH = "path"
|
|
27
|
+
const val AF_FILTERS = "filters"
|
|
28
|
+
const val AF_ADDITIONAL_DATA = "additionalData"
|
|
29
|
+
const val AF_DISABLE_SKAD = "shouldDisable"
|
|
30
|
+
const val AF_HOST_PREFIX = "hostPrefixName"
|
|
31
|
+
const val AF_HOST_NAME = "hostName"
|
|
32
|
+
const val AF_BRAND_DOMAIN = "brandDomain"
|
|
33
|
+
const val AF_CAMPAIGN = "campaign"
|
|
34
|
+
const val AF_CHANNEL = "channel"
|
|
35
|
+
const val AF_REFERRER_NAME = "referrerName"
|
|
36
|
+
const val AF_REFERRER_IMAGE_URL = "referrerImageURL"
|
|
37
|
+
const val AF_ADD_PARAMETERS = "addParameters"
|
|
38
|
+
const val AF_REFERRER_CUSTOMER_ID = "referrerCustomerId"
|
|
39
|
+
const val AF_BASE_DEEPLINK = "baseDeeplink"
|
|
40
|
+
const val AF_LINK_READY = "link"
|
|
41
|
+
const val AF_PUBLIC_KEY = "publicKey"
|
|
42
|
+
const val AF_SIGNATURE = "signature"
|
|
43
|
+
const val AF_PURCHASE_DATA = "purchaseData"
|
|
44
|
+
const val AF_CURRENCY = "currency"
|
|
45
|
+
const val AF_PRICE = "price"
|
|
46
|
+
const val AF_ADDITIONAL_PARAMETERS = "additionalParameters"
|
|
47
|
+
const val AF_FB = "enableFacebookDAL"
|
|
48
|
+
const val AF_PUSH_PAYLOAD = "pushPayload"
|
|
49
|
+
const val AF_MIN_TIME = "minTimeBetweenSessions"
|
|
50
|
+
const val AF_PARAMETERS = "parameters"
|
|
51
|
+
const val AF_CONTAINS = "contains"
|
|
52
|
+
const val AF_EMAILS = "emails"
|
|
53
|
+
const val AF_ENCODE = "encode"
|
|
54
|
+
const val AF_NULL_DEV_KEY = "Dev key is null"
|
|
55
|
+
const val AF_LATITUDE = "latitude"
|
|
56
|
+
const val AF_LONGITUDE = "longitude"
|
|
57
|
+
const val AF_PHONE = "phone"
|
|
58
|
+
const val AF_DATA = "data"
|
|
59
|
+
const val AF_PARTNER_ID = "partnerId"
|
|
60
|
+
const val AF_DEEP_LINK_TIME_OUT = "deepLinkTimeout"
|
|
61
|
+
const val AF_EVENT_PARAMETERS = "eventParameters"
|
|
@@ -2,62 +2,7 @@ package capacitor.plugin.appsflyer.sdk
|
|
|
2
2
|
|
|
3
3
|
import android.Manifest
|
|
4
4
|
import android.content.Intent
|
|
5
|
-
|
|
6
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_ADDITIONAL_PARAMETERS
|
|
7
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_ADD_PARAMETERS
|
|
8
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_ANONYMIZE_USER
|
|
9
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_APP_ID
|
|
10
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_BASE_DEEPLINK
|
|
11
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_BRAND_DOMAIN
|
|
12
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_CAMPAIGN
|
|
13
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_CHANNEL
|
|
14
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_CONTAINS
|
|
15
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_CONVERSION_LISTENER
|
|
16
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_CUID
|
|
17
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_CURRENCY
|
|
18
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_CURRENCY_CODE
|
|
19
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_DATA
|
|
20
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_DEBUG
|
|
21
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_DEEPLINK_URLS
|
|
22
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_DEEP_LINK_TIME_OUT
|
|
23
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_DEV_KEY
|
|
24
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_DISABLE_SKAD
|
|
25
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_EMAILS
|
|
26
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_ENCODE
|
|
27
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_EVENT_NAME
|
|
28
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_EVENT_PARAMETERS
|
|
29
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_EVENT_VALUE
|
|
30
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_FB
|
|
31
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_FILTERS
|
|
32
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_HOST_NAME
|
|
33
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_HOST_PREFIX
|
|
34
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_IS_STOP
|
|
35
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_LATITUDE
|
|
36
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_LINK_READY
|
|
37
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_LONGITUDE
|
|
38
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_MIN_TIME
|
|
39
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_OAOA
|
|
40
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_ONELINK_DOMAIN
|
|
41
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_ONELINK_ID
|
|
42
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_PARAMETERS
|
|
43
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_PARTNER_ID
|
|
44
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_PATH
|
|
45
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_PHONE
|
|
46
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_PRICE
|
|
47
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_PUBLIC_KEY
|
|
48
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_PURCHASE_DATA
|
|
49
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_PUSH_PAYLOAD
|
|
50
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_REFERRER_CUSTOMER_ID
|
|
51
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_REFERRER_IMAGE_URL
|
|
52
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_REFERRER_NAME
|
|
53
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_SIGNATURE
|
|
54
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_STOP
|
|
55
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_TOKEN
|
|
56
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_UDL
|
|
57
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.AF_UID
|
|
58
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.CONVERSION_CALLBACK
|
|
59
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.OAOA_CALLBACK
|
|
60
|
-
import capacitor.plugin.appsflyer.sdk.AppsFlyerConstants.UDL_CALLBACK
|
|
5
|
+
|
|
61
6
|
import com.appsflyer.*
|
|
62
7
|
import com.appsflyer.attribution.AppsFlyerRequestListener
|
|
63
8
|
import com.appsflyer.deeplink.DeepLinkListener
|
|
@@ -79,8 +24,9 @@ import org.json.JSONObject
|
|
|
79
24
|
strings = arrayOf(
|
|
80
25
|
Manifest.permission.INTERNET,
|
|
81
26
|
Manifest.permission.ACCESS_NETWORK_STATE,
|
|
82
|
-
|
|
83
|
-
)
|
|
27
|
+
"com.google.android.gms.permission.AD_ID"
|
|
28
|
+
)
|
|
29
|
+
)]
|
|
84
30
|
)
|
|
85
31
|
class AppsFlyerPlugin : Plugin() {
|
|
86
32
|
private var conversion: Boolean? = null
|
|
@@ -120,15 +66,15 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
120
66
|
if (conversion == true) getConversionListener() else null,
|
|
121
67
|
context.applicationContext
|
|
122
68
|
)
|
|
123
|
-
}?: run{
|
|
124
|
-
call.reject(
|
|
69
|
+
} ?: run {
|
|
70
|
+
call.reject(AF_NULL_DEV_KEY)
|
|
125
71
|
|
|
126
72
|
}
|
|
127
73
|
if (udl == true) {
|
|
128
|
-
if (timeout != null){
|
|
74
|
+
if (timeout != null) {
|
|
129
75
|
subscribeForDeepLink(getDeepLinkListener(), timeout)
|
|
130
|
-
}else{
|
|
131
|
-
|
|
76
|
+
} else {
|
|
77
|
+
subscribeForDeepLink(getDeepLinkListener())
|
|
132
78
|
}
|
|
133
79
|
}
|
|
134
80
|
start(activity ?: context.applicationContext, null, object : AppsFlyerRequestListener {
|
|
@@ -152,17 +98,21 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
152
98
|
val eventName = call.getString(AF_EVENT_NAME)
|
|
153
99
|
val eventValue = AFHelpers.jsonToMap(call.getObject(AF_EVENT_VALUE))
|
|
154
100
|
AppsFlyerLib.getInstance()
|
|
155
|
-
.logEvent(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
101
|
+
.logEvent(
|
|
102
|
+
activity ?: context.applicationContext,
|
|
103
|
+
eventName,
|
|
104
|
+
eventValue,
|
|
105
|
+
object : AppsFlyerRequestListener {
|
|
106
|
+
override fun onSuccess() {
|
|
107
|
+
val ret = JSObject()
|
|
108
|
+
ret.put("res", "ok")
|
|
109
|
+
call.resolve(ret)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
override fun onError(i: Int, s: String) {
|
|
113
|
+
call.reject(s, i.toString())
|
|
114
|
+
}
|
|
115
|
+
})
|
|
166
116
|
}
|
|
167
117
|
|
|
168
118
|
@PluginMethod(returnType = PluginMethod.RETURN_NONE)
|
|
@@ -276,6 +226,7 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
276
226
|
AppsFlyerLib.getInstance().setSharingFilterForPartners(*filters)
|
|
277
227
|
|
|
278
228
|
}
|
|
229
|
+
|
|
279
230
|
@PluginMethod(returnType = PluginMethod.RETURN_NONE)
|
|
280
231
|
fun setAdditionalData(call: PluginCall) {
|
|
281
232
|
val data = call.getObject(AF_ADDITIONAL_DATA)
|
|
@@ -297,12 +248,16 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
297
248
|
|
|
298
249
|
@PluginMethod(returnType = PluginMethod.RETURN_NONE)
|
|
299
250
|
fun anonymizeUser(call: PluginCall) {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
AppsFlyerLib.getInstance().anonymizeUser(anonymizeUser!!)
|
|
251
|
+
call.getBoolean(AF_ANONYMIZE_USER)?.let {
|
|
252
|
+
AppsFlyerLib.getInstance().anonymizeUser(it)
|
|
253
|
+
} ?: run { call.reject("Missing boolean value anonymizeUser") }
|
|
254
|
+
}
|
|
305
255
|
|
|
256
|
+
@PluginMethod(returnType = PluginMethod.RETURN_NONE)
|
|
257
|
+
fun setDisableNetworkData(call: PluginCall) {
|
|
258
|
+
call.getBoolean(AF_DISABLE)?.let {
|
|
259
|
+
AppsFlyerLib.getInstance().setDisableNetworkData(it)
|
|
260
|
+
} ?: run { call.reject("Missing boolean value disable") }
|
|
306
261
|
}
|
|
307
262
|
|
|
308
263
|
@PluginMethod()
|
|
@@ -328,13 +283,9 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
328
283
|
|
|
329
284
|
@PluginMethod(returnType = PluginMethod.RETURN_NONE)
|
|
330
285
|
fun disableAdvertisingIdentifier(call: PluginCall) {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
} else {
|
|
335
|
-
call.reject("Missing boolean value shouldDisable")
|
|
336
|
-
|
|
337
|
-
}
|
|
286
|
+
call.getBoolean(AF_DISABLE_SKAD)?.let {
|
|
287
|
+
AppsFlyerLib.getInstance().setDisableAdvertisingIdentifiers(it)
|
|
288
|
+
} ?: run { call.reject("Missing boolean value shouldDisable") }
|
|
338
289
|
}
|
|
339
290
|
|
|
340
291
|
@PluginMethod()
|
|
@@ -464,14 +415,18 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
464
415
|
AppsFlyerLib.getInstance().sendPushNotificationData(activity)
|
|
465
416
|
|
|
466
417
|
}
|
|
418
|
+
|
|
467
419
|
@PluginMethod()
|
|
468
420
|
fun logCrossPromoteImpression(call: PluginCall) {
|
|
469
|
-
val appID =
|
|
470
|
-
|
|
471
|
-
val
|
|
421
|
+
val appID =
|
|
422
|
+
call.getString(AF_APP_ID) ?: return call.reject("cannot extract the appID value")
|
|
423
|
+
val campaign =
|
|
424
|
+
call.getString(AF_CAMPAIGN) ?: return call.reject("cannot extract the campaign value")
|
|
425
|
+
val parameters = AFHelpers.jsonToStringMap(call.getObject(AF_PARAMETERS))
|
|
426
|
+
?: return call.reject("cannot extract the parameters value")
|
|
472
427
|
|
|
473
428
|
CrossPromotionHelper.logCrossPromoteImpression(
|
|
474
|
-
context.applicationContext
|
|
429
|
+
context.applicationContext,
|
|
475
430
|
appID,
|
|
476
431
|
campaign,
|
|
477
432
|
parameters
|
|
@@ -484,16 +439,17 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
484
439
|
|
|
485
440
|
@PluginMethod()
|
|
486
441
|
fun setUserEmails(call: PluginCall) {
|
|
487
|
-
val emails =
|
|
442
|
+
val emails = call.getArray(AF_EMAILS)?.run {
|
|
488
443
|
toList<String>().toTypedArray()
|
|
489
|
-
} ?:
|
|
444
|
+
} ?: return call.reject("cannot extract the emails value")
|
|
490
445
|
|
|
491
446
|
val enc = call.getBoolean(AF_ENCODE)
|
|
492
447
|
|
|
493
|
-
if(enc != true){
|
|
448
|
+
if (enc != true) {
|
|
494
449
|
AppsFlyerLib.getInstance().setUserEmails(*emails)
|
|
495
|
-
}else{
|
|
496
|
-
AppsFlyerLib.getInstance()
|
|
450
|
+
} else {
|
|
451
|
+
AppsFlyerLib.getInstance()
|
|
452
|
+
.setUserEmails(AppsFlyerProperties.EmailsCryptType.SHA256, *emails)
|
|
497
453
|
}
|
|
498
454
|
|
|
499
455
|
val ret = JSObject()
|
|
@@ -504,9 +460,11 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
504
460
|
|
|
505
461
|
@PluginMethod()
|
|
506
462
|
fun logLocation(call: PluginCall) {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
463
|
+
val longitude =
|
|
464
|
+
call.getDouble(AF_LONGITUDE) ?: return call.reject("cannot extract the longitude value")
|
|
465
|
+
val latitude =
|
|
466
|
+
call.getDouble(AF_LATITUDE) ?: return call.reject("cannot extract the latitude value")
|
|
467
|
+
AppsFlyerLib.getInstance().logLocation(context.applicationContext, latitude, longitude)
|
|
510
468
|
val ret = JSObject()
|
|
511
469
|
ret.put("res", "ok")
|
|
512
470
|
call.resolve(ret)
|
|
@@ -525,10 +483,12 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
525
483
|
|
|
526
484
|
@PluginMethod()
|
|
527
485
|
fun setPartnerData(call: PluginCall) {
|
|
528
|
-
val data = AFHelpers.jsonToMap(call.getObject(AF_DATA))
|
|
529
|
-
|
|
486
|
+
val data = AFHelpers.jsonToMap(call.getObject(AF_DATA))
|
|
487
|
+
?: return call.reject("cannot extract the data value")
|
|
488
|
+
val pid = call.getString(AF_PARTNER_ID)
|
|
489
|
+
?: return call.reject("cannot extract the partnerId value")
|
|
530
490
|
|
|
531
|
-
AppsFlyerLib.getInstance().setPartnerData(pid,data)
|
|
491
|
+
AppsFlyerLib.getInstance().setPartnerData(pid, data)
|
|
532
492
|
val ret = JSObject()
|
|
533
493
|
ret.put("res", "ok")
|
|
534
494
|
call.resolve(ret)
|
|
@@ -537,8 +497,10 @@ class AppsFlyerPlugin : Plugin() {
|
|
|
537
497
|
|
|
538
498
|
@PluginMethod()
|
|
539
499
|
fun logInvite(call: PluginCall) {
|
|
540
|
-
val data = AFHelpers.jsonToStringMap(call.getObject(AF_EVENT_PARAMETERS))
|
|
541
|
-
|
|
500
|
+
val data = AFHelpers.jsonToStringMap(call.getObject(AF_EVENT_PARAMETERS))
|
|
501
|
+
?: return call.reject("cannot extract the eventParameters value")
|
|
502
|
+
val channel =
|
|
503
|
+
call.getString(AF_CHANNEL) ?: return call.reject("cannot extract the channel value")
|
|
542
504
|
ShareInviteHelper.logInvite(activity.application, channel, data)
|
|
543
505
|
val ret = JSObject()
|
|
544
506
|
ret.put("res", "ok")
|
|
@@ -153,4 +153,10 @@ export interface AppsFlyerPlugin {
|
|
|
153
153
|
*
|
|
154
154
|
*/
|
|
155
155
|
logInvite(data: AFLogInvite): Promise<AFRes>;
|
|
156
|
+
/**
|
|
157
|
+
* Use to opt-out of collecting the network operator name (carrier) and sim operator name from the device.
|
|
158
|
+
*
|
|
159
|
+
* @param disable Defaults to false
|
|
160
|
+
*/
|
|
161
|
+
setDisableNetworkData(disable: AFDisable): Promise<void>;
|
|
156
162
|
}
|
|
@@ -234,6 +234,10 @@ public class AppsFlyerPlugin: CAPPlugin {
|
|
|
234
234
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
+
@objc func setDisableNetworkData(_ call: CAPPluginCall){
|
|
238
|
+
call.unavailable("Android only method - has no effact on iOS apps")
|
|
239
|
+
}
|
|
240
|
+
|
|
237
241
|
@objc func anonymizeUser(_ call: CAPPluginCall){
|
|
238
242
|
guard let anonymize = call.getBool(AppsFlyerConstants.AF_ANONYMIZE_USER) else{
|
|
239
243
|
call.reject("Missing boolean value anonymizeUser")
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appsflyer-capacitor-plugin",
|
|
3
|
-
"version": "6.
|
|
4
|
-
"iosSdkVersion": "6.
|
|
3
|
+
"version": "6.8.0-rc2",
|
|
4
|
+
"iosSdkVersion": "6.8.0",
|
|
5
5
|
"description": "AppsFlyer SDK plugin for Capacitor",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
package/src/definitions.ts
CHANGED
|
@@ -239,5 +239,12 @@ export interface AppsFlyerPlugin {
|
|
|
239
239
|
*
|
|
240
240
|
*/
|
|
241
241
|
logInvite(data : AFLogInvite): Promise<AFRes>;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Use to opt-out of collecting the network operator name (carrier) and sim operator name from the device.
|
|
245
|
+
*
|
|
246
|
+
* @param disable Defaults to false
|
|
247
|
+
*/
|
|
248
|
+
setDisableNetworkData(disable : AFDisable): Promise<void>;
|
|
242
249
|
}
|
|
243
250
|
|