How to get WebRTC logs on Safari Browser - ios

I have been trying to get the webrtc logs for my web application running over safari browser, similar to what we get in firefox by going to the page about:webrtc and on chrome by using chrome://webrtc-internals.
Alternatively, Is there any js API for webrtc to get the logs on the console itself, similar to what we use in Native Android and iOS applications using the RTCLogger.
Thanks in Advance

On Safari Version 15.4 (17613.1.17.1.13), useful information can be retrieved this way:
In Preferences... -> Advanced, ensure Show Develop menu in menu bar is enabled.
In the Develop menu Settings, select the Console tab, then ensure WebRTC Logging is not Off (and so choose either Basic or Verbose).
At that point the Console will show WebRTC events and data structures.
e.g.:

Solution
If you open the Safari and also open the console application, you can filter WebRTC logs with these filters:
category:WebRTC
process:safari (optional)
just copy-paste them one by one to the search bar in the console application. Actually, the second one is optional (process:safari).
I'm not sure about the others but at least you can see:
SDP offers and answers
ICE candidates
WebRTC statistics
incoming and outgoing video frame counters
Fun Fact
Based on the official documentation of WebRTC you can't see logs on Safari :)
Useful Infos
Do you know there is a WebRTC menu in the Safari. Check the Develop > WebRTC sub-menu
Check the Safari Technology Preview app for more options and flags
If you’re not logged in as an administrator, you need to enter an administrator name and password to search for and view log messages.

Related

Can a progressive web app be registered as a share option on iOS?

I plan to develop an app (not sure if I will go with PWA yet) which includes the following "wishlist" scenario:
The user is browsing a website he likes using safari, chrome or any browser
He clicks the share button in that browser, in order to send the webpage url to another app
He selects my PWA
This url is saved in the user's wishlist
Is step 3 possible?
Note: someone asked the exact same question here about Android: Can a progressive web app be registered as a share option in Android?
My question is just the same, except mine is about iOS. I couldn't find any answers to it.
What you're describing is covered by Web Share Target Level 2.
Currently, it can be used with Chrome on some desktop platforms and on Android for installed PWAs.
It's not available on iOS, unfortunately.

How to remote desktop to an iOS device, a.k.a. how do Mobile Device Farms work?

I have been trying to understand how Mobile Device Farms like DeviceConnect, AWS Device Farm, SauceLabs, etc. get to remote control iOS devices, but I can't find anything on the subject. They get to do it without jailbreaking, which baffles me even more.
I love these kind of projects, because at the moment it seems undoable, but I know that it is possible ('they' are doing it).
With remote control I mean: seeing the screen of the iOS device on your computer screen and able to touch and swipe with your mouse.
Can someone please point me in the right direction as to how these technically work?
If you're using an iPad (in particular) or an iPhone (if you think you'll be able to make our any detail on the smaller screen) then using remote access to view and control what's on your friend's Mac is a good option. And the best way to remote-access a Mac from an iPad is to use Google's free Chrome Remote Access service, which lets you remotely use Mac programs from an iOS device.
It's quite an involved process to set it up the first time, but easy if you want to do it again in future. You'll need the Google Chrome web browser for Mac, and a Google account.
Here is link for Chrome Remote access
https://chrome.google.com/webstore/detail/chrome-remote-desktop/gbchcmhmhahfdphkhkmpfmihenigjmpp?hl=en
Open Chrome and go to Chrome Remote Desktop on the Chrome Webstore. Click Add to Chrome, then Add App. Click Allow, then Continue.
I will give you one approach and small explanation .
You will need to create application with all possible permissions at first also implementation handlers functions .
For example :
Works with files
Real native Socket connections (not http protocol) + need to have some main server signalling (domain or static ip).
Handle remote touch trigger (main problem for real remote/iOS)
Background part experience
Your app need to be non-Market app (more likely).
You can make Application with all possible options that apple give us.
What can you do remote with your app : -control camera/ Mic read geo data , work with galleries , delete or create files . Socket will be communication line .
Also app must initially started and make (on user request) always allow all permissions .
Use camera :
Send with socket some command example ( openCamera ) . AFTER receive this string perform action for opening camera .
If you can fix programability triggering touch events you can make remoteIOS.
More data links :
Q/A send remote events
Q about touch events
Q/A about Permisions
Sorry for the first quick answer,
All of these: DeviceConnect, AWS Device Farm, SauceLabs use Appium in order to control devices.
The component that execute the command is the WebDriver.
Appium have different WebDriver implementation in order to execute operations to different device.
The iOS WebDriver can be found here: https://github.com/appium/appium-ios-driver.
The protocol in use is the JsonWireProtocol.
more details can be found here:
http://appium.io/,
http://www.seleniumhq.org/
Regards

