@capawesome/capacitor-singular 0.0.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/CapawesomeCapacitorSingular.podspec +19 -0
- package/LICENSE +21 -0
- package/Package.swift +26 -0
- package/README.md +1262 -0
- package/android/build.gradle +61 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/Singular.java +443 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/SingularHelper.java +53 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/SingularPlugin.java +336 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/CustomException.java +20 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/CustomExceptions.java +34 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/events/DeviceAttributionInfoReceivedEvent.java +48 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/events/SdidReceivedEvent.java +23 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/events/SdidSetEvent.java +23 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/events/SingularLinkResolvedEvent.java +44 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/CreateReferrerShortLinkOptions.java +61 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/InitializeOptions.java +168 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetCustomUserIdOptions.java +24 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetDeviceTokenOptions.java +24 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetGlobalPropertyOptions.java +44 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetLimitAdvertisingIdentifiersOptions.java +22 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/SetLimitDataSharingOptions.java +22 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/TrackAdRevenueOptions.java +157 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/TrackEventOptions.java +35 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/TrackRevenueOptions.java +56 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/options/UnsetGlobalPropertyOptions.java +24 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/results/CreateReferrerShortLinkResult.java +23 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/results/GetGlobalPropertiesResult.java +31 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/results/GetLimitDataSharingResult.java +22 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/classes/results/IsAllTrackingStoppedResult.java +22 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/interfaces/Callback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/interfaces/EmptyCallback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/interfaces/NonEmptyResultCallback.java +7 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/singular/interfaces/Result.java +7 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +2014 -0
- package/dist/esm/definitions.d.ts +925 -0
- package/dist/esm/definitions.js +39 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +27 -0
- package/dist/esm/web.js +73 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +126 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +129 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Classes/Events/DeviceAttributionInfoReceivedEvent.swift +43 -0
- package/ios/Plugin/Classes/Events/SdidReceivedEvent.swift +16 -0
- package/ios/Plugin/Classes/Events/SdidSetEvent.swift +16 -0
- package/ios/Plugin/Classes/Events/SingularLinkResolvedEvent.swift +28 -0
- package/ios/Plugin/Classes/Events/SkanConversionValueUpdatedEvent.swift +30 -0
- package/ios/Plugin/Classes/Options/CreateReferrerShortLinkOptions.swift +25 -0
- package/ios/Plugin/Classes/Options/InitializeOptions.swift +44 -0
- package/ios/Plugin/Classes/Options/SetCustomUserIdOptions.swift +13 -0
- package/ios/Plugin/Classes/Options/SetDeviceTokenOptions.swift +30 -0
- package/ios/Plugin/Classes/Options/SetGlobalPropertyOptions.swift +20 -0
- package/ios/Plugin/Classes/Options/SetLimitAdvertisingIdentifiersOptions.swift +13 -0
- package/ios/Plugin/Classes/Options/SetLimitDataSharingOptions.swift +13 -0
- package/ios/Plugin/Classes/Options/SkanUpdateConversionValueOptions.swift +27 -0
- package/ios/Plugin/Classes/Options/TrackAdRevenueOptions.swift +47 -0
- package/ios/Plugin/Classes/Options/TrackEventOptions.swift +15 -0
- package/ios/Plugin/Classes/Options/TrackRevenueOptions.swift +22 -0
- package/ios/Plugin/Classes/Options/UnsetGlobalPropertyOptions.swift +13 -0
- package/ios/Plugin/Classes/Results/CreateReferrerShortLinkResult.swift +16 -0
- package/ios/Plugin/Classes/Results/GetGlobalPropertiesResult.swift +16 -0
- package/ios/Plugin/Classes/Results/GetLimitDataSharingResult.swift +16 -0
- package/ios/Plugin/Classes/Results/IsAllTrackingStoppedResult.swift +16 -0
- package/ios/Plugin/Classes/Results/SkanGetConversionValueResult.swift +20 -0
- package/ios/Plugin/Enums/CustomError.swift +88 -0
- package/ios/Plugin/Enums/SkanCoarseConversionValue.swift +31 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/Protocols/Result.swift +6 -0
- package/ios/Plugin/Singular.swift +341 -0
- package/ios/Plugin/SingularHelper.swift +40 -0
- package/ios/Plugin/SingularPlugin.swift +340 -0
- package/package.json +102 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
import com.getcapacitor.JSArray;
|
|
6
|
+
import com.getcapacitor.JSObject;
|
|
7
|
+
import com.getcapacitor.PluginCall;
|
|
8
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
9
|
+
import java.util.ArrayList;
|
|
10
|
+
import java.util.HashMap;
|
|
11
|
+
import java.util.Iterator;
|
|
12
|
+
import java.util.List;
|
|
13
|
+
import java.util.Map;
|
|
14
|
+
|
|
15
|
+
public class InitializeOptions {
|
|
16
|
+
|
|
17
|
+
@Nullable
|
|
18
|
+
private final String androidFacebookAppId;
|
|
19
|
+
|
|
20
|
+
@NonNull
|
|
21
|
+
private final String apiKey;
|
|
22
|
+
|
|
23
|
+
@Nullable
|
|
24
|
+
private final List<String> brandedDomains;
|
|
25
|
+
|
|
26
|
+
@Nullable
|
|
27
|
+
private final String customSdid;
|
|
28
|
+
|
|
29
|
+
@Nullable
|
|
30
|
+
private final String customUserId;
|
|
31
|
+
|
|
32
|
+
@Nullable
|
|
33
|
+
private final List<String> espDomains;
|
|
34
|
+
|
|
35
|
+
@Nullable
|
|
36
|
+
private final Map<String, String> globalProperties;
|
|
37
|
+
|
|
38
|
+
private final boolean limitAdvertisingIdentifiers;
|
|
39
|
+
|
|
40
|
+
@Nullable
|
|
41
|
+
private final Boolean limitDataSharing;
|
|
42
|
+
|
|
43
|
+
private final boolean loggingEnabled;
|
|
44
|
+
|
|
45
|
+
@NonNull
|
|
46
|
+
private final String secret;
|
|
47
|
+
|
|
48
|
+
private final int sessionTimeout;
|
|
49
|
+
|
|
50
|
+
private final int shortLinkResolveTimeout;
|
|
51
|
+
|
|
52
|
+
public InitializeOptions(@NonNull PluginCall call) throws Exception {
|
|
53
|
+
String apiKey = call.getString("apiKey");
|
|
54
|
+
if (apiKey == null) {
|
|
55
|
+
throw CustomExceptions.API_KEY_MISSING;
|
|
56
|
+
}
|
|
57
|
+
String secret = call.getString("secret");
|
|
58
|
+
if (secret == null) {
|
|
59
|
+
throw CustomExceptions.SECRET_MISSING;
|
|
60
|
+
}
|
|
61
|
+
this.androidFacebookAppId = call.getString("androidFacebookAppId");
|
|
62
|
+
this.apiKey = apiKey;
|
|
63
|
+
this.brandedDomains = createStringList(call.getArray("brandedDomains"));
|
|
64
|
+
this.customSdid = call.getString("customSdid");
|
|
65
|
+
this.customUserId = call.getString("customUserId");
|
|
66
|
+
this.espDomains = createStringList(call.getArray("espDomains"));
|
|
67
|
+
this.globalProperties = createStringMap(call.getObject("globalProperties"));
|
|
68
|
+
this.limitAdvertisingIdentifiers = call.getBoolean("limitAdvertisingIdentifiers", false);
|
|
69
|
+
this.limitDataSharing = call.getBoolean("limitDataSharing");
|
|
70
|
+
this.loggingEnabled = call.getBoolean("loggingEnabled", false);
|
|
71
|
+
this.secret = secret;
|
|
72
|
+
this.sessionTimeout = call.getInt("sessionTimeout", 60);
|
|
73
|
+
this.shortLinkResolveTimeout = call.getInt("shortLinkResolveTimeout", 10);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@Nullable
|
|
77
|
+
public String getAndroidFacebookAppId() {
|
|
78
|
+
return androidFacebookAppId;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@NonNull
|
|
82
|
+
public String getApiKey() {
|
|
83
|
+
return apiKey;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@Nullable
|
|
87
|
+
public List<String> getBrandedDomains() {
|
|
88
|
+
return brandedDomains;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@Nullable
|
|
92
|
+
public String getCustomSdid() {
|
|
93
|
+
return customSdid;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@Nullable
|
|
97
|
+
public String getCustomUserId() {
|
|
98
|
+
return customUserId;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@Nullable
|
|
102
|
+
public List<String> getEspDomains() {
|
|
103
|
+
return espDomains;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@Nullable
|
|
107
|
+
public Map<String, String> getGlobalProperties() {
|
|
108
|
+
return globalProperties;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@Nullable
|
|
112
|
+
public Boolean getLimitDataSharing() {
|
|
113
|
+
return limitDataSharing;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@NonNull
|
|
117
|
+
public String getSecret() {
|
|
118
|
+
return secret;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
public int getSessionTimeout() {
|
|
122
|
+
return sessionTimeout;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
public int getShortLinkResolveTimeout() {
|
|
126
|
+
return shortLinkResolveTimeout;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public boolean isLimitAdvertisingIdentifiers() {
|
|
130
|
+
return limitAdvertisingIdentifiers;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
public boolean isLoggingEnabled() {
|
|
134
|
+
return loggingEnabled;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@Nullable
|
|
138
|
+
private static List<String> createStringList(@Nullable JSArray array) {
|
|
139
|
+
if (array == null) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
List<String> list = new ArrayList<>();
|
|
143
|
+
for (int index = 0; index < array.length(); index++) {
|
|
144
|
+
Object value = array.opt(index);
|
|
145
|
+
if (value != null) {
|
|
146
|
+
list.add(value.toString());
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return list;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@Nullable
|
|
153
|
+
private static Map<String, String> createStringMap(@Nullable JSObject object) {
|
|
154
|
+
if (object == null) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
Map<String, String> map = new HashMap<>();
|
|
158
|
+
Iterator<String> keys = object.keys();
|
|
159
|
+
while (keys.hasNext()) {
|
|
160
|
+
String key = keys.next();
|
|
161
|
+
Object value = object.opt(key);
|
|
162
|
+
if (value != null) {
|
|
163
|
+
map.put(key, value.toString());
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return map;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.PluginCall;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
6
|
+
|
|
7
|
+
public class SetCustomUserIdOptions {
|
|
8
|
+
|
|
9
|
+
@NonNull
|
|
10
|
+
private final String customUserId;
|
|
11
|
+
|
|
12
|
+
public SetCustomUserIdOptions(@NonNull PluginCall call) throws Exception {
|
|
13
|
+
String customUserId = call.getString("customUserId");
|
|
14
|
+
if (customUserId == null) {
|
|
15
|
+
throw CustomExceptions.CUSTOM_USER_ID_MISSING;
|
|
16
|
+
}
|
|
17
|
+
this.customUserId = customUserId;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@NonNull
|
|
21
|
+
public String getCustomUserId() {
|
|
22
|
+
return customUserId;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.PluginCall;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
6
|
+
|
|
7
|
+
public class SetDeviceTokenOptions {
|
|
8
|
+
|
|
9
|
+
@NonNull
|
|
10
|
+
private final String token;
|
|
11
|
+
|
|
12
|
+
public SetDeviceTokenOptions(@NonNull PluginCall call) throws Exception {
|
|
13
|
+
String token = call.getString("token");
|
|
14
|
+
if (token == null) {
|
|
15
|
+
throw CustomExceptions.TOKEN_MISSING;
|
|
16
|
+
}
|
|
17
|
+
this.token = token;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@NonNull
|
|
21
|
+
public String getToken() {
|
|
22
|
+
return token;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.PluginCall;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
6
|
+
|
|
7
|
+
public class SetGlobalPropertyOptions {
|
|
8
|
+
|
|
9
|
+
@NonNull
|
|
10
|
+
private final String key;
|
|
11
|
+
|
|
12
|
+
private final boolean overrideExisting;
|
|
13
|
+
|
|
14
|
+
@NonNull
|
|
15
|
+
private final String value;
|
|
16
|
+
|
|
17
|
+
public SetGlobalPropertyOptions(@NonNull PluginCall call) throws Exception {
|
|
18
|
+
String key = call.getString("key");
|
|
19
|
+
if (key == null) {
|
|
20
|
+
throw CustomExceptions.KEY_MISSING;
|
|
21
|
+
}
|
|
22
|
+
String value = call.getString("value");
|
|
23
|
+
if (value == null) {
|
|
24
|
+
throw CustomExceptions.VALUE_MISSING;
|
|
25
|
+
}
|
|
26
|
+
this.key = key;
|
|
27
|
+
this.overrideExisting = call.getBoolean("overrideExisting", true);
|
|
28
|
+
this.value = value;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@NonNull
|
|
32
|
+
public String getKey() {
|
|
33
|
+
return key;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@NonNull
|
|
37
|
+
public String getValue() {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public boolean isOverrideExisting() {
|
|
42
|
+
return overrideExisting;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.PluginCall;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
6
|
+
|
|
7
|
+
public class SetLimitAdvertisingIdentifiersOptions {
|
|
8
|
+
|
|
9
|
+
private final boolean limit;
|
|
10
|
+
|
|
11
|
+
public SetLimitAdvertisingIdentifiersOptions(@NonNull PluginCall call) throws Exception {
|
|
12
|
+
Boolean limit = call.getBoolean("limit");
|
|
13
|
+
if (limit == null) {
|
|
14
|
+
throw CustomExceptions.LIMIT_MISSING;
|
|
15
|
+
}
|
|
16
|
+
this.limit = limit;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public boolean isLimit() {
|
|
20
|
+
return limit;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.PluginCall;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
6
|
+
|
|
7
|
+
public class SetLimitDataSharingOptions {
|
|
8
|
+
|
|
9
|
+
private final boolean limit;
|
|
10
|
+
|
|
11
|
+
public SetLimitDataSharingOptions(@NonNull PluginCall call) throws Exception {
|
|
12
|
+
Boolean limit = call.getBoolean("limit");
|
|
13
|
+
if (limit == null) {
|
|
14
|
+
throw CustomExceptions.LIMIT_MISSING;
|
|
15
|
+
}
|
|
16
|
+
this.limit = limit;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public boolean isLimit() {
|
|
20
|
+
return limit;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
7
|
+
|
|
8
|
+
public class TrackAdRevenueOptions {
|
|
9
|
+
|
|
10
|
+
@Nullable
|
|
11
|
+
private final String adGroupId;
|
|
12
|
+
|
|
13
|
+
@Nullable
|
|
14
|
+
private final String adGroupName;
|
|
15
|
+
|
|
16
|
+
@Nullable
|
|
17
|
+
private final String adGroupPriority;
|
|
18
|
+
|
|
19
|
+
@Nullable
|
|
20
|
+
private final String adGroupType;
|
|
21
|
+
|
|
22
|
+
@Nullable
|
|
23
|
+
private final String adPlacementName;
|
|
24
|
+
|
|
25
|
+
@NonNull
|
|
26
|
+
private final String adPlatform;
|
|
27
|
+
|
|
28
|
+
@Nullable
|
|
29
|
+
private final String adType;
|
|
30
|
+
|
|
31
|
+
@Nullable
|
|
32
|
+
private final String adUnitId;
|
|
33
|
+
|
|
34
|
+
@Nullable
|
|
35
|
+
private final String adUnitName;
|
|
36
|
+
|
|
37
|
+
@NonNull
|
|
38
|
+
private final String currency;
|
|
39
|
+
|
|
40
|
+
@Nullable
|
|
41
|
+
private final String impressionId;
|
|
42
|
+
|
|
43
|
+
@Nullable
|
|
44
|
+
private final String networkName;
|
|
45
|
+
|
|
46
|
+
@Nullable
|
|
47
|
+
private final String placementId;
|
|
48
|
+
|
|
49
|
+
@Nullable
|
|
50
|
+
private final String precision;
|
|
51
|
+
|
|
52
|
+
private final double revenue;
|
|
53
|
+
|
|
54
|
+
public TrackAdRevenueOptions(@NonNull PluginCall call) throws Exception {
|
|
55
|
+
String adPlatform = call.getString("adPlatform");
|
|
56
|
+
if (adPlatform == null) {
|
|
57
|
+
throw CustomExceptions.AD_PLATFORM_MISSING;
|
|
58
|
+
}
|
|
59
|
+
String currency = call.getString("currency");
|
|
60
|
+
if (currency == null) {
|
|
61
|
+
throw CustomExceptions.CURRENCY_MISSING;
|
|
62
|
+
}
|
|
63
|
+
Double revenue = call.getDouble("revenue");
|
|
64
|
+
if (revenue == null) {
|
|
65
|
+
throw CustomExceptions.REVENUE_MISSING;
|
|
66
|
+
}
|
|
67
|
+
this.adGroupId = call.getString("adGroupId");
|
|
68
|
+
this.adGroupName = call.getString("adGroupName");
|
|
69
|
+
this.adGroupPriority = call.getString("adGroupPriority");
|
|
70
|
+
this.adGroupType = call.getString("adGroupType");
|
|
71
|
+
this.adPlacementName = call.getString("adPlacementName");
|
|
72
|
+
this.adPlatform = adPlatform;
|
|
73
|
+
this.adType = call.getString("adType");
|
|
74
|
+
this.adUnitId = call.getString("adUnitId");
|
|
75
|
+
this.adUnitName = call.getString("adUnitName");
|
|
76
|
+
this.currency = currency;
|
|
77
|
+
this.impressionId = call.getString("impressionId");
|
|
78
|
+
this.networkName = call.getString("networkName");
|
|
79
|
+
this.placementId = call.getString("placementId");
|
|
80
|
+
this.precision = call.getString("precision");
|
|
81
|
+
this.revenue = revenue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@Nullable
|
|
85
|
+
public String getAdGroupId() {
|
|
86
|
+
return adGroupId;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@Nullable
|
|
90
|
+
public String getAdGroupName() {
|
|
91
|
+
return adGroupName;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@Nullable
|
|
95
|
+
public String getAdGroupPriority() {
|
|
96
|
+
return adGroupPriority;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@Nullable
|
|
100
|
+
public String getAdGroupType() {
|
|
101
|
+
return adGroupType;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@Nullable
|
|
105
|
+
public String getAdPlacementName() {
|
|
106
|
+
return adPlacementName;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@NonNull
|
|
110
|
+
public String getAdPlatform() {
|
|
111
|
+
return adPlatform;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@Nullable
|
|
115
|
+
public String getAdType() {
|
|
116
|
+
return adType;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@Nullable
|
|
120
|
+
public String getAdUnitId() {
|
|
121
|
+
return adUnitId;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@Nullable
|
|
125
|
+
public String getAdUnitName() {
|
|
126
|
+
return adUnitName;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@NonNull
|
|
130
|
+
public String getCurrency() {
|
|
131
|
+
return currency;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@Nullable
|
|
135
|
+
public String getImpressionId() {
|
|
136
|
+
return impressionId;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@Nullable
|
|
140
|
+
public String getNetworkName() {
|
|
141
|
+
return networkName;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@Nullable
|
|
145
|
+
public String getPlacementId() {
|
|
146
|
+
return placementId;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@Nullable
|
|
150
|
+
public String getPrecision() {
|
|
151
|
+
return precision;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
public double getRevenue() {
|
|
155
|
+
return revenue;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
import com.getcapacitor.PluginCall;
|
|
7
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
8
|
+
|
|
9
|
+
public class TrackEventOptions {
|
|
10
|
+
|
|
11
|
+
@Nullable
|
|
12
|
+
private final JSObject attributes;
|
|
13
|
+
|
|
14
|
+
@NonNull
|
|
15
|
+
private final String name;
|
|
16
|
+
|
|
17
|
+
public TrackEventOptions(@NonNull PluginCall call) throws Exception {
|
|
18
|
+
String name = call.getString("name");
|
|
19
|
+
if (name == null) {
|
|
20
|
+
throw CustomExceptions.NAME_MISSING;
|
|
21
|
+
}
|
|
22
|
+
this.attributes = call.getObject("attributes");
|
|
23
|
+
this.name = name;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@Nullable
|
|
27
|
+
public JSObject getAttributes() {
|
|
28
|
+
return attributes;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@NonNull
|
|
32
|
+
public String getName() {
|
|
33
|
+
return name;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import io.capawesome.capacitorjs.plugins.singular.SingularHelper;
|
|
7
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
8
|
+
import java.util.Map;
|
|
9
|
+
|
|
10
|
+
public class TrackRevenueOptions {
|
|
11
|
+
|
|
12
|
+
private final double amount;
|
|
13
|
+
|
|
14
|
+
@Nullable
|
|
15
|
+
private final Map<String, Object> attributes;
|
|
16
|
+
|
|
17
|
+
@NonNull
|
|
18
|
+
private final String currency;
|
|
19
|
+
|
|
20
|
+
@Nullable
|
|
21
|
+
private final String eventName;
|
|
22
|
+
|
|
23
|
+
public TrackRevenueOptions(@NonNull PluginCall call) throws Exception {
|
|
24
|
+
Double amount = call.getDouble("amount");
|
|
25
|
+
if (amount == null) {
|
|
26
|
+
throw CustomExceptions.AMOUNT_MISSING;
|
|
27
|
+
}
|
|
28
|
+
String currency = call.getString("currency");
|
|
29
|
+
if (currency == null) {
|
|
30
|
+
throw CustomExceptions.CURRENCY_MISSING;
|
|
31
|
+
}
|
|
32
|
+
this.amount = amount;
|
|
33
|
+
this.attributes = SingularHelper.createHashMapFromJSONObject(call.getObject("attributes"));
|
|
34
|
+
this.currency = currency;
|
|
35
|
+
this.eventName = call.getString("eventName");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public double getAmount() {
|
|
39
|
+
return amount;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@Nullable
|
|
43
|
+
public Map<String, Object> getAttributes() {
|
|
44
|
+
return attributes;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@NonNull
|
|
48
|
+
public String getCurrency() {
|
|
49
|
+
return currency;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Nullable
|
|
53
|
+
public String getEventName() {
|
|
54
|
+
return eventName;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.PluginCall;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.singular.classes.CustomExceptions;
|
|
6
|
+
|
|
7
|
+
public class UnsetGlobalPropertyOptions {
|
|
8
|
+
|
|
9
|
+
@NonNull
|
|
10
|
+
private final String key;
|
|
11
|
+
|
|
12
|
+
public UnsetGlobalPropertyOptions(@NonNull PluginCall call) throws Exception {
|
|
13
|
+
String key = call.getString("key");
|
|
14
|
+
if (key == null) {
|
|
15
|
+
throw CustomExceptions.KEY_MISSING;
|
|
16
|
+
}
|
|
17
|
+
this.key = key;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@NonNull
|
|
21
|
+
public String getKey() {
|
|
22
|
+
return key;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSObject;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.singular.interfaces.Result;
|
|
6
|
+
|
|
7
|
+
public class CreateReferrerShortLinkResult implements Result {
|
|
8
|
+
|
|
9
|
+
@NonNull
|
|
10
|
+
private final String link;
|
|
11
|
+
|
|
12
|
+
public CreateReferrerShortLinkResult(@NonNull String link) {
|
|
13
|
+
this.link = link;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
@NonNull
|
|
18
|
+
public JSObject toJSObject() {
|
|
19
|
+
JSObject result = new JSObject();
|
|
20
|
+
result.put("link", link);
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
import io.capawesome.capacitorjs.plugins.singular.interfaces.Result;
|
|
7
|
+
import java.util.Map;
|
|
8
|
+
|
|
9
|
+
public class GetGlobalPropertiesResult implements Result {
|
|
10
|
+
|
|
11
|
+
@Nullable
|
|
12
|
+
private final Map<String, String> properties;
|
|
13
|
+
|
|
14
|
+
public GetGlobalPropertiesResult(@Nullable Map<String, String> properties) {
|
|
15
|
+
this.properties = properties;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@Override
|
|
19
|
+
@NonNull
|
|
20
|
+
public JSObject toJSObject() {
|
|
21
|
+
JSObject properties = new JSObject();
|
|
22
|
+
if (this.properties != null) {
|
|
23
|
+
for (Map.Entry<String, String> property : this.properties.entrySet()) {
|
|
24
|
+
properties.put(property.getKey(), property.getValue());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
JSObject result = new JSObject();
|
|
28
|
+
result.put("properties", properties);
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSObject;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.singular.interfaces.Result;
|
|
6
|
+
|
|
7
|
+
public class GetLimitDataSharingResult implements Result {
|
|
8
|
+
|
|
9
|
+
private final boolean limit;
|
|
10
|
+
|
|
11
|
+
public GetLimitDataSharingResult(boolean limit) {
|
|
12
|
+
this.limit = limit;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
@NonNull
|
|
17
|
+
public JSObject toJSObject() {
|
|
18
|
+
JSObject result = new JSObject();
|
|
19
|
+
result.put("limit", limit);
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.singular.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSObject;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.singular.interfaces.Result;
|
|
6
|
+
|
|
7
|
+
public class IsAllTrackingStoppedResult implements Result {
|
|
8
|
+
|
|
9
|
+
private final boolean stopped;
|
|
10
|
+
|
|
11
|
+
public IsAllTrackingStoppedResult(boolean stopped) {
|
|
12
|
+
this.stopped = stopped;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
@NonNull
|
|
17
|
+
public JSObject toJSObject() {
|
|
18
|
+
JSObject result = new JSObject();
|
|
19
|
+
result.put("stopped", stopped);
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
}
|