Closed pablomatgar closed 2 years ago
I tried to solve it by adding some async/await and also, checking code from other users in Google, but I couldn't solve it.
@pablomatgar check this https://github.com/pablomatgar/Japanese-Sign-Language-Interpreter/pull/13/files
Basically, what we need to is to listen to onDeviceReady function
document.addEventListener('deviceready', () => {
alert('deviceready');
// all the plugin and cordova function are ready once this function finished (device is ready)
// you can use this function in home.vue to start camera once the device is ready
}, false);
and only after that we can access all cordova functions and plugins without problems.
@pablomatgar @yong-asial I also tried to reproduce the problem.
the camera will load when going to the settings page and back to the home page.
In my environment, the camera was not loaded even after when going to the settings page and back to the home page.
I think there are more than one problem:
window.plugin.CanvasCamera
is loaded by using deviceready
event. (as Yong-san said)
the camera will load when going to the settings page and back to the home page
.Please try 1 first 👍
Thank you for your comments @yong-asial @asial-matagawa
I have solved the issue successfully.
Bug description
Sometimes, when the app is opened in iPhone (this bug is not occurring in Android), the camera is not displayed. If this happens, the camera will load when going to the settings page and back to the home page.
Bug screenshot:
Correct behaviour
After opening the app, the camera will be displayed in the screen automatically. It should not be necessary to go to another page and back in order to make the camera work.
Correct behaviour screenshot (also after going to settings and back, if the bug occurs):
How to reproduce
Using Monaca Custom Debugger, try to open the app in iPhone. Sometimes it will work properly, but sometimes it will not.