@capgo/capacitor-appsflyer 8.0.0
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/CapgoCapacitorAppsflyer.podspec +27 -0
- package/LICENSE +21 -0
- package/Package.swift +30 -0
- package/README.md +1257 -0
- package/android/build.gradle +178 -0
- package/android/src/main/AndroidManifest.xml +7 -0
- package/android/src/main/java/capacitor/plugin/appsflyer/sdk/AFHelpers.kt +76 -0
- package/android/src/main/java/capacitor/plugin/appsflyer/sdk/AppsFlyerConstants.kt +76 -0
- package/android/src/main/java/capacitor/plugin/appsflyer/sdk/AppsFlyerPlugin.kt +812 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +2145 -0
- package/dist/esm/Appsflyer_constants.d.ts +29 -0
- package/dist/esm/Appsflyer_constants.js +33 -0
- package/dist/esm/Appsflyer_constants.js.map +1 -0
- package/dist/esm/appsflyer_interfaces.d.ts +200 -0
- package/dist/esm/appsflyer_interfaces.js +18 -0
- package/dist/esm/appsflyer_interfaces.js.map +1 -0
- package/dist/esm/definitions.d.ts +219 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/plugin.cjs.js +60 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +63 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/AppsFlyerPlugin/AppsFlyerAttribution.swift +60 -0
- package/ios/Sources/AppsFlyerPlugin/AppsFlyerConstants.swift +86 -0
- package/ios/Sources/AppsFlyerPlugin/AppsFlyerPlugin.swift +1007 -0
- package/ios/Sources/AppsFlyerPlugin/Extensions.swift +78 -0
- package/ios/Tests/AppsFlyerPluginTests/AppsFlyerPluginTests.swift +8 -0
- package/package.json +93 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// swiftlint:disable all
|
|
2
|
+
//
|
|
3
|
+
// Strings.swift
|
|
4
|
+
// Plugin
|
|
5
|
+
//
|
|
6
|
+
// Created by Paz Lavi on 11/07/2021.
|
|
7
|
+
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
import Foundation
|
|
11
|
+
extension String {
|
|
12
|
+
|
|
13
|
+
/// Create `Data` from hexadecimal string representation
|
|
14
|
+
///
|
|
15
|
+
/// This creates a `Data` object from hex string. Note, if the string has any spaces or non-hex characters (e.g. starts with '<' and with a '>'), those are ignored and only hex characters are processed.
|
|
16
|
+
///
|
|
17
|
+
/// - returns: Data represented by this hexadecimal string.
|
|
18
|
+
|
|
19
|
+
var hexadecimalToData: Data? {
|
|
20
|
+
var data = Data(capacity: count / 2)
|
|
21
|
+
|
|
22
|
+
let regex = try! NSRegularExpression(pattern: "[0-9a-f]{1,2}", options: .caseInsensitive)
|
|
23
|
+
regex.enumerateMatches(in: self, range: NSRange(startIndex..., in: self)) { match, _, _ in
|
|
24
|
+
let byteString = (self as NSString).substring(with: match!.range)
|
|
25
|
+
let num = UInt8(byteString, radix: 16)!
|
|
26
|
+
data.append(num)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
guard data.count > 0 else { return nil }
|
|
30
|
+
|
|
31
|
+
return data
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
extension Dictionary {
|
|
36
|
+
var jsonStringRepresentation: String? {
|
|
37
|
+
guard let theJSONData = try? JSONSerialization.data(withJSONObject: self,
|
|
38
|
+
options: []) else {
|
|
39
|
+
return nil
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return String(data: theJSONData, encoding: .utf8)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
extension Dictionary where Key == String, Value == Any {
|
|
47
|
+
/// Converts dictionary values to JSON-safe types.
|
|
48
|
+
/// Non-serializable objects (like NSError) are converted to their string description.
|
|
49
|
+
func jsonSafeRepresentation() -> [String: Any] {
|
|
50
|
+
var result: [String: Any] = [:]
|
|
51
|
+
for (key, value) in self {
|
|
52
|
+
if let dict = value as? [String: Any] {
|
|
53
|
+
result[key] = dict.jsonSafeRepresentation()
|
|
54
|
+
} else if let array = value as? [Any] {
|
|
55
|
+
result[key] = array.map { item -> Any in
|
|
56
|
+
if let dict = item as? [String: Any] {
|
|
57
|
+
return dict.jsonSafeRepresentation()
|
|
58
|
+
} else if JSONSerialization.isValidJSONObject([item]) {
|
|
59
|
+
return item
|
|
60
|
+
} else {
|
|
61
|
+
return "\(item)"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
} else if JSONSerialization.isValidJSONObject([value]) {
|
|
65
|
+
result[key] = value
|
|
66
|
+
} else {
|
|
67
|
+
// Convert non-serializable objects (NSError, etc.) to string
|
|
68
|
+
result[key] = "\(value)"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return result
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
extension Notification.Name{
|
|
76
|
+
public static let appsflyerBridge = Notification.Name(AppsFlyerConstants.AF_BRIDGE_SET)
|
|
77
|
+
|
|
78
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@capgo/capacitor-appsflyer",
|
|
3
|
+
"version": "8.0.0",
|
|
4
|
+
"iosSdkVersion": "6.17.8",
|
|
5
|
+
"androidSdkVersion": "6.17.5",
|
|
6
|
+
"buildNumber": "1",
|
|
7
|
+
"description": "Capacitor plugin for AppsFlyer attribution, analytics, and deep links.",
|
|
8
|
+
"main": "dist/plugin.cjs.js",
|
|
9
|
+
"module": "dist/esm/index.js",
|
|
10
|
+
"types": "dist/esm/index.d.ts",
|
|
11
|
+
"unpkg": "dist/plugin.js",
|
|
12
|
+
"files": [
|
|
13
|
+
"android/src/main/",
|
|
14
|
+
"android/build.gradle",
|
|
15
|
+
"dist/",
|
|
16
|
+
"ios/Sources",
|
|
17
|
+
"ios/Tests",
|
|
18
|
+
"Package.swift",
|
|
19
|
+
"CapgoCapacitorAppsflyer.podspec"
|
|
20
|
+
],
|
|
21
|
+
"author": "Martin Donadieu <martin@capgo.app>",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/Cap-go/capacitor-appsflyer.git"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/Cap-go/capacitor-appsflyer/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://capgo.app/docs/plugins/appsflyer/",
|
|
31
|
+
"keywords": [
|
|
32
|
+
"capacitor",
|
|
33
|
+
"plugin",
|
|
34
|
+
"appsflyer",
|
|
35
|
+
"attribution",
|
|
36
|
+
"analytics",
|
|
37
|
+
"deeplink"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"verify": "bun run verify:ios && bun run verify:android && bun run verify:web",
|
|
41
|
+
"verify:ios": "xcodebuild -scheme CapgoCapacitorAppsflyer -destination generic/platform=iOS",
|
|
42
|
+
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
43
|
+
"verify:web": "bun run build",
|
|
44
|
+
"lint": "bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint",
|
|
45
|
+
"fmt": "bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format",
|
|
46
|
+
"eslint": "eslint . --ext .ts",
|
|
47
|
+
"prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
48
|
+
"swiftlint": "node-swiftlint",
|
|
49
|
+
"docgen": "docgen --api AppsFlyerPlugin --output-readme README.md --output-json dist/docs.json",
|
|
50
|
+
"build": "bun run clean && bun run docgen && tsc && rollup -c rollup.config.mjs",
|
|
51
|
+
"clean": "rimraf ./dist",
|
|
52
|
+
"watch": "tsc --watch",
|
|
53
|
+
"prepublishOnly": "bun run build",
|
|
54
|
+
"check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@capacitor/android": "^8.0.0",
|
|
58
|
+
"@capacitor/cli": "^8.0.0",
|
|
59
|
+
"@capacitor/core": "^8.0.0",
|
|
60
|
+
"@capacitor/docgen": "^0.3.1",
|
|
61
|
+
"@capacitor/ios": "^8.0.0",
|
|
62
|
+
"@ionic/eslint-config": "^0.4.0",
|
|
63
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
64
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
65
|
+
"@types/node": "^24.10.1",
|
|
66
|
+
"eslint": "^8.57.1",
|
|
67
|
+
"eslint-plugin-import": "^2.31.0",
|
|
68
|
+
"husky": "^9.1.7",
|
|
69
|
+
"prettier": "^3.6.2",
|
|
70
|
+
"prettier-pretty-check": "^0.2.0",
|
|
71
|
+
"prettier-plugin-java": "^2.7.7",
|
|
72
|
+
"rimraf": "^6.1.0",
|
|
73
|
+
"rollup": "^4.53.2",
|
|
74
|
+
"swiftlint": "^2.0.0",
|
|
75
|
+
"typescript": "^5.9.3"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"@capacitor/core": ">=8.0.0"
|
|
79
|
+
},
|
|
80
|
+
"prettier": "@ionic/prettier-config",
|
|
81
|
+
"swiftlint": "@ionic/swiftlint-config",
|
|
82
|
+
"eslintConfig": {
|
|
83
|
+
"extends": "@ionic/eslint-config/recommended"
|
|
84
|
+
},
|
|
85
|
+
"capacitor": {
|
|
86
|
+
"ios": {
|
|
87
|
+
"src": "ios"
|
|
88
|
+
},
|
|
89
|
+
"android": {
|
|
90
|
+
"src": "android"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|