Skip to content

Commit 6409d49

Browse files
committed
Merged PR 2133: adding the missing parameters: layoutName, language
Related work items: #6758
1 parent 15c18b3 commit 6409d49

File tree

4 files changed

+30
-8
lines changed

4 files changed

+30
-8
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,15 @@ enqueue = async () => {
5050
QueueIt.once('userExited', () => {
5151
console.log('user exited the line');
5252
});
53+
//Optional layout name that should be used for the waiting room page
54+
const layoutName = null;
55+
//Optional language for the waiting room page
56+
const language = null;
5357
const enqueueResult = await QueueIt.run(
5458
this.state.customerId,
55-
this.state.eventOrAliasId
59+
this.state.eventOrAliasId,
60+
layoutName,
61+
language
5662
);
5763
switch (enqueueResult.State) {
5864
case EnqueueResultState.Disabled:

android/src/main/java/com/reactnativequeueit/QueueItModule.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class QueueItModule(reactContext: ReactApplicationContext)
2626
}
2727

2828
@ReactMethod
29-
fun runAsync(customerId: String, eventAlias: String, promise: Promise) {
29+
fun runAsync(customerId: String, eventAlias: String, layoutName: String?, language: String?, promise: Promise) {
3030
val qListener = object : QueueListener {
3131
override fun onUserExited() {
3232
val params = Arguments.createMap()
@@ -74,7 +74,7 @@ class QueueItModule(reactContext: ReactApplicationContext)
7474
}
7575

7676
handler.post(Runnable {
77-
val queueEngine = QueueITEngine(context.currentActivity, customerId, eventAlias, qListener)
77+
val queueEngine = QueueITEngine(context.currentActivity, customerId, eventAlias, layoutName, language, qListener)
7878
queueEngine.run(context.currentActivity)
7979
})
8080
}

ios/QueueIt.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ - (dispatch_queue_t)methodQueue
3030
RCT_REMAP_METHOD(runAsync,
3131
runAsync:(nonnull NSString*) customerId
3232
eventOrAliasId:(nonnull NSString*) eventOrAliasId
33+
layoutName:(NSString*) layoutName
34+
language: (NSString*) language
3335
withResolver:(RCTPromiseResolveBlock)resolve
3436
withRejecter:(RCTPromiseRejectBlock)reject){
35-
NSString* layoutName = nil; // Optional (pass nil if no layout specified)
36-
NSString* language = nil; // Optional (pass nil if no language specified)
3737

3838
UIViewController* vc = RCTPresentedViewController();
3939
self.engine = [[QueueITEngine alloc]initWithHost:vc customerId:customerId eventOrAliasId:eventOrAliasId layoutName:layoutName language:language]; //ARC

src/index.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ import {
77

88
const nativeQueueIt = NativeModules.QueueIt as EventSubscriptionVendor & {
99
enableTesting(value: boolean): void;
10-
runAsync(clientId: string, eventOrAlias: string): Promise<any>;
10+
runAsync(
11+
clientId: string,
12+
eventOrAlias: string,
13+
layoutName?: string,
14+
language?: string
15+
): Promise<any>;
1116
};
1217
const queueItEventEmitter = new NativeEventEmitter(nativeQueueIt);
1318

@@ -27,8 +32,19 @@ class QueueItEngine {
2732
nativeQueueIt.enableTesting(value);
2833
}
2934

30-
async run(customerId: string, eventOrAliasId: string): Promise<EnqueueResult> {
31-
const result = await nativeQueueIt.runAsync(customerId, eventOrAliasId);
35+
async run(
36+
customerId: string,
37+
eventOrAliasId: string,
38+
layoutName?: string,
39+
language?: string
40+
): Promise<EnqueueResult> {
41+
const result = await nativeQueueIt.runAsync(
42+
customerId,
43+
eventOrAliasId,
44+
layoutName,
45+
language
46+
);
47+
3248
return {
3349
QueueITToken: result.queueittoken,
3450
State: result.state,

0 commit comments

Comments
 (0)