Does anyone know how to stop the mobile (Phone) page refresh when uploading an image from using the camera? We are currently using android and would like to tie an image to a record set (In a SQL database). When using the file upload component the page gets refreshed (back to a login state) and loses all the data.
This sounds less like you need forum help and more like you need Support assistance. There is no reason the File Upload component should be refreshing your page or logging you out of the session. Something else is at play here; whether it's a problem with the file, the size, the implementation, or the network, you're likely to need more in-depth help than most can provide here.
If you're not able or willing to go through Support, anyone here is still going to need to know more about the implementation than you've provided. Please provide your onFileReceived Event code, and a breakdown of the file names provided to the images you're uploading, as well insight into the file size of the images.
Thanks cmallonee, we do have support available.
These are the steps it's occurring in: Click upload button, option to use camera pops up. I click camera and instantly after I tap on screen to take the picture everything goes black for split second then the app is back at the startup screen. The camera works under typical use but no image is generated when using the component / ignition.
I'll update with more findings shortly and give support a shout if we can't resolve.
What is the upload button? It's not clear to me what components you're using here. If you're using a File Upload, we don't support taking pictures with the camera.
I just tested this via the Perspective app. When clicking "Browse" on the file upload component, on my android phone, it brings up the system dialog for choosing a file, which includes the option to use the Camera. After taking a picture, the File upload component says "Upload Successful!"
Using the browser on my phone results in the same system dialog for using the camera, or uploading a file.
@bfeas , if you haven't reached out to Support yet, could you provide the code you have in place for the onFileReceived Event? As @Matthew.gaitan has a working Android scenario and we've also got it working with iOS internally, we suspect it to either be your Android version or your Event code. Also, please try one more time to replicate and if you can replicate it please check your Gateway logs to see if there is any associated logging at that time. If you HAVE already reached out to Support, could you message me your ticket number so that i could examine it?
The component is in fact the 'File Upload' component and currently there is no code tied to the component at all. I simply dropped the component in for testing as I was building and after taking the pic the whole page refreshes. Could 'not' having event code be the issue?
If Matt is having success then maybe its a setting on my phone (Samsung s10).
I have not reached out to support yet and I'd like to do more testing first.
Matt, were you successful in uploading an actual image?
FYI: I added fileReceived event which adds image bytes to a SQL table but this only works on a PC and is not working on the phone. (Which probably falls under your comment "we don't support taking pictures with the camera")
Interesting. it looks to me like use of the camera is essentially putting Perspective into the background as the picture is being taken. If I recall correctly, the app will always consider that akin to having been closed and will reload the page. I suspect the others using this functionality are probably just not noticing the reload because of different authentication schemes where they're still authenticated and so the page just loads like they expect. That being said, this behavior actually makes sense now that I see it in action because you are leaving the Perspective app to use a different app (the camera).
I'm not familiar with this "Y-CODE" process you have in place. Could you clarify how it is implemented?
The Y-code is just member validation against our active directory (script running on a tag).
Another issue is that the pic taken by the camera doesn't exist anywhere and obviously not in the file upload because of the reset.
There's an excellent chance the re-authentication is interrupting the file upload of the image. Your Perspective Session is going through the following sequence:
- User click on File Upload.
- Open external app (Camera).
- De-authenticate, because the Perspective application was exited.
- Take picture with camera.
- Authenticate back into the Perspective application.
I suspect that since you are no longer authenticated during the taking of the picture that the File Upload is never even receiving the file. The device might not be storing the image because an "external" app (Perspective) is requesting the image, and some devices elect not to retain those images for security reasons. I think SnapChat might be a good example here, where you take a picture, but that image is never saved to the device.
What happens if you set the perspective app to never sleep?
Settings > Battery and Device Care > Battery > Background Usage Limits > Never Sleeping Apps
Add "Ignition Perspective"
Alternatively, I believe that the following setting accomplishes a similar result
Settings > Apps > Ignition Perspective > Battery > Unrestricted
I have a S21 and don't run into this issue, even with default settings.