Jump to content


Photo

iOS 11 camera access from "home screen" application

ios 11 home screen app camera

  • Please log in to reply
2 replies to this topic

#1 Nigel602

Nigel602

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 55 posts

Posted 13 January 2018 - 02:50 PM

Hi Guys,

I have just come across a fairly large issue for myself, and probably others.

I have just upgraded my ipad air to iOS 11, and now the camera does not work - when launching "a web app" from your home screen, the camera appears but it just shows as a black screen.

It works as expected if you access your application via a Safari tab (web broswer), just not when you open it via a bookmarked application added to your home screen.

This is a large issue, as customers like and use the application as an app - it opens into its own full screen window.

Here is some background reading from stack overflow - https://stackoverflo...-screen-web-app

It seems their isn't much anyone can do - so I guess I am asking in vain - Anyone have any ideas?

The only thing I can think of is using firemonkey ios application and having a TBrowser to host the web URL, unfortunately I do not have the mobile add on for delphi professional.
I would be really thankful if someone could test this for me, I just need to know if the camera is still accessible (eg not just a blank screen)

(Then I can consider buying the mobile add-on for delphi)


Thanks for any help.

*Edit1* - does anyone know if it's possible to manually remove meta tags, one solution to this problem as per stack overflow is

removing 

<meta name="apple-mobile-web-app-capable" content="yes"> 

so your 'app' runs in a normal Safari tab, where getuserMedia is accessible.

This is really quite a serious issue for me and my customer base.

 

*Edit 2*

 

I am using FileUpload.Execute; to access the camera

I am currently using uni gui version 1.0.0.1420

 


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3906 posts

Posted 13 January 2018 - 07:47 PM

Hi,

 

Maybe this solution can help you:

function window.beforeInit(sender, config)
{
    Ext.onReady(function() {
        var removeElementByName = function(elName) {
            var appleEls = document.getElementsByName(elName);
            var l = appleEls.length;
            for (i = 0; i < l; i++) {
                var el = appleEls[0];
                Ext.removeNode(el);
            }
        };
        removeElementByName('apple-mobile-web-app-capable');
    });
}

  • 0

#3 Nigel602

Nigel602

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 55 posts

Posted 13 January 2018 - 08:44 PM

Hi Delphi Developer,

 

Thanks for giving me the code for the work around - this now allows me to still  "save to home screen" as before and launch the app into safari.- exactly, as per the stackoverflow answer.

 

If anyone comes across this I added the code above on my login screen uni events > window before init.

 

It works exactly as expected.

 

Lets hope apple fix this issue ASAP!

 

Thanks once again!


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users