airbridge-react-native-sdk-restricted 4.4.1 → 4.5.1
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/.github/workflows/release.yml +35 -4
- package/airbridge_sdk.json +2 -2
- package/android/build.gradle +1 -3
- package/android/copy-airbridge-json.gradle +27 -5
- package/android/create-library-info-json.gradle +30 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeReactNative.kt +14 -6
- package/android/src/main/java/co/ab180/airbridge/reactnative/extension/LibraryInfoJSON.kt +24 -0
- package/build/source/Airbridge.d.ts +1 -2
- package/build/source/Airbridge.js +94 -55
- package/build/source/Airbridge.js.map +1 -1
- package/build/source/module/Switch.js +1 -1
- package/build/source/module/Switch.js.map +1 -1
- package/changelog.md +10 -0
- package/ios/copy-airbridge-json.rb +13 -3
- package/package.json +1 -1
- package/qa/airbridge.development.json +4 -0
- package/qa/airbridge.json +3 -3
- package/qa/airbridge_qa.json +1 -1
- package/qa/ios/.xcode.env +1 -11
- package/qa/ios/AirbridgeQA.xcodeproj/project.pbxproj +2 -2
- package/qa/ios/Podfile.lock +9 -9
- package/qa/package-lock.json +2515 -9070
- package/qa/package.json +4 -0
- package/script/BuildQA.sh +1 -1
- package/source/Airbridge.ts +60 -50
- package/source/module/Switch.ts +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
name: release
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
4
6
|
pull_request:
|
|
5
7
|
types:
|
|
6
8
|
- closed
|
|
@@ -10,8 +12,8 @@ on:
|
|
|
10
12
|
jobs:
|
|
11
13
|
release:
|
|
12
14
|
runs-on: ubuntu-latest
|
|
13
|
-
if:
|
|
14
|
-
github.event.pull_request.merged == true
|
|
15
|
+
if: github.event_name == 'workflow_dispatch'
|
|
16
|
+
|| (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
|
|
15
17
|
|
|
16
18
|
steps:
|
|
17
19
|
- name: Checkout
|
|
@@ -33,8 +35,8 @@ jobs:
|
|
|
33
35
|
|
|
34
36
|
release-restricted:
|
|
35
37
|
runs-on: ubuntu-latest
|
|
36
|
-
if:
|
|
37
|
-
github.event.pull_request.merged == true
|
|
38
|
+
if: github.event_name == 'workflow_dispatch'
|
|
39
|
+
|| (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
|
|
38
40
|
|
|
39
41
|
steps:
|
|
40
42
|
- name: Checkout
|
|
@@ -56,3 +58,32 @@ jobs:
|
|
|
56
58
|
env:
|
|
57
59
|
NODE_AUTH_TOKEN: ${{ secrets.SDK_TEAM_NPM_AUTOMATION_TOKEN }}
|
|
58
60
|
run: npm publish
|
|
61
|
+
|
|
62
|
+
deploy-release-note:
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
if: github.event_name == 'workflow_dispatch'
|
|
65
|
+
|| (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
|
|
66
|
+
|
|
67
|
+
needs:
|
|
68
|
+
- release
|
|
69
|
+
- release-restricted
|
|
70
|
+
|
|
71
|
+
steps:
|
|
72
|
+
- name: Checkout
|
|
73
|
+
uses: actions/checkout@v3
|
|
74
|
+
|
|
75
|
+
- name: Prepare changelog
|
|
76
|
+
id: prepare-changelog
|
|
77
|
+
run: |
|
|
78
|
+
{
|
|
79
|
+
echo 'value<<EOF'
|
|
80
|
+
cat CHANGELOG.md
|
|
81
|
+
echo 'EOF'
|
|
82
|
+
} >> $GITHUB_OUTPUT
|
|
83
|
+
|
|
84
|
+
- name: Deploy release note
|
|
85
|
+
uses: ab180/airbridge-sdk-tool/action/deploy-release-note@v1
|
|
86
|
+
with:
|
|
87
|
+
contentful-access-token: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }}
|
|
88
|
+
contentful-entry-slug: release-note-react-native-sdk
|
|
89
|
+
changelog-content: ${{ steps.prepare-changelog.outputs.value }}
|
package/airbridge_sdk.json
CHANGED
package/android/build.gradle
CHANGED
|
@@ -35,9 +35,6 @@ android {
|
|
|
35
35
|
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
36
36
|
versionCode 1
|
|
37
37
|
versionName "${packageJson['version']}"
|
|
38
|
-
|
|
39
|
-
buildConfigField("String", "AIRBRIDGE_REACT_NATIVE_NAME", "\"${packageJson['name']}\"")
|
|
40
|
-
buildConfigField("String", "AIRBRIDGE_REACT_NATIVE_VERSION", "\"${packageJson['version']}\"")
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
|
|
@@ -56,3 +53,4 @@ dependencies {
|
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
apply from: 'copy-airbridge-json.gradle'
|
|
56
|
+
apply from: 'create-library-info-json.gradle'
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
def processAirbridgeJSON = {
|
|
2
|
-
def
|
|
2
|
+
def env = getEnvSafe()
|
|
3
3
|
|
|
4
|
-
def
|
|
5
|
-
if (
|
|
6
|
-
content = json
|
|
4
|
+
def content = null
|
|
5
|
+
if (env != "") {
|
|
6
|
+
content = getAirbridgeJSON("../airbridge.${env}.json")
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (content == null) {
|
|
10
|
+
content = getAirbridgeJSON("../airbridge.json")
|
|
7
11
|
}
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
if (content == null) {
|
|
14
|
+
content = '{}'.getBytes()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
def file = rootProject.file("app/src/main/assets/airbridge.json")
|
|
10
18
|
if (!file.exists()) {
|
|
11
19
|
file.getParentFile().mkdirs()
|
|
12
20
|
file.createNewFile()
|
|
@@ -15,4 +23,18 @@ def processAirbridgeJSON = {
|
|
|
15
23
|
file.write(new String(content))
|
|
16
24
|
}
|
|
17
25
|
|
|
26
|
+
def getAirbridgeJSON(path) {
|
|
27
|
+
def json = rootProject.file(path)
|
|
28
|
+
if (json.exists()) {
|
|
29
|
+
return json.readBytes()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return null
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
def getEnvSafe() {
|
|
36
|
+
def env = (System.getenv("AIRBRIDGE_ENVIRONMENT") ?: "").toLowerCase()
|
|
37
|
+
return env.matches(/^[A-Za-z0-9\-_]*$/) ? env : ""
|
|
38
|
+
}
|
|
39
|
+
|
|
18
40
|
preBuild.dependsOn processAirbridgeJSON
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import groovy.json.JsonSlurper
|
|
2
|
+
import groovy.json.JsonOutput
|
|
3
|
+
|
|
4
|
+
def processLibraryInfoJSON = {
|
|
5
|
+
def currentDirectory = buildFile.parentFile.toPath()
|
|
6
|
+
def packageJson = new File(currentDirectory.resolve('../package.json').toString())
|
|
7
|
+
def name = "airbridge-react-native-sdk"
|
|
8
|
+
def version = ""
|
|
9
|
+
|
|
10
|
+
if (packageJson.exists()) {
|
|
11
|
+
def jsonObject = new JsonSlurper().parseText(packageJson.text)
|
|
12
|
+
name = jsonObject.name ?: name
|
|
13
|
+
version = jsonObject.version ?: version
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
def filteredJson = [
|
|
17
|
+
name : name,
|
|
18
|
+
version: version
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
def file = rootProject.file('app/src/main/assets/libraryInfo.json')
|
|
22
|
+
if (!file.exists()) {
|
|
23
|
+
file.getParentFile().mkdirs()
|
|
24
|
+
file.createNewFile()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
file.write(new String(JsonOutput.prettyPrint(JsonOutput.toJson(filteredJson))))
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
preBuild.dependsOn processLibraryInfoJSON
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package co.ab180.airbridge.reactnative
|
|
2
2
|
|
|
3
3
|
import android.app.Application
|
|
4
|
+
import android.content.Context
|
|
4
5
|
import android.content.Intent
|
|
5
6
|
import android.util.Log
|
|
6
7
|
import android.view.View
|
|
@@ -10,6 +11,7 @@ import co.ab180.airbridge.reactnative.common.AirbridgeJSON
|
|
|
10
11
|
import co.ab180.airbridge.reactnative.common.AirbridgeLifecycleIntegration
|
|
11
12
|
import co.ab180.airbridge.reactnative.extension.consume
|
|
12
13
|
import co.ab180.airbridge.reactnative.extension.isConsumed
|
|
14
|
+
import co.ab180.airbridge.reactnative.extension.LibraryInfoJSON
|
|
13
15
|
import co.ab180.airbridge.reactnative.extension.setAirbridgeJSON
|
|
14
16
|
import co.ab180.airbridge.reactnative.extension.toMap
|
|
15
17
|
import co.ab180.airbridge.reactnative.module.AttributionInteractor
|
|
@@ -60,7 +62,7 @@ class AirbridgeReactNative : ReactPackage {
|
|
|
60
62
|
AirbridgeOptionBuilder(name, token)
|
|
61
63
|
.setAirbridgeJSON(airbridgeJSON)
|
|
62
64
|
.setSDKDevelopmentPlatform(getSDKDevelopmentPlatform())
|
|
63
|
-
.setSDKAttributes(getSDKAttributes())
|
|
65
|
+
.setSDKAttributes(getSDKAttributes(app))
|
|
64
66
|
.setSDKWrapperOption(getSDKWrapperOption())
|
|
65
67
|
.setOnAttributionReceived {
|
|
66
68
|
AttributionInteractor.onAttributionReceived(it)
|
|
@@ -126,11 +128,17 @@ class AirbridgeReactNative : ReactPackage {
|
|
|
126
128
|
return subWrapperSDKDevelopmentPlatform ?: "react_native"
|
|
127
129
|
}
|
|
128
130
|
|
|
129
|
-
private fun getSDKAttributes(): Map<String, String> {
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
private fun getSDKAttributes(context: Context): Map<String, String> {
|
|
132
|
+
return LibraryInfoJSON.load(context).let {
|
|
133
|
+
if (it == null) {
|
|
134
|
+
mutableMapOf()
|
|
135
|
+
} else {
|
|
136
|
+
mutableMapOf(
|
|
137
|
+
"wrapperName" to it.getString("name"),
|
|
138
|
+
"wrapperVersion" to it.getString("version")
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
}.apply {
|
|
134
142
|
subWrapperSDKAttributes?.let { putAll(it) }
|
|
135
143
|
}
|
|
136
144
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package co.ab180.airbridge.reactnative.extension
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.util.Log
|
|
5
|
+
import org.json.JSONException
|
|
6
|
+
import org.json.JSONObject
|
|
7
|
+
import java.io.IOException
|
|
8
|
+
|
|
9
|
+
object LibraryInfoJSON {
|
|
10
|
+
fun load(context: Context): JSONObject? {
|
|
11
|
+
try {
|
|
12
|
+
return context.assets.open("libraryInfo.json")
|
|
13
|
+
.bufferedReader()
|
|
14
|
+
.use { JSONObject(it.readText()) }
|
|
15
|
+
} catch (exception: IOException) {
|
|
16
|
+
Log.w("AirbridgeReactNative", "The file libraryInfo.json could not be read.", exception)
|
|
17
|
+
} catch (exception: JSONException) {
|
|
18
|
+
Log.w("AirbridgeReactNative", "The file libraryInfo.json is not in json format")
|
|
19
|
+
} catch (throwable: Throwable) {
|
|
20
|
+
Log.w("AirbridgeReactNative", "Unknown error processing libraryInfo.json", throwable)
|
|
21
|
+
}
|
|
22
|
+
return null
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -55,10 +55,9 @@ export declare const createDependency: {
|
|
|
55
55
|
createWebInterfaceScript: (webToken: string, postMessageScript: string) => Promise<string | undefined>;
|
|
56
56
|
handleWebInterfaceCommand: (command: string) => undefined;
|
|
57
57
|
};
|
|
58
|
-
};
|
|
58
|
+
} | undefined;
|
|
59
59
|
};
|
|
60
60
|
export declare class Airbridge {
|
|
61
|
-
#private;
|
|
62
61
|
/**
|
|
63
62
|
* Sets a listener for receiving attribution of install event.
|
|
64
63
|
* @param onReceived Map of attribution is delivered.
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _a, _Airbridge_dependency;
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
7
2
|
import { createAttributionModule } from './module/Attribution';
|
|
8
3
|
import { createDeeplinkModule } from './module/Deeplink';
|
|
9
4
|
import { createEventModule } from './module/Event';
|
|
@@ -12,17 +7,26 @@ import { createPlacementModule } from './module/Placement';
|
|
|
12
7
|
import { createRegisterModule } from './module/Register';
|
|
13
8
|
import { createSwitchModule } from './module/Switch';
|
|
14
9
|
import { createWebInterfaceModule } from './module/WebInterface';
|
|
10
|
+
import { check } from './utility/check';
|
|
15
11
|
export const createDependency = () => { };
|
|
16
|
-
createDependency.Airbridge = () =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
createDependency.Airbridge = () => {
|
|
13
|
+
if (!check.object(NativeModules.EventInteractor)) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
return ({
|
|
17
|
+
attributionModule: createAttributionModule(),
|
|
18
|
+
deeplinkModule: createDeeplinkModule(),
|
|
19
|
+
eventModule: createEventModule(),
|
|
20
|
+
fetchModule: createFetchModule(),
|
|
21
|
+
placementModule: createPlacementModule(),
|
|
22
|
+
registerModule: createRegisterModule(),
|
|
23
|
+
switchModule: createSwitchModule(),
|
|
24
|
+
webInterfaceModule: createWebInterfaceModule(),
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
class Dependency {
|
|
28
|
+
}
|
|
29
|
+
Dependency.instance = createDependency.Airbridge();
|
|
26
30
|
export class Airbridge {
|
|
27
31
|
// attribution
|
|
28
32
|
/**
|
|
@@ -30,7 +34,8 @@ export class Airbridge {
|
|
|
30
34
|
* @param onReceived Map of attribution is delivered.
|
|
31
35
|
*/
|
|
32
36
|
static setOnAttributionReceived(onReceived) {
|
|
33
|
-
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.attributionModule.setOnAttributionReceived(onReceived);
|
|
34
39
|
}
|
|
35
40
|
// deeplink
|
|
36
41
|
/**
|
|
@@ -38,7 +43,8 @@ export class Airbridge {
|
|
|
38
43
|
* @param onReceived URL of deeplink is delivered.
|
|
39
44
|
*/
|
|
40
45
|
static setOnDeeplinkReceived(onReceived) {
|
|
41
|
-
|
|
46
|
+
var _a;
|
|
47
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.deeplinkModule.setOnDeeplinkReceived(onReceived);
|
|
42
48
|
}
|
|
43
49
|
// event
|
|
44
50
|
/**
|
|
@@ -48,7 +54,8 @@ export class Airbridge {
|
|
|
48
54
|
* @param customAttributes Additional attributes of the event.
|
|
49
55
|
*/
|
|
50
56
|
static trackEvent(category, semanticAttributes, customAttributes) {
|
|
51
|
-
|
|
57
|
+
var _a;
|
|
58
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.eventModule.trackEvent(category, semanticAttributes, customAttributes);
|
|
52
59
|
}
|
|
53
60
|
// fetch
|
|
54
61
|
/**
|
|
@@ -57,7 +64,8 @@ export class Airbridge {
|
|
|
57
64
|
* @param onFailure Callback to be invoked when any error occurs.
|
|
58
65
|
*/
|
|
59
66
|
static fetchDeviceUUID(onSuccess, onFailure) {
|
|
60
|
-
|
|
67
|
+
var _a, _b;
|
|
68
|
+
return (_b = (_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.fetchModule.fetchDeviceUUID(onSuccess, onFailure)) !== null && _b !== void 0 ? _b : Promise.resolve(false);
|
|
61
69
|
}
|
|
62
70
|
/**
|
|
63
71
|
* Fetch airbridgeGeneratedUUID of SDK.
|
|
@@ -65,14 +73,16 @@ export class Airbridge {
|
|
|
65
73
|
* @param onFailure Callback to be invoked when any error occurs.
|
|
66
74
|
*/
|
|
67
75
|
static fetchAirbridgeGeneratedUUID(onSuccess, onFailure) {
|
|
68
|
-
|
|
76
|
+
var _a, _b;
|
|
77
|
+
return (_b = (_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.fetchModule.fetchAirbridgeGeneratedUUID(onSuccess, onFailure)) !== null && _b !== void 0 ? _b : Promise.resolve(false);
|
|
69
78
|
}
|
|
70
79
|
/**
|
|
71
80
|
* Indicates whether notification was sent by Airbridge to track uninstall of app.
|
|
72
81
|
* @param notification The notification to check.
|
|
73
82
|
*/
|
|
74
83
|
static isUninstallTrackingNotification(notification) {
|
|
75
|
-
|
|
84
|
+
var _a, _b;
|
|
85
|
+
return (_b = (_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.fetchModule.isUninstallTrackingNotification(notification)) !== null && _b !== void 0 ? _b : false;
|
|
76
86
|
}
|
|
77
87
|
// placement
|
|
78
88
|
/**
|
|
@@ -85,7 +95,8 @@ export class Airbridge {
|
|
|
85
95
|
* - If tracking link is successfully handled.
|
|
86
96
|
*/
|
|
87
97
|
static click(trackingLink, onSuccess, onFailure) {
|
|
88
|
-
|
|
98
|
+
var _a, _b;
|
|
99
|
+
return (_b = (_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.placementModule.click(trackingLink, onSuccess, onFailure)) !== null && _b !== void 0 ? _b : Promise.resolve(false);
|
|
89
100
|
}
|
|
90
101
|
/**
|
|
91
102
|
* Notifies that the in-app area within the app has been exposed to the user.
|
|
@@ -97,7 +108,8 @@ export class Airbridge {
|
|
|
97
108
|
* - If tracking link is successfully handled.
|
|
98
109
|
*/
|
|
99
110
|
static impression(trackingLink, onSuccess, onFailure) {
|
|
100
|
-
|
|
111
|
+
var _a, _b;
|
|
112
|
+
return (_b = (_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.placementModule.impression(trackingLink, onSuccess, onFailure)) !== null && _b !== void 0 ? _b : Promise.resolve(false);
|
|
101
113
|
}
|
|
102
114
|
// register
|
|
103
115
|
/**
|
|
@@ -105,39 +117,45 @@ export class Airbridge {
|
|
|
105
117
|
* @param id The user ID.
|
|
106
118
|
*/
|
|
107
119
|
static setUserID(id) {
|
|
108
|
-
|
|
120
|
+
var _a;
|
|
121
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.setUserID(id);
|
|
109
122
|
}
|
|
110
123
|
/**
|
|
111
124
|
* Clear the user ID.
|
|
112
125
|
*/
|
|
113
126
|
static clearUserID() {
|
|
114
|
-
|
|
127
|
+
var _a;
|
|
128
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.clearUserID();
|
|
115
129
|
}
|
|
116
130
|
/**
|
|
117
131
|
* Sets the user email.
|
|
118
132
|
* @param email The user email.
|
|
119
133
|
*/
|
|
120
134
|
static setUserEmail(email) {
|
|
121
|
-
|
|
135
|
+
var _a;
|
|
136
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.setUserEmail(email);
|
|
122
137
|
}
|
|
123
138
|
/**
|
|
124
139
|
* Clear the user email.
|
|
125
140
|
*/
|
|
126
141
|
static clearUserEmail() {
|
|
127
|
-
|
|
142
|
+
var _a;
|
|
143
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.clearUserEmail();
|
|
128
144
|
}
|
|
129
145
|
/**
|
|
130
146
|
* Sets the user phone number.
|
|
131
147
|
* @param phone The user phone number.
|
|
132
148
|
*/
|
|
133
149
|
static setUserPhone(phone) {
|
|
134
|
-
|
|
150
|
+
var _a;
|
|
151
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.setUserPhone(phone);
|
|
135
152
|
}
|
|
136
153
|
/**
|
|
137
154
|
* Clear the user phone number.
|
|
138
155
|
*/
|
|
139
156
|
static clearUserPhone() {
|
|
140
|
-
|
|
157
|
+
var _a;
|
|
158
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.clearUserPhone();
|
|
141
159
|
}
|
|
142
160
|
/**
|
|
143
161
|
* Sets the key, value pair to the user attribute.
|
|
@@ -145,20 +163,23 @@ export class Airbridge {
|
|
|
145
163
|
* @param value The value to set for the user attribute.
|
|
146
164
|
*/
|
|
147
165
|
static setUserAttribute(key, value) {
|
|
148
|
-
|
|
166
|
+
var _a;
|
|
167
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.setUserAttribute(key, value);
|
|
149
168
|
}
|
|
150
169
|
/**
|
|
151
170
|
* Removes the user attribute with the given key.
|
|
152
171
|
* @param key The key that uniquely identifies the user attribute.
|
|
153
172
|
*/
|
|
154
173
|
static removeUserAttribute(key) {
|
|
155
|
-
|
|
174
|
+
var _a;
|
|
175
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.removeUserAttribute(key);
|
|
156
176
|
}
|
|
157
177
|
/**
|
|
158
178
|
* Clears all user attributes.
|
|
159
179
|
*/
|
|
160
180
|
static clearUserAttributes() {
|
|
161
|
-
|
|
181
|
+
var _a;
|
|
182
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.clearUserAttributes();
|
|
162
183
|
}
|
|
163
184
|
/**
|
|
164
185
|
* Sets the key, value pair to the user alias.
|
|
@@ -166,26 +187,30 @@ export class Airbridge {
|
|
|
166
187
|
* @param value The value to set for the user alias.
|
|
167
188
|
*/
|
|
168
189
|
static setUserAlias(key, value) {
|
|
169
|
-
|
|
190
|
+
var _a;
|
|
191
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.setUserAlias(key, value);
|
|
170
192
|
}
|
|
171
193
|
/**
|
|
172
194
|
* Removes the user alias with the given key.
|
|
173
195
|
* @param key The key that uniquely identifies the user alias.
|
|
174
196
|
*/
|
|
175
197
|
static removeUserAlias(key) {
|
|
176
|
-
|
|
198
|
+
var _a;
|
|
199
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.removeUserAlias(key);
|
|
177
200
|
}
|
|
178
201
|
/**
|
|
179
202
|
* Clears all user aliases.
|
|
180
203
|
*/
|
|
181
204
|
static clearUserAlias() {
|
|
182
|
-
|
|
205
|
+
var _a;
|
|
206
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.clearUserAlias();
|
|
183
207
|
}
|
|
184
208
|
/**
|
|
185
209
|
* Clears all user information.
|
|
186
210
|
*/
|
|
187
211
|
static clearUser() {
|
|
188
|
-
|
|
212
|
+
var _a;
|
|
213
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.clearUser();
|
|
189
214
|
}
|
|
190
215
|
/**
|
|
191
216
|
* Sets the key, value pair to the device alias.
|
|
@@ -193,66 +218,76 @@ export class Airbridge {
|
|
|
193
218
|
* @param value The value to set for the device alias.
|
|
194
219
|
*/
|
|
195
220
|
static setDeviceAlias(key, value) {
|
|
196
|
-
|
|
221
|
+
var _a;
|
|
222
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.setDeviceAlias(key, value);
|
|
197
223
|
}
|
|
198
224
|
/**
|
|
199
225
|
* Removes the device alias with the given key.
|
|
200
226
|
* @param key The key that uniquely identifies the device alias.
|
|
201
227
|
*/
|
|
202
228
|
static removeDeviceAlias(key) {
|
|
203
|
-
|
|
229
|
+
var _a;
|
|
230
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.removeDeviceAlias(key);
|
|
204
231
|
}
|
|
205
232
|
/**
|
|
206
233
|
* Clears all device aliases.
|
|
207
234
|
*/
|
|
208
235
|
static clearDeviceAlias() {
|
|
209
|
-
|
|
236
|
+
var _a;
|
|
237
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.clearDeviceAlias();
|
|
210
238
|
}
|
|
211
239
|
/**
|
|
212
240
|
* Registers the FCM or APNS registration token to track app uninstalls.
|
|
213
241
|
* @param token The FCM or APNS registration token.
|
|
214
242
|
*/
|
|
215
243
|
static registerPushToken(token) {
|
|
216
|
-
|
|
244
|
+
var _a;
|
|
245
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.registerModule.registerPushToken(token);
|
|
217
246
|
}
|
|
218
247
|
// switch
|
|
219
248
|
/**
|
|
220
249
|
* Enables the SDK.
|
|
221
250
|
*/
|
|
222
251
|
static enableSDK() {
|
|
223
|
-
|
|
252
|
+
var _a;
|
|
253
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.switchModule.enableSDK();
|
|
224
254
|
}
|
|
225
255
|
/**
|
|
226
256
|
* Disables the SDK.
|
|
227
257
|
*/
|
|
228
258
|
static disableSDK() {
|
|
229
|
-
|
|
259
|
+
var _a;
|
|
260
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.switchModule.disableSDK();
|
|
230
261
|
}
|
|
231
262
|
/**
|
|
232
263
|
* Checks whether the SDK is currently enabled.
|
|
233
264
|
* @return `true` if the SDK is enabled, `false` otherwise.
|
|
234
265
|
*/
|
|
235
266
|
static isSDKEnabled() {
|
|
236
|
-
|
|
267
|
+
var _a, _b;
|
|
268
|
+
return (_b = (_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.switchModule.isSDKEnabled()) !== null && _b !== void 0 ? _b : Promise.resolve(false);
|
|
237
269
|
}
|
|
238
270
|
/**
|
|
239
271
|
* Start collecting and transferring events.
|
|
240
272
|
*/
|
|
241
273
|
static startTracking() {
|
|
242
|
-
|
|
274
|
+
var _a;
|
|
275
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.switchModule.startTracking();
|
|
243
276
|
}
|
|
244
277
|
/**
|
|
245
278
|
* Stop collecting and transferring events.
|
|
246
279
|
*/
|
|
247
280
|
static stopTracking() {
|
|
248
|
-
|
|
281
|
+
var _a;
|
|
282
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.switchModule.stopTracking();
|
|
249
283
|
}
|
|
250
284
|
/**
|
|
251
285
|
* Checks whether the tracking feature of SDK is currently enabled.
|
|
252
286
|
* @return `true` if the tracking feature of SDK tracking is enabled,`false` otherwise.
|
|
253
287
|
*/
|
|
254
288
|
static isTrackingEnabled() {
|
|
255
|
-
|
|
289
|
+
var _a, _b;
|
|
290
|
+
return (_b = (_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.switchModule.isTrackingEnabled()) !== null && _b !== void 0 ? _b : Promise.resolve(false);
|
|
256
291
|
}
|
|
257
292
|
// web interface
|
|
258
293
|
/**
|
|
@@ -262,14 +297,16 @@ export class Airbridge {
|
|
|
262
297
|
* @return web interface script
|
|
263
298
|
*/
|
|
264
299
|
static createWebInterfaceScript(webToken, postMessageScript) {
|
|
265
|
-
|
|
300
|
+
var _a, _b;
|
|
301
|
+
return (_b = (_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.webInterfaceModule.createWebInterfaceScript(webToken, postMessageScript)) !== null && _b !== void 0 ? _b : Promise.resolve(undefined);
|
|
266
302
|
}
|
|
267
303
|
/**
|
|
268
304
|
* Handles commands from the web interface.
|
|
269
305
|
* @param command The command to handle.
|
|
270
306
|
*/
|
|
271
307
|
static handleWebInterfaceCommand(command) {
|
|
272
|
-
|
|
308
|
+
var _a;
|
|
309
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.webInterfaceModule.handleWebInterfaceCommand(command);
|
|
273
310
|
}
|
|
274
311
|
/**
|
|
275
312
|
* Creates a tracking-link using airbridge-server that move user
|
|
@@ -281,21 +318,24 @@ export class Airbridge {
|
|
|
281
318
|
* @param onFailure Error is delivered if failed.
|
|
282
319
|
*/
|
|
283
320
|
static createTrackingLink(channel, option, onSuccess, onFailure) {
|
|
284
|
-
|
|
321
|
+
var _a;
|
|
322
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.placementModule.createTrackingLink(channel, option, onSuccess, onFailure);
|
|
285
323
|
}
|
|
286
324
|
/**
|
|
287
325
|
* Starts tracking event automatically for each user
|
|
288
326
|
* purchases product through in-app-purchase.
|
|
289
327
|
*/
|
|
290
328
|
static startInAppPurchaseTracking() {
|
|
291
|
-
|
|
329
|
+
var _a;
|
|
330
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.switchModule.startInAppPurchaseTracking();
|
|
292
331
|
}
|
|
293
332
|
/**
|
|
294
333
|
* Stops tracking event automatically for each user
|
|
295
334
|
* purchases product through in-app-purchase.
|
|
296
335
|
*/
|
|
297
336
|
static stopInAppPurchaseTracking() {
|
|
298
|
-
|
|
337
|
+
var _a;
|
|
338
|
+
(_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.switchModule.stopInAppPurchaseTracking();
|
|
299
339
|
}
|
|
300
340
|
/**
|
|
301
341
|
* Indicates that SDK can track event automatically for each user
|
|
@@ -304,9 +344,8 @@ export class Airbridge {
|
|
|
304
344
|
* @return `true` if the SDK is enabled for in-app-purchase tracking, `false` otherwise.
|
|
305
345
|
*/
|
|
306
346
|
static isInAppPurchaseTrackingEnabled() {
|
|
307
|
-
|
|
347
|
+
var _a, _b;
|
|
348
|
+
return (_b = (_a = Dependency.instance) === null || _a === void 0 ? void 0 : _a.switchModule.isInAppPurchaseTrackingEnabled()) !== null && _b !== void 0 ? _b : Promise.resolve(false);
|
|
308
349
|
}
|
|
309
350
|
}
|
|
310
|
-
_a = Airbridge;
|
|
311
|
-
_Airbridge_dependency = { value: createDependency.Airbridge() };
|
|
312
351
|
//# sourceMappingURL=Airbridge.js.map
|