Google OAuth in an iOS Home Screen web app: fullscreen apps blocked?

We're observing the following behavior with the Google OAuth change:
Webapps accessed via Safari in iOS 9+ can do a Google OAuth flow, same as ever.
Webapps saved to the home screen can also do the usual flow
Webapps saved to the home screen that have the apple-mobile-web-app-capable meta attribute do NOT -- they are blocked via the "disallowed user agent" error.
It seems that apps saved to the home screen that have the fullscreen meta tag report their user agent as Web/1.0 CFNetwork/758.5.3 Darwin/15.6.0, which is different than MobileSafari (it is also different than the user agent in an embedded UIWebView).
This is a bit of a bind, since enabling the apple-mobile-web-app-capable mode is the only way to do a few other things, such as autoplay audio, which we use to teach the kids math!
Anyone have ideas on a path out of this double-bind? Alternatives we can think of include:
Find a way for Google to distinguish fullscreen homepage webapps from embedded WKWebViews. (UPDATE: based on the user agents above, they can be distinguished. But Google may still want to block them.)
Coax Google to allow this user agent. Unfortunately, I think there is a rationale for blocking OAuth on fullscreen webapps -- without a location bar, the user can't verify they've been sent to a legitimate Google login page.
Coax Apple to report fullscreen webapps as MobileSafari rather than this user agent. (??doubtful)
Build a native or Cordova version of the whole app, just to work around this one issue.
Any thoughts?

How did a Captive Portal force to open a browser

I've setup a Captive Portal with dd-wrt, wifidog, authpuppy and some plugins from authpuppy as well as my own web app.
I am wondering what's the exact thing that will trigger a
browser on the client device to popup?
Is the popup browser from iPhone/iPad a regular browser mode?
It seems some JavaScript will fail on the browser mode, like the shake.js,
event though iOS Safari version is > 4.2.1 from https://github.com/alexgibson/shake.js/
P.S.:
I've done the research like
http://en.wikipedia.org/wiki/Captive_portal
https://personaltelco.net/wiki/CaptivePortal
they don't talk much about the popup browser.
Could anyone help?
If you will try to see the network statistics [request/response] you will find out that devices like ios and android both of them continuously hits some particular urls [in case of android it is www.google.com/generate_204 , don't remember exact url for ios]. These url are generated by system internally. These pings let their server know about various details. So as soon as ios gets connected with a captive portal it tries to hit the system generated url, failing to which it understands that this is packet level protected network and open the browser.
Hope this helps.

Custom back button for Google Chrome

I've noticed in the latest iPhone Gmail app, that if I tap a link (and if I have the Google Chrome iPhone app installed) it opens up Google Chrome, and changes the back button in Chrome to show it going back to "Gmail"
I was wondering if anyone has managed to find a way to get this to work with their own apps, or if it's a private Google API?
I've tried Google's OpenInChromeController (https://developers.google.com/chrome/mobile/docs/ios-links) though that only seems to provide helper methods to open Chrome, and not change the back button
Google Chrome uses the x-callback-url scheme to create this type of behavior.
One example is something like this:
googlechrome-x-callback://x-callback-url/open/?x-source=MyApp&x-success=com.myapp.callback%3A%2F%2F&url=http%3A%2F%2Fwww.google.com
You can customize it to have a different response for a success or failure, and define whether Chrome will open the link in a new tab. There's more information available lower in the document that you linked to.

Resources