queueit / android-webui-sdk Goto Github PK
View Code? Open in Web Editor NEWLibrary for integrating Queue-it into an Android app using web ui
License: MIT License
Library for integrating Queue-it into an Android app using web ui
License: MIT License
Initial activation of the back button through the SDK works successfully, with the button functioning correctly during normal background-foreground transitions. However, it has been observed that after a period of prolonged inactivity in the background, the back button ceases to respond.
After some investigation we discovered that you forget to save/restore the state of back button in/from the bundle:
// save the state
public void saveInstanceState(Bundle outState) {
outState.putString("queueUrl", queueUrl);
outState.putString("targetUrl", targetUrl);
outState.putString("userId", uriOverrider.getUserId());
}
// restore the state
private void readActivityExtras(Bundle savedInstanceState) {
if (savedInstanceState == null) {
Bundle extras = _context.getIntent().getExtras();
if (extras == null) {
queueUrl = null;
targetUrl = null;
} else {
queueUrl = extras.getString("queueUrl");
targetUrl = extras.getString("targetUrl");
uriOverrider.setUserId(extras.getString("userId"));
options = (QueueItEngineOptions)extras.getParcelable("options");
}
} else {
queueUrl = (String) savedInstanceState.getSerializable("queueUrl");
targetUrl = (String) savedInstanceState.getSerializable("targetUrl");
uriOverrider.setUserId((String) savedInstanceState.getSerializable("userId"));
}
uriOverrider.setTarget(Uri.parse(targetUrl));
uriOverrider.setQueue(Uri.parse(queueUrl));
}
Instead of:
// save the state
public void saveInstanceState(Bundle outState) {
outState.putString("queueUrl", queueUrl);
outState.putString("targetUrl", targetUrl);
outState.putString("userId", uriOverrider.getUserId());
outState.putParcelable("options", options); <-- HERE
}
// restore the state
private void readActivityExtras(Bundle savedInstanceState) {
if (savedInstanceState == null) {
...
} else {
queueUrl = (String) savedInstanceState.getSerializable("queueUrl");
targetUrl = (String) savedInstanceState.getSerializable("targetUrl");
uriOverrider.setUserId((String) savedInstanceState.getSerializable("userId"));
options = (QueueItEngineOptions) savedInstanceState.getParcelable("options"); <-- HERE
}
...
}
Sometimes the app is crashing with the following logs
Fatal Exception: java.lang.RuntimeException: org.json.JSONException: Value <!-- of type java.lang.String cannot be converted to JSONObject at com.queue_it.androidsdk.QueueService$1.onResponse(QueueService.java:115) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:133) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by org.json.JSONException: Value <!-- of type java.lang.String cannot be converted to JSONObject at org.json.JSON.typeMismatch(JSON.java:111) at org.json.JSONObject.<init>(JSONObject.java:160) at org.json.JSONObject.<init>(JSONObject.java:173) at com.newrelic.agent.android.instrumentation.JSONObjectInstrumentation.init(JSONObjectInstrumentation.java:22) at com.queue_it.androidsdk.QueueService$1.onResponse(QueueService.java:102) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:133) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)
Seems like that HTML is coming instead of JSON in the response
Please document clearly to ensure that the connector token type in the waiting room settings is set to v3 or higher, not JavaScript. The mobile SDK searches for the 'queueittoken' parameter to extract the token value. However, if JavaScript is used, the 'qitq' parameter conveys the value, leading to issues with the token retrieval process.
Fatal Exception: android.util.AndroidRuntimeException
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
c12908d#diff-1f3dc5e8980ff89374ad03346022cb89R192
Related SO question: https://stackoverflow.com/questions/3918517/calling-startactivity-from-outside-of-an-activity-context
The following exception happens in the app which uses QueueIt SDK. I believe that SDK should handle the missing WebView package gracefully. Maybe propagate the error through an error callback.
We are using 2.0.35 version of SDK.
Caused by android.webkit.WebViewFactory$MissingWebViewPackageException
Failed to load WebView provider: No WebView installed
android.webkit.WebViewFactory.getWebViewContextAndSetProvider (WebViewFactory.java:339)
android.webkit.WebViewFactory.getProviderClass (WebViewFactory.java:402)
android.webkit.WebViewFactory.getProvider (WebViewFactory.java:252)
android.webkit.WebView.getFactory (WebView.java:2576)
android.webkit.WebView.ensureProviderCreated (WebView.java:2570)
android.webkit.WebView.setOverScrollMode (WebView.java:2638)
android.view.View. (View.java:5328)
android.view.View. (View.java:5474)
android.view.ViewGroup. (ViewGroup.java:697)
android.widget.AbsoluteLayout. (AbsoluteLayout.java:56)
android.webkit.WebView. (WebView.java:413)
android.webkit.WebView. (WebView.java:355)
android.webkit.WebView. (WebView.java:337)
android.webkit.WebView. (WebView.java:324)
android.webkit.WebView. (WebView.java:314)
com.queue_it.androidsdk.UserAgentManager.initialize (UserAgentManager.java:2)
com.queue_it.androidsdk.QueueITEngine. (QueueITEngine.java:77)
QueueITEngine does not handle activity life cycle at all. It may cause crashes if the activity is destroyed by OS or in background. Please fix it.
There is a constructor for QueueITEngine
that has a parameter Activity applicationContext
, which is misleading in its name, and seems like an unnecessary type restriction. The only places I saw in the code that the context is used is for fetching various resources and system services. This restriction to Activity
contexts prevents one from running a queue in a global context from the Application class. Is there a reason for restricting the type to Activity
? It seems like there was an issue a few years ago where it was changed to the more generic Context
, but was then changed back in 5a3262e without renaming it from applicationContext
.
Bintray is scheduled to be dismissed on May 1st, 2021, and no more submissions will be accepted starting from February 28th.
Realm should be migrated to Maven Central as soon as possible.
https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
Would it be possible to migrate to the AndroidX libraries?
I am hoping to turn off the Jetifier tool (as this is blocking us from updating other tooling) and this is the only library in my project that still uses the support libraries.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.