@tolinku/react-native-sdk 0.6.1 → 0.7.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/android/build.gradle +15 -7
- package/android/src/main/java/com/tolinku/rnsdk/TolinkuInstallReferrerPackage.java +16 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -12
package/android/build.gradle
CHANGED
|
@@ -20,7 +20,7 @@ buildscript {
|
|
|
20
20
|
mavenCentral()
|
|
21
21
|
}
|
|
22
22
|
dependencies {
|
|
23
|
-
classpath("com.android.tools.build:gradle:
|
|
23
|
+
classpath("com.android.tools.build:gradle:9.5.1")
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -35,20 +35,28 @@ android {
|
|
|
35
35
|
// namespace, so the old manifest package attribute is not needed.
|
|
36
36
|
namespace "com.tolinku.rnsdk"
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
// Property form, not compileSdkVersion(): the method was removed in AGP 9,
|
|
39
|
+
// and the property has existed since AGP 7.0, which is below the AGP 7.4
|
|
40
|
+
// that this package's React Native 0.72 floor ships with. So this reads
|
|
41
|
+
// correctly on every host in the supported range rather than only new ones.
|
|
42
|
+
compileSdk safeExtGet("compileSdkVersion", 36)
|
|
39
43
|
|
|
40
44
|
defaultConfig {
|
|
41
45
|
// The Install Referrer library needs 21; the host app decides above that.
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
minSdk safeExtGet("minSdkVersion", 21)
|
|
47
|
+
// Google Play has required targetSdk 36 since 31 August 2026, so a
|
|
48
|
+
// host that leaves this to the fallback should land on a value it can
|
|
49
|
+
// still publish with.
|
|
50
|
+
targetSdk safeExtGet("targetSdkVersion", 36)
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
compileOptions {
|
|
47
|
-
sourceCompatibility JavaVersion.
|
|
48
|
-
targetCompatibility JavaVersion.
|
|
54
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
55
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
49
56
|
}
|
|
50
57
|
|
|
51
|
-
lintOptions
|
|
58
|
+
// lint, not lintOptions: renamed in AGP 7.0 and removed in AGP 9.
|
|
59
|
+
lint {
|
|
52
60
|
abortOnError false
|
|
53
61
|
}
|
|
54
62
|
}
|
|
@@ -11,7 +11,22 @@ import java.util.ArrayList;
|
|
|
11
11
|
import java.util.Collections;
|
|
12
12
|
import java.util.List;
|
|
13
13
|
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Registers the install referrer module with React Native's autolinking.
|
|
16
|
+
*
|
|
17
|
+
* <p>Implements {@link ReactPackage} rather than extending {@code
|
|
18
|
+
* BaseReactPackage}, which is what React Native now recommends and why the
|
|
19
|
+
* compiler reports {@code createNativeModules} as deprecated from 0.88.
|
|
20
|
+
* {@code BaseReactPackage} arrived in React Native 0.74, and this package
|
|
21
|
+
* declares a peer range starting at 0.72, so adopting it would drop two
|
|
22
|
+
* versions of support to silence a warning. Deprecated is not removed: under
|
|
23
|
+
* the New Architecture this is carried by the interop layer and works, which
|
|
24
|
+
* the standalone Android build in CI compiles on 0.88 to confirm.
|
|
25
|
+
*
|
|
26
|
+
* <p>When the peer floor next rises above 0.74, extend {@code BaseReactPackage}
|
|
27
|
+
* and implement {@code getModule} plus {@code getReactModuleInfoProvider}
|
|
28
|
+
* instead. Until then this warning is expected and should be left alone.
|
|
29
|
+
*/
|
|
15
30
|
public class TolinkuInstallReferrerPackage implements ReactPackage {
|
|
16
31
|
|
|
17
32
|
@Override
|
package/dist/index.d.mts
CHANGED
|
@@ -450,7 +450,7 @@ declare class Links {
|
|
|
450
450
|
* await Tolinku.track('signup', { source: 'onboarding' });
|
|
451
451
|
*/
|
|
452
452
|
declare class Tolinku {
|
|
453
|
-
static readonly VERSION = "0.
|
|
453
|
+
static readonly VERSION = "0.7.0";
|
|
454
454
|
private static client;
|
|
455
455
|
private static analyticsInstance;
|
|
456
456
|
private static ecommerceInstance;
|
|
@@ -578,4 +578,5 @@ declare function TolinkuMessages({ trigger, triggerValue, onDismiss, onButtonPre
|
|
|
578
578
|
*/
|
|
579
579
|
declare function isSafeUrl(url: string): boolean;
|
|
580
580
|
|
|
581
|
-
export {
|
|
581
|
+
export { Tolinku, TolinkuError, TolinkuMessages, getInstallReferrerToken, isSafeUrl, parseInstallReferrer };
|
|
582
|
+
export type { AddPaymentInfoParams, AddToCartParams, AddToWishlistParams, BeginCheckoutParams, ClaimBySignalsOptions, CompleteReferralOptions, CompleteReferralResult, CreateReferralOptions, CreateReferralResult, DeferredLink, EcommerceItem, LeaderboardEntry, Message, MessageComponent, MessageContent, MilestoneOptions, MilestoneResult, PurchaseParams, RateParams, ReferralInfo, ReferrerProvider, RefundParams, RemoveFromCartParams, ResolvedLink, ResolvedTolinkuConfig, SearchParams, ShareParams, ShowMessageOptions, SpendCreditsParams, TolinkuConfig, TrackProperties, ViewItemParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -450,7 +450,7 @@ declare class Links {
|
|
|
450
450
|
* await Tolinku.track('signup', { source: 'onboarding' });
|
|
451
451
|
*/
|
|
452
452
|
declare class Tolinku {
|
|
453
|
-
static readonly VERSION = "0.
|
|
453
|
+
static readonly VERSION = "0.7.0";
|
|
454
454
|
private static client;
|
|
455
455
|
private static analyticsInstance;
|
|
456
456
|
private static ecommerceInstance;
|
|
@@ -578,4 +578,5 @@ declare function TolinkuMessages({ trigger, triggerValue, onDismiss, onButtonPre
|
|
|
578
578
|
*/
|
|
579
579
|
declare function isSafeUrl(url: string): boolean;
|
|
580
580
|
|
|
581
|
-
export {
|
|
581
|
+
export { Tolinku, TolinkuError, TolinkuMessages, getInstallReferrerToken, isSafeUrl, parseInstallReferrer };
|
|
582
|
+
export type { AddPaymentInfoParams, AddToCartParams, AddToWishlistParams, BeginCheckoutParams, ClaimBySignalsOptions, CompleteReferralOptions, CompleteReferralResult, CreateReferralOptions, CreateReferralResult, DeferredLink, EcommerceItem, LeaderboardEntry, Message, MessageComponent, MessageContent, MilestoneOptions, MilestoneResult, PurchaseParams, RateParams, ReferralInfo, ReferrerProvider, RefundParams, RemoveFromCartParams, ResolvedLink, ResolvedTolinkuConfig, SearchParams, ShareParams, ShowMessageOptions, SpendCreditsParams, TolinkuConfig, TrackProperties, ViewItemParams };
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var AsyncStorage__default = /*#__PURE__*/_interopDefault(AsyncStorage);
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
12
12
|
|
|
13
13
|
// src/types.ts
|
|
14
|
-
var SDK_VERSION = "0.
|
|
14
|
+
var SDK_VERSION = "0.7.0";
|
|
15
15
|
|
|
16
16
|
// src/debug.ts
|
|
17
17
|
var _debugEnabled = false;
|
|
@@ -33,6 +33,9 @@ function debugWarn(message) {
|
|
|
33
33
|
var MAX_RETRIES = 3;
|
|
34
34
|
var BASE_DELAY_MS = 500;
|
|
35
35
|
var MAX_JITTER_MS = 250;
|
|
36
|
+
function isAbortError(err) {
|
|
37
|
+
return typeof err === "object" && err !== null && err.name === "AbortError";
|
|
38
|
+
}
|
|
36
39
|
var HttpClient = class {
|
|
37
40
|
constructor(config) {
|
|
38
41
|
/** Set of AbortControllers for in-flight requests. Used by destroy() to cancel all. */
|
|
@@ -187,7 +190,7 @@ var HttpClient = class {
|
|
|
187
190
|
if (this.destroyed) {
|
|
188
191
|
throw new TolinkuError("Tolinku: request aborted (client destroyed).", 0);
|
|
189
192
|
}
|
|
190
|
-
if (err
|
|
193
|
+
if (isAbortError(err)) {
|
|
191
194
|
const timeoutErr = new TolinkuError(`Tolinku: request timed out after ${this.timeout}ms`, 0);
|
|
192
195
|
if (attempt === MAX_RETRIES) throw timeoutErr;
|
|
193
196
|
lastError = timeoutErr;
|
|
@@ -656,8 +659,9 @@ var Ecommerce = class {
|
|
|
656
659
|
}
|
|
657
660
|
}
|
|
658
661
|
generateId() {
|
|
659
|
-
|
|
660
|
-
|
|
662
|
+
const g = globalThis;
|
|
663
|
+
if (typeof g.crypto?.randomUUID === "function") {
|
|
664
|
+
return g.crypto.randomUUID();
|
|
661
665
|
}
|
|
662
666
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
663
667
|
const r = Math.random() * 16 | 0;
|