@amplytools/react-native-amply-sdk 0.13.0 → 0.14.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/AmplyReactNative.podspec +1 -1
- package/README.md +6 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/tools/amply/sdk/reactnative/AmplyModule.kt +8 -0
- package/android/src/main/java/tools/amply/sdk/reactnative/core/AmplyClient.kt +2 -0
- package/android/src/main/java/tools/amply/sdk/reactnative/core/DefaultAmplyClient.kt +17 -0
- package/android/src/main/java/tools/amply/sdk/reactnative/model/AmplyInitializationOptions.kt +2 -0
- package/android/src/newarch/java/tools/amply/sdk/reactnative/NativeAmplyModuleSpec.java +4 -0
- package/android/src/newarch/jni/AmplyReactNative-generated.cpp +6 -0
- package/dist/src/__tests__/appLanguage.test.d.ts +43 -0
- package/dist/src/__tests__/appLanguage.test.d.ts.map +1 -0
- package/dist/src/__tests__/appLanguage.test.js +211 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +78 -1
- package/dist/src/nativeSpecs/NativeAmplyModule.d.ts +12 -0
- package/dist/src/nativeSpecs/NativeAmplyModule.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/ARCHITECTURE.md +2 -0
- package/ios/Sources/AmplyReactNative/AmplyModule.mm +25 -0
- package/ios/Sources/AmplyReactNative/AmplyReactNative/AmplyReactNative-generated.mm +7 -0
- package/ios/Sources/AmplyReactNative/AmplyReactNative/AmplyReactNative.h +7 -0
- package/package.json +1 -1
- package/src/__tests__/appLanguage.test.ts +296 -0
- package/src/index.ts +99 -1
- package/src/nativeSpecs/NativeAmplyModule.ts +12 -0
package/AmplyReactNative.podspec
CHANGED
package/README.md
CHANGED
|
@@ -60,6 +60,12 @@ await Amply.track({
|
|
|
60
60
|
// Identify users
|
|
61
61
|
Amply.setUserId('user-123');
|
|
62
62
|
|
|
63
|
+
// If your app picks its UI language itself (an in-app picker, i18next, …), tell Amply,
|
|
64
|
+
// so campaigns show in that language. Any common format: 'pt_BR', 'pt-BR', 'zh-TW', 'fr'.
|
|
65
|
+
// Persisted across launches; pass null to go back to following the device.
|
|
66
|
+
// Can also be given up front: Amply.initialize({ ..., appLanguage: 'pt_BR' }).
|
|
67
|
+
Amply.setAppLanguage('pt_BR'); // e.g. i18next's i18n.language
|
|
68
|
+
|
|
63
69
|
// Set custom properties for targeting
|
|
64
70
|
Amply.setCustomProperties({ plan: 'premium', onboarded: true });
|
|
65
71
|
|
package/android/build.gradle
CHANGED
|
@@ -15,7 +15,7 @@ buildscript {
|
|
|
15
15
|
apply plugin: 'com.android.library'
|
|
16
16
|
apply plugin: 'org.jetbrains.kotlin.android'
|
|
17
17
|
|
|
18
|
-
def amplySdkVersion = project.findProperty('amplySdkVersion') ?: System.getenv('AMPLY_SDK_VERSION') ?: '0.
|
|
18
|
+
def amplySdkVersion = project.findProperty('amplySdkVersion') ?: System.getenv('AMPLY_SDK_VERSION') ?: '0.14.0'
|
|
19
19
|
group = 'tools.amply'
|
|
20
20
|
version = amplySdkVersion
|
|
21
21
|
|
|
@@ -195,6 +195,10 @@ class AmplyModule(reactContext: ReactApplicationContext) :
|
|
|
195
195
|
client.setUserId(userId)
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
override fun setAppLanguage(tag: String?) {
|
|
199
|
+
client.setAppLanguage(tag)
|
|
200
|
+
}
|
|
201
|
+
|
|
198
202
|
override fun setLogLevel(level: String) {
|
|
199
203
|
val newLevel = LogLevel.fromString(level)
|
|
200
204
|
client.setLogLevel(newLevel)
|
|
@@ -354,6 +358,9 @@ class AmplyModule(reactContext: ReactApplicationContext) :
|
|
|
354
358
|
val defaultConfig = if (hasKey("defaultConfig")) getString("defaultConfig") else null
|
|
355
359
|
val debug = if (hasKey("debug")) getBoolean("debug") else null
|
|
356
360
|
val logLevel = if (hasKey("logLevel")) LogLevel.fromString(getString("logLevel")) else null
|
|
361
|
+
// Blank names no language: left out rather than handed to the SDK to be warned about.
|
|
362
|
+
val appLanguage = (if (hasKey("appLanguage")) getString("appLanguage") else null)
|
|
363
|
+
?.takeIf { it.isNotBlank() }
|
|
357
364
|
|
|
358
365
|
return AmplyInitializationOptions(
|
|
359
366
|
appId = appId,
|
|
@@ -365,6 +372,7 @@ class AmplyModule(reactContext: ReactApplicationContext) :
|
|
|
365
372
|
defaultConfig = defaultConfig,
|
|
366
373
|
debug = debug,
|
|
367
374
|
logLevel = logLevel,
|
|
375
|
+
appLanguage = appLanguage,
|
|
368
376
|
)
|
|
369
377
|
}
|
|
370
378
|
|
|
@@ -385,6 +385,21 @@ class DefaultAmplyClient(
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
override fun setAppLanguage(tag: String?) {
|
|
389
|
+
// Buffered like setUserId. The JS layer already holds a pre-init call and folds it into the
|
|
390
|
+
// config, so this only catches a call that reaches native before the instance exists anyway.
|
|
391
|
+
synchronized(propertyLock) {
|
|
392
|
+
val instance = amplyInstance
|
|
393
|
+
if (instance != null) {
|
|
394
|
+
instance.setAppLanguage(tag)
|
|
395
|
+
android.util.Log.i("AmplyReactNative", "App language set to: ${tag ?: "<null>"}")
|
|
396
|
+
} else {
|
|
397
|
+
android.util.Log.i("AmplyReactNative", "Buffering setAppLanguage until init")
|
|
398
|
+
pendingPropertyOps.add { it.setAppLanguage(tag) }
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
388
403
|
override fun setCustomProperty(key: String, value: Any) {
|
|
389
404
|
synchronized(propertyLock) {
|
|
390
405
|
val instance = amplyInstance
|
|
@@ -534,6 +549,8 @@ class DefaultAmplyClient(
|
|
|
534
549
|
}
|
|
535
550
|
}
|
|
536
551
|
options.defaultConfig?.let { defaultConfig = it }
|
|
552
|
+
// Same as setAppLanguage at init; the SDK applies it while building the instance.
|
|
553
|
+
options.appLanguage?.let { appLanguage = it }
|
|
537
554
|
}
|
|
538
555
|
}
|
|
539
556
|
|
package/android/src/main/java/tools/amply/sdk/reactnative/model/AmplyInitializationOptions.kt
CHANGED
|
@@ -35,6 +35,8 @@ data class AmplyInitializationOptions(
|
|
|
35
35
|
val defaultConfig: String?,
|
|
36
36
|
val debug: Boolean?,
|
|
37
37
|
val logLevel: LogLevel?,
|
|
38
|
+
/** The app's UI language, any common tag format. Same as setAppLanguage at init. */
|
|
39
|
+
val appLanguage: String? = null,
|
|
38
40
|
) {
|
|
39
41
|
/**
|
|
40
42
|
* Get the effective log level, resolving debug vs logLevel precedence.
|
|
@@ -90,6 +90,10 @@ public abstract class NativeAmplyModuleSpec extends ReactContextBaseJavaModule i
|
|
|
90
90
|
@DoNotStrip
|
|
91
91
|
public abstract void setUserId(@Nullable String userId);
|
|
92
92
|
|
|
93
|
+
@ReactMethod
|
|
94
|
+
@DoNotStrip
|
|
95
|
+
public abstract void setAppLanguage(@Nullable String tag);
|
|
96
|
+
|
|
93
97
|
@ReactMethod
|
|
94
98
|
@DoNotStrip
|
|
95
99
|
public abstract void setLogLevel(String level);
|
|
@@ -67,6 +67,11 @@ static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_setUserId(fa
|
|
|
67
67
|
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "setUserId", "(Ljava/lang/String;)V", args, count, cachedMethodId);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_setAppLanguage(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
71
|
+
static jmethodID cachedMethodId = nullptr;
|
|
72
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "setAppLanguage", "(Ljava/lang/String;)V", args, count, cachedMethodId);
|
|
73
|
+
}
|
|
74
|
+
|
|
70
75
|
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_setLogLevel(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
71
76
|
static jmethodID cachedMethodId = nullptr;
|
|
72
77
|
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "setLogLevel", "(Ljava/lang/String;)V", args, count, cachedMethodId);
|
|
@@ -120,6 +125,7 @@ NativeAmplyModuleSpecJSI::NativeAmplyModuleSpecJSI(const JavaTurboModule::InitPa
|
|
|
120
125
|
methodMap_["getDataSetSnapshot"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_getDataSetSnapshot};
|
|
121
126
|
methodMap_["registerDeepLinkListener"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_registerDeepLinkListener};
|
|
122
127
|
methodMap_["setUserId"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setUserId};
|
|
128
|
+
methodMap_["setAppLanguage"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setAppLanguage};
|
|
123
129
|
methodMap_["setLogLevel"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setLogLevel};
|
|
124
130
|
methodMap_["getLogLevel"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_getLogLevel};
|
|
125
131
|
methodMap_["setCustomProperties"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setCustomProperties};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `setAppLanguage` and the `appLanguage` initialization option.
|
|
3
|
+
*
|
|
4
|
+
* The SDK treats both as one setting with "last write wins": `appLanguage` in the config is the
|
|
5
|
+
* same as calling `setAppLanguage` at initialization. The native bridges cannot honour that order
|
|
6
|
+
* on their own for a call made BEFORE `initialize` — they buffer it and replay it after the SDK is
|
|
7
|
+
* built, which would let an earlier call overwrite the later config value. So the JS layer parks a
|
|
8
|
+
* pre-init call itself and folds it into the config it hands to native.
|
|
9
|
+
*
|
|
10
|
+
* Each test loads a fresh copy of the module: the parked value is module state, and leaking it
|
|
11
|
+
* from one test into the next would make every ordering assertion here meaningless.
|
|
12
|
+
*/
|
|
13
|
+
type AmplyModule = typeof import('../index');
|
|
14
|
+
declare function createNativeModule(): {
|
|
15
|
+
initialize: jest.Mock<Promise<void>, [], any>;
|
|
16
|
+
isInitialized: jest.Mock<boolean, [], any>;
|
|
17
|
+
setAppLanguage: jest.Mock<any, any, any>;
|
|
18
|
+
setUserId: jest.Mock<any, any, any>;
|
|
19
|
+
addListener: jest.Mock<any, any, any>;
|
|
20
|
+
removeListeners: jest.Mock<any, any, any>;
|
|
21
|
+
onSystemEvent: jest.Mock<{
|
|
22
|
+
remove: jest.Mock<any, any, any>;
|
|
23
|
+
}, [], any>;
|
|
24
|
+
onDeepLink: jest.Mock<{
|
|
25
|
+
remove: jest.Mock<any, any, any>;
|
|
26
|
+
}, [], any>;
|
|
27
|
+
onCampaignPresent: jest.Mock<{
|
|
28
|
+
remove: jest.Mock<any, any, any>;
|
|
29
|
+
}, [], any>;
|
|
30
|
+
/** Test-only: pretend the SDK is (or is not) up without going through initialize. */
|
|
31
|
+
setInitialized(value: boolean): void;
|
|
32
|
+
};
|
|
33
|
+
type NativeModuleMock = ReturnType<typeof createNativeModule>;
|
|
34
|
+
declare const KEYS: {
|
|
35
|
+
appId: string;
|
|
36
|
+
apiKeyPublic: string;
|
|
37
|
+
apiKeySecret: string;
|
|
38
|
+
};
|
|
39
|
+
declare function load(): {
|
|
40
|
+
Amply: AmplyModule;
|
|
41
|
+
native: NativeModuleMock;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=appLanguage.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appLanguage.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/appLanguage.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,KAAK,WAAW,GAAG,cAAc,UAAU,CAAC,CAAC;AAE7C,iBAAS,kBAAkB;;;;;;;;;;;;;;;;IAcvB,qFAAqF;0BAC/D,OAAO;EAIhC;AAED,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,QAAA,MAAM,IAAI;;;;CAAgE,CAAC;AAE3E,iBAAS,IAAI,IAAI;IAAC,KAAK,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAC,CAU9D"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function createNativeModule() {
|
|
3
|
+
let initialized = false;
|
|
4
|
+
return {
|
|
5
|
+
initialize: jest.fn(async () => {
|
|
6
|
+
initialized = true;
|
|
7
|
+
}),
|
|
8
|
+
isInitialized: jest.fn(() => initialized),
|
|
9
|
+
setAppLanguage: jest.fn(),
|
|
10
|
+
setUserId: jest.fn(),
|
|
11
|
+
addListener: jest.fn(),
|
|
12
|
+
removeListeners: jest.fn(),
|
|
13
|
+
onSystemEvent: jest.fn(() => ({ remove: jest.fn() })),
|
|
14
|
+
onDeepLink: jest.fn(() => ({ remove: jest.fn() })),
|
|
15
|
+
onCampaignPresent: jest.fn(() => ({ remove: jest.fn() })),
|
|
16
|
+
/** Test-only: pretend the SDK is (or is not) up without going through initialize. */
|
|
17
|
+
setInitialized(value) {
|
|
18
|
+
initialized = value;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const KEYS = { appId: 'id', apiKeyPublic: 'public', apiKeySecret: 'secret' };
|
|
23
|
+
function load() {
|
|
24
|
+
let Amply;
|
|
25
|
+
const native = createNativeModule();
|
|
26
|
+
jest.isolateModules(() => {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
28
|
+
require('../nativeModule').__setNativeModule(native);
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
30
|
+
Amply = require('../index');
|
|
31
|
+
});
|
|
32
|
+
return { Amply, native };
|
|
33
|
+
}
|
|
34
|
+
describe('setAppLanguage after initialization', () => {
|
|
35
|
+
it.each(['pt_BR', 'zh-TW', 'FR', 'Français'])('forwards %p to the native SDK verbatim — parsing and the warning for junk are the SDK’s job', tag => {
|
|
36
|
+
const { Amply, native } = load();
|
|
37
|
+
native.setInitialized(true);
|
|
38
|
+
Amply.setAppLanguage(tag);
|
|
39
|
+
expect(native.setAppLanguage).toHaveBeenCalledTimes(1);
|
|
40
|
+
expect(native.setAppLanguage).toHaveBeenCalledWith(tag);
|
|
41
|
+
});
|
|
42
|
+
it('forwards null, which returns the SDK to automatic detection', () => {
|
|
43
|
+
const { Amply, native } = load();
|
|
44
|
+
native.setInitialized(true);
|
|
45
|
+
Amply.setAppLanguage(null);
|
|
46
|
+
expect(native.setAppLanguage).toHaveBeenCalledWith(null);
|
|
47
|
+
});
|
|
48
|
+
it('is on the default export as well', () => {
|
|
49
|
+
const { Amply, native } = load();
|
|
50
|
+
native.setInitialized(true);
|
|
51
|
+
Amply.default.setAppLanguage('de');
|
|
52
|
+
expect(native.setAppLanguage).toHaveBeenCalledWith('de');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
describe('appLanguage in the initialization config', () => {
|
|
56
|
+
it('is passed through to the native initialize', async () => {
|
|
57
|
+
const { Amply, native } = load();
|
|
58
|
+
await Amply.initialize({ ...KEYS, appLanguage: 'pt_BR' });
|
|
59
|
+
expect(native.initialize).toHaveBeenCalledWith(expect.objectContaining({ appLanguage: 'pt_BR' }));
|
|
60
|
+
expect(native.setAppLanguage).not.toHaveBeenCalled();
|
|
61
|
+
});
|
|
62
|
+
it('is left out of the native config when the caller did not give one', async () => {
|
|
63
|
+
const { Amply, native } = load();
|
|
64
|
+
await Amply.initialize(KEYS);
|
|
65
|
+
const [config] = native.initialize.mock.calls[0];
|
|
66
|
+
expect(config).not.toHaveProperty('appLanguage');
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
describe('setAppLanguage before initialization', () => {
|
|
70
|
+
it('is not sent to a native SDK that is not up yet', () => {
|
|
71
|
+
const { Amply, native } = load();
|
|
72
|
+
Amply.setAppLanguage('fr');
|
|
73
|
+
expect(native.setAppLanguage).not.toHaveBeenCalled();
|
|
74
|
+
});
|
|
75
|
+
it('reaches the SDK as the config appLanguage when initialize names none', async () => {
|
|
76
|
+
const { Amply, native } = load();
|
|
77
|
+
Amply.setAppLanguage('fr');
|
|
78
|
+
await Amply.initialize(KEYS);
|
|
79
|
+
expect(native.initialize).toHaveBeenCalledWith(expect.objectContaining({ appLanguage: 'fr' }));
|
|
80
|
+
expect(native.setAppLanguage).not.toHaveBeenCalled();
|
|
81
|
+
});
|
|
82
|
+
it('keeps only the last of several calls', async () => {
|
|
83
|
+
const { Amply, native } = load();
|
|
84
|
+
Amply.setAppLanguage('fr');
|
|
85
|
+
Amply.setAppLanguage('de');
|
|
86
|
+
await Amply.initialize(KEYS);
|
|
87
|
+
expect(native.initialize).toHaveBeenCalledWith(expect.objectContaining({ appLanguage: 'de' }));
|
|
88
|
+
});
|
|
89
|
+
it('loses to an appLanguage given to the later initialize call', async () => {
|
|
90
|
+
const { Amply, native } = load();
|
|
91
|
+
Amply.setAppLanguage('fr');
|
|
92
|
+
await Amply.initialize({ ...KEYS, appLanguage: 'de' });
|
|
93
|
+
expect(native.initialize).toHaveBeenCalledWith(expect.objectContaining({ appLanguage: 'de' }));
|
|
94
|
+
expect(native.setAppLanguage).not.toHaveBeenCalled();
|
|
95
|
+
});
|
|
96
|
+
it('wins over a blank appLanguage in the config, which names no language', async () => {
|
|
97
|
+
const { Amply, native } = load();
|
|
98
|
+
Amply.setAppLanguage('fr');
|
|
99
|
+
await Amply.initialize({ ...KEYS, appLanguage: ' ' });
|
|
100
|
+
expect(native.initialize).toHaveBeenCalledWith(expect.objectContaining({ appLanguage: 'fr' }));
|
|
101
|
+
});
|
|
102
|
+
// null cannot travel in the config — there it means "leave the setting alone" — so a parked
|
|
103
|
+
// clear is applied as a call once the SDK is up.
|
|
104
|
+
it('applies a parked null right after initialization', async () => {
|
|
105
|
+
const { Amply, native } = load();
|
|
106
|
+
Amply.setAppLanguage(null);
|
|
107
|
+
await Amply.initialize(KEYS);
|
|
108
|
+
const [config] = native.initialize.mock.calls[0];
|
|
109
|
+
expect(config).not.toHaveProperty('appLanguage');
|
|
110
|
+
expect(native.setAppLanguage).toHaveBeenCalledTimes(1);
|
|
111
|
+
expect(native.setAppLanguage).toHaveBeenCalledWith(null);
|
|
112
|
+
});
|
|
113
|
+
it('drops a parked null when the later initialize names a language', async () => {
|
|
114
|
+
const { Amply, native } = load();
|
|
115
|
+
Amply.setAppLanguage(null);
|
|
116
|
+
await Amply.initialize({ ...KEYS, appLanguage: 'de' });
|
|
117
|
+
expect(native.initialize).toHaveBeenCalledWith(expect.objectContaining({ appLanguage: 'de' }));
|
|
118
|
+
expect(native.setAppLanguage).not.toHaveBeenCalled();
|
|
119
|
+
});
|
|
120
|
+
it('survives an initialize that fails, and is used by the retry', async () => {
|
|
121
|
+
const { Amply, native } = load();
|
|
122
|
+
Amply.setAppLanguage('fr');
|
|
123
|
+
native.initialize.mockImplementationOnce(async () => {
|
|
124
|
+
throw new Error('AMP_INIT_FAILED');
|
|
125
|
+
});
|
|
126
|
+
await expect(Amply.initialize(KEYS)).rejects.toThrow('AMP_INIT_FAILED');
|
|
127
|
+
await Amply.initialize(KEYS);
|
|
128
|
+
expect(native.initialize).toHaveBeenLastCalledWith(expect.objectContaining({ appLanguage: 'fr' }));
|
|
129
|
+
});
|
|
130
|
+
it('survives an initialize rejected for a missing key', async () => {
|
|
131
|
+
const { Amply, native } = load();
|
|
132
|
+
const error = jest.spyOn(console, 'error').mockImplementation(() => { });
|
|
133
|
+
Amply.setAppLanguage('fr');
|
|
134
|
+
await expect(Amply.initialize({ ...KEYS, apiKeySecret: '' })).rejects.toMatchObject({
|
|
135
|
+
code: 'AMP_INVALID_CONFIG',
|
|
136
|
+
});
|
|
137
|
+
await Amply.initialize(KEYS);
|
|
138
|
+
expect(native.initialize).toHaveBeenCalledTimes(1);
|
|
139
|
+
expect(native.initialize).toHaveBeenCalledWith(expect.objectContaining({ appLanguage: 'fr' }));
|
|
140
|
+
error.mockRestore();
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
describe('setAppLanguage while initialize is in flight', () => {
|
|
144
|
+
it('is applied after initialization, so it wins over the config value it came after', async () => {
|
|
145
|
+
const { Amply, native } = load();
|
|
146
|
+
let finishInit;
|
|
147
|
+
native.initialize.mockImplementationOnce(() => new Promise(resolve => {
|
|
148
|
+
finishInit = () => {
|
|
149
|
+
native.setInitialized(true);
|
|
150
|
+
resolve();
|
|
151
|
+
};
|
|
152
|
+
}));
|
|
153
|
+
const init = Amply.initialize({ ...KEYS, appLanguage: 'de' });
|
|
154
|
+
Amply.setAppLanguage('fr');
|
|
155
|
+
expect(native.setAppLanguage).not.toHaveBeenCalled();
|
|
156
|
+
finishInit();
|
|
157
|
+
await init;
|
|
158
|
+
expect(native.initialize).toHaveBeenCalledWith(expect.objectContaining({ appLanguage: 'de' }));
|
|
159
|
+
expect(native.setAppLanguage).toHaveBeenCalledTimes(1);
|
|
160
|
+
expect(native.setAppLanguage).toHaveBeenCalledWith('fr');
|
|
161
|
+
});
|
|
162
|
+
// The native SDK reports itself up before the initialize promise settles, so a call made in
|
|
163
|
+
// that window goes straight through. A value held from before initialize is older than it and
|
|
164
|
+
// must not be replayed over it when the promise finally resolves.
|
|
165
|
+
function hangInitialize(native) {
|
|
166
|
+
const control = { comeUp: () => { }, resolve: () => { }, reject: (_error) => { } };
|
|
167
|
+
native.initialize.mockImplementationOnce(() => new Promise((resolve, reject) => {
|
|
168
|
+
control.comeUp = () => native.setInitialized(true);
|
|
169
|
+
control.resolve = resolve;
|
|
170
|
+
control.reject = reject;
|
|
171
|
+
}));
|
|
172
|
+
return control;
|
|
173
|
+
}
|
|
174
|
+
it('does not replay an older held null over a call the SDK already received', async () => {
|
|
175
|
+
const { Amply, native } = load();
|
|
176
|
+
Amply.setAppLanguage(null);
|
|
177
|
+
const init = hangInitialize(native);
|
|
178
|
+
const pending = Amply.initialize(KEYS);
|
|
179
|
+
init.comeUp();
|
|
180
|
+
Amply.setAppLanguage('fr');
|
|
181
|
+
init.resolve();
|
|
182
|
+
await pending;
|
|
183
|
+
expect(native.setAppLanguage.mock.calls).toEqual([['fr']]);
|
|
184
|
+
});
|
|
185
|
+
it('does not replay an older held tag over a call the SDK already received', async () => {
|
|
186
|
+
const { Amply, native } = load();
|
|
187
|
+
const init = hangInitialize(native);
|
|
188
|
+
const pending = Amply.initialize(KEYS);
|
|
189
|
+
Amply.setAppLanguage('de');
|
|
190
|
+
init.comeUp();
|
|
191
|
+
Amply.setAppLanguage('fr');
|
|
192
|
+
init.resolve();
|
|
193
|
+
await pending;
|
|
194
|
+
expect(native.setAppLanguage.mock.calls).toEqual([['fr']]);
|
|
195
|
+
});
|
|
196
|
+
it('does not hand a superseded held tag to the retry of a failed initialize', async () => {
|
|
197
|
+
const { Amply, native } = load();
|
|
198
|
+
Amply.setAppLanguage('de');
|
|
199
|
+
const init = hangInitialize(native);
|
|
200
|
+
const pending = Amply.initialize(KEYS);
|
|
201
|
+
init.comeUp();
|
|
202
|
+
Amply.setAppLanguage('fr');
|
|
203
|
+
init.reject(new Error('AMP_INIT_FAILED'));
|
|
204
|
+
await expect(pending).rejects.toThrow('AMP_INIT_FAILED');
|
|
205
|
+
native.setInitialized(false);
|
|
206
|
+
await Amply.initialize(KEYS);
|
|
207
|
+
const [retryConfig] = native.initialize.mock.calls[1];
|
|
208
|
+
expect(retryConfig).not.toHaveProperty('appLanguage');
|
|
209
|
+
expect(native.setAppLanguage.mock.calls).toEqual([['fr']]);
|
|
210
|
+
});
|
|
211
|
+
});
|
package/dist/src/index.d.ts
CHANGED
|
@@ -17,6 +17,20 @@ export declare class AmplyConfigError extends Error {
|
|
|
17
17
|
constructor(message: string);
|
|
18
18
|
}
|
|
19
19
|
export declare function initialize(config: AmplyInitializationConfig): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Tell Amply the language your app's UI is in, so sheets, stories and mini-apps show in the
|
|
22
|
+
* matching language and campaigns can target it. Use this when the app chooses its language
|
|
23
|
+
* itself (an in-app language picker, i18next, …) rather than following the device.
|
|
24
|
+
*
|
|
25
|
+
* Any common tag format works — `'pt_BR'`, `'pt-BR'`, `'zh-TW'`, `'fr'`, any case. A value that
|
|
26
|
+
* is not a language tag is ignored by the SDK with a warning log. The value is persisted across
|
|
27
|
+
* launches; pass `null` to return to automatic detection. The device language is never changed.
|
|
28
|
+
*
|
|
29
|
+
* Safe to call before {@link initialize}: the value is held and applied at initialization, and
|
|
30
|
+
* an `appLanguage` passed to a later `initialize` call wins over it.
|
|
31
|
+
* @param tag The language tag, or null to clear
|
|
32
|
+
*/
|
|
33
|
+
export declare function setAppLanguage(tag: string | null): void;
|
|
20
34
|
/**
|
|
21
35
|
* Set the user ID for analytics. Pass null to clear.
|
|
22
36
|
* @param userId The user ID to set, or null to clear
|
|
@@ -184,6 +198,7 @@ declare const _default: {
|
|
|
184
198
|
addSystemEventsListener: typeof addSystemEventsListener;
|
|
185
199
|
removeAllListeners: typeof removeAllListeners;
|
|
186
200
|
setUserId: typeof setUserId;
|
|
201
|
+
setAppLanguage: typeof setAppLanguage;
|
|
187
202
|
setLogLevel: typeof setLogLevel;
|
|
188
203
|
getLogLevel: typeof getLogLevel;
|
|
189
204
|
setCustomProperty: typeof setCustomProperty;
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAC1D,YAAY,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,yBAAyB,IAAI,0BAA0B,EACvD,eAA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GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEtD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAyBzC;AAED,YAAY,EACV,eAAe,EACf,WAAW,EACX,aAAa,EACb,WAAW,EACX,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,GAClB,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GACrC,OAAO,CAAC,MAAM,IAAI,CAAC,CAErB;AAED,eAAO,MAAM,YAAY;;CAExB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,wBAuBE"}
|
package/dist/src/index.js
CHANGED
|
@@ -186,10 +186,86 @@ export async function initialize(config) {
|
|
|
186
186
|
if (config.debug || config.logLevel) {
|
|
187
187
|
ensureDebugLogListener();
|
|
188
188
|
}
|
|
189
|
-
|
|
189
|
+
// Taken now, synchronously: a call made after this point is later than the config and must
|
|
190
|
+
// stay parked so it is applied after it.
|
|
191
|
+
const parked = takeParkedAppLanguage();
|
|
192
|
+
try {
|
|
193
|
+
await getNativeModule().initialize(withParkedAppLanguage(config, parked));
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
// Nothing reached the SDK, so the call still has to — unless a newer one replaced it.
|
|
197
|
+
if (parkedAppLanguage == null && isLatestLanguageWrite(parked)) {
|
|
198
|
+
parkedAppLanguage = parked;
|
|
199
|
+
}
|
|
200
|
+
throw error;
|
|
201
|
+
}
|
|
202
|
+
// A parked clear cannot travel in the config, where null means "leave it alone". Replayed only
|
|
203
|
+
// if nothing newer came in while initialize was in flight: the native SDK reports itself up
|
|
204
|
+
// before this promise settles, and a call made in that window has already reached it.
|
|
205
|
+
if ((parked === null || parked === void 0 ? void 0 : parked.tag) === null && !hasText(config.appLanguage) && isLatestLanguageWrite(parked)) {
|
|
206
|
+
getNativeModule().setAppLanguage(null);
|
|
207
|
+
}
|
|
208
|
+
flushParkedAppLanguage();
|
|
190
209
|
// Anything the host registered before this point was parked rather than lost.
|
|
191
210
|
replayPendingRegistrations();
|
|
192
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* A {@link setAppLanguage} call made before the SDK was up. Boxed so that a parked `null` — a
|
|
214
|
+
* request to return to automatic detection — is distinguishable from nothing parked.
|
|
215
|
+
*
|
|
216
|
+
* The native bridges buffer such calls too, but replay them AFTER building the SDK, which applies
|
|
217
|
+
* the config's `appLanguage` first. An earlier call would then overwrite a later config value,
|
|
218
|
+
* the opposite of "last write wins". Parking it here lets {@link initialize} put the two in the
|
|
219
|
+
* order they were made.
|
|
220
|
+
*/
|
|
221
|
+
let parkedAppLanguage = null;
|
|
222
|
+
/** Bumped by every {@link setAppLanguage} call, whether it is forwarded or held. */
|
|
223
|
+
let languageWriteSeq = 0;
|
|
224
|
+
function isLatestLanguageWrite(write) {
|
|
225
|
+
return write != null && write.seq === languageWriteSeq;
|
|
226
|
+
}
|
|
227
|
+
function hasText(value) {
|
|
228
|
+
return typeof value === 'string' && value.trim().length > 0;
|
|
229
|
+
}
|
|
230
|
+
function takeParkedAppLanguage() {
|
|
231
|
+
const parked = parkedAppLanguage;
|
|
232
|
+
parkedAppLanguage = null;
|
|
233
|
+
return parked;
|
|
234
|
+
}
|
|
235
|
+
/** The config's own appLanguage wins: initialize was called after the parked call. */
|
|
236
|
+
function withParkedAppLanguage(config, parked) {
|
|
237
|
+
if (hasText(config.appLanguage) || parked == null || parked.tag === null) {
|
|
238
|
+
return config;
|
|
239
|
+
}
|
|
240
|
+
return { ...config, appLanguage: parked.tag };
|
|
241
|
+
}
|
|
242
|
+
function flushParkedAppLanguage() {
|
|
243
|
+
const parked = takeParkedAppLanguage();
|
|
244
|
+
if (isLatestLanguageWrite(parked)) {
|
|
245
|
+
getNativeModule().setAppLanguage(parked.tag);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Tell Amply the language your app's UI is in, so sheets, stories and mini-apps show in the
|
|
250
|
+
* matching language and campaigns can target it. Use this when the app chooses its language
|
|
251
|
+
* itself (an in-app language picker, i18next, …) rather than following the device.
|
|
252
|
+
*
|
|
253
|
+
* Any common tag format works — `'pt_BR'`, `'pt-BR'`, `'zh-TW'`, `'fr'`, any case. A value that
|
|
254
|
+
* is not a language tag is ignored by the SDK with a warning log. The value is persisted across
|
|
255
|
+
* launches; pass `null` to return to automatic detection. The device language is never changed.
|
|
256
|
+
*
|
|
257
|
+
* Safe to call before {@link initialize}: the value is held and applied at initialization, and
|
|
258
|
+
* an `appLanguage` passed to a later `initialize` call wins over it.
|
|
259
|
+
* @param tag The language tag, or null to clear
|
|
260
|
+
*/
|
|
261
|
+
export function setAppLanguage(tag) {
|
|
262
|
+
languageWriteSeq += 1;
|
|
263
|
+
if (isSdkUp()) {
|
|
264
|
+
getNativeModule().setAppLanguage(tag);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
parkedAppLanguage = { tag, seq: languageWriteSeq };
|
|
268
|
+
}
|
|
193
269
|
/**
|
|
194
270
|
* Set the user ID for analytics. Pass null to clear.
|
|
195
271
|
* @param userId The user ID to set, or null to clear
|
|
@@ -482,6 +558,7 @@ export default {
|
|
|
482
558
|
addSystemEventsListener,
|
|
483
559
|
removeAllListeners,
|
|
484
560
|
setUserId,
|
|
561
|
+
setAppLanguage,
|
|
485
562
|
setLogLevel,
|
|
486
563
|
getLogLevel,
|
|
487
564
|
setCustomProperty,
|
|
@@ -44,6 +44,12 @@ export type AmplyInitializationConfig = {
|
|
|
44
44
|
* Takes precedence over `debug` if both are specified.
|
|
45
45
|
*/
|
|
46
46
|
logLevel?: LogLevel | null;
|
|
47
|
+
/**
|
|
48
|
+
* The language the app's UI is in, in any common format (`'pt_BR'`, `'zh-TW'`, `'fr'`).
|
|
49
|
+
* The same as calling `setAppLanguage` right after initialization, and persisted the same
|
|
50
|
+
* way. Omitted, null or blank leaves the current setting alone.
|
|
51
|
+
*/
|
|
52
|
+
appLanguage?: string | null;
|
|
47
53
|
};
|
|
48
54
|
export type EventType = 'custom' | 'system';
|
|
49
55
|
export type TrackEventPayload = {
|
|
@@ -196,6 +202,12 @@ export interface Spec extends TurboModule {
|
|
|
196
202
|
* @param userId The user ID to set, or null to clear
|
|
197
203
|
*/
|
|
198
204
|
setUserId(userId: string | null): void;
|
|
205
|
+
/**
|
|
206
|
+
* Set the language the app's UI is in. Any common tag format; null returns to automatic
|
|
207
|
+
* detection. Persisted by the SDK across launches.
|
|
208
|
+
* @param tag The language tag, or null to clear
|
|
209
|
+
*/
|
|
210
|
+
setAppLanguage(tag: string | null): void;
|
|
199
211
|
/**
|
|
200
212
|
* Set the log level at runtime.
|
|
201
213
|
* @param level The log level to set
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAmplyModule.d.ts","sourceRoot":"","sources":["../../../src/nativeSpecs/NativeAmplyModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,2CAA2C,CAAC;AAE5E,KAAK,OAAO,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpE,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,QA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