sumup / sumup-android-sdk

Sample App for the SumUp Android SDK
Other
107 stars 28 forks source link

Unable to connect to the terminal after closing and restarting the app #197

Open jnorkus opened 1 year ago

jnorkus commented 1 year ago

As the title suggests, our app is unable to connect to the terminal after closing it by swiping it out of the recents list. Steps to reproduce:

  1. Create a transaction
  2. Complete it or cancel it
  3. Close the app (by swiping it out of the recents list)
  4. Open the app again
  5. Create a transaction

Result: the terminal no longer connects

Workaround: force close the app and start it again.

Additional info: Our app has a foreground service that keeps the app running all the time. This service comes with android:stopWithTask="true" in the AndroidManifest.xml, so when the app is closed manually by swiping it out of the recents list, the foreground service stops and the app closes. However, the process does not seem to be killed by Android at this point and after relaunching the app, SumUp is no longer working. The app needs to be force closed to restore connectivity.

omerguen commented 1 year ago

The same issue I do have now. After upgrading to 4.0.3 but a little different:

  1. Create a transaction
  2. Complete it or cancel it
  3. Create another transaction

Result: the cardreader is no longer connected

I have to kill my app and start it over again. After that reapeats Steps 1-3.

PLEASE HELP our customers wait for a solution, because the have to use new Cardreaders with serial numbers greater then 108

Log: E/SumUp: (SourceFile:13)@BtSmart-Receiver | onFatalError() CardReaderError{Name = TRANSPORT_DISCONNECTED mErrorCode=3} E/SumUp: (SourceFile:2)@BtSmart-Receiver | onTransportError() CardReaderError{Name = TRANSPORT_DISCONNECTED mErrorCode=3} E/SumUp: (SourceFile:1)@main | Reader error received: CardReaderError{Name = TRANSPORT_DISCONNECTED mErrorCode=3}

NOTE: it is happening when the main activity that is calling SumUpAPI.checkout getting destroyed. This is not happening in the sample App.

MY PROBLEM IS SOLVED: you have to call SumUpState.init(this) not in the activity, call it in Application()

andreysuprano commented 1 year ago

I have the same problem, Testing the Sumup Solo and after payment, i close and open the app, but app not connected on card reader.