I have this error when trying to.
Every thing works perfect with b4j and b4a.
It show
B4X:
Dim PIp As String = DefaultPayTerminalMAP.Get("printer_address")
Dim Pport As Int = DefaultPayTerminalMAP.Get("printer_port")
PayTerminal.Initialize("PayTerminal")
PayTerminal.Connect(PIp, Pport, 0)
Wait For (PayTerminal) PayTerminal_Connected (Successful As Boolean)
Log("PayTerminal.IsInitialized = " & PayTerminal.IsInitialized)
Log("PayTerminal.Connected = " & PayTerminal.Connected)
If Successful Then
Log("PayTerminal.IsInitialized = " & PayTerminal.IsInitialized)
Log("PayTerminal.Connected = " & PayTerminal.Connected)
TerminalRequestStatus = "CONNECTED"
Log("TerminalRequestStatus = " & TerminalRequestStatus)
Log("PayTerminal.InputStream, = " & PayTerminal.InputStream.IsInitialized)
Log("PayTerminal.OutputStream = " & PayTerminal.OutputStream.IsInitialized)
'The code app crashes here.
PayTerminalStream.Initialize(PayTerminal.InputStream, PayTerminal.OutputStream, "PayTerminalStream")
PayTerminalStream.Write(SendStr.GetBytes("UTF-8"))
'The code app crashes here.
PayTerminalStream.Initialize(PayTerminal.InputStream, PayTerminal.OutputStream, "PayTerminalStream")
Every thing works perfect with b4j and b4a.
It show
B4X:
PayTerminal.IsInitialized = false
PayTerminal.Connected = false
Error occurred on line: 15 (B4XPages)
*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[49]
Stack Trace: (
CoreFoundation __exceptionPreprocess + 242
libobjc.A.dylib objc_exception_throw + 62
CoreFoundation -[__NSPlaceholderArray initWithObjects:count:] + 482
CoreFoundation +[NSArray arrayWithObjects:count:] + 40
CHICPOS -[ResumableSub_dashboardpage_SendPayTerminalRequest resume::] + 1886
CHICPOS -[b4i_dashboardpage _sendpayterminalrequest::::] + 670
CoreFoundation __invoking___ + 140
CoreFoundation -[NSInvocation invoke] + 302
CHICPOS +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1519
CHICPOS -[B4IShell runMethod:] + 376
CHICPOS -[B4IShell raiseEventImpl:method:args::] + 1618
CHICPOS -[B4IShellBI raiseEvent:event:params:] + 1350
CHICPOS -[b4i_dashboardpage _processmixedpayments:] + 183
CHICPOS -[b4i_dashboardpage _btnsubmitcartpay_click:] + 2219
CoreFoundation __invoking___ + 140
CoreFoundation -[NSInvocation invoke] + 302
CHICPOS +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1519
CHICPOS -[B4IShell runMethod:] + 376
CHICPOS -[B4IShell raiseEventImpl:method:args::] + 1618
CHICPOS -[B4IShellBI raiseEvent:event:params:] + 1350
CHICPOS __33-[B4I raiseUIEvent:event:params:]_block_invoke + 48
libdispatch.dylib _dispatch_call_block_and_release + 12
libdispatch.dylib _dispatch_client_callout + 8
libdispatch.dylib _dispatch_main_queue_drain + 1421
libdispatch.dylib _dispatch_main_queue_callback_4CF + 31
CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
CoreFoundation __CFRunLoopRun + 2515
CoreFoundation CFRunLoopRunSpecific + 550
GraphicsServices GSEventRunModal + 137
UIKitCore -[UIApplication _run] + 875
UIKitCore UIApplicationMain + 123
CHICPOS main + 96
dyld start_sim + 10
??? 0x0 + 4496971056
)