View set cookies of an iOS app? - ios

I am trying to debug an iOS app without having the actual code.
It is using a ui web view, calling a website that sets cookies. I need to check which cookies are set. The problem does not appear in safari, only in the app, so I need to check the cookies of the app.
How can I do that? Is there a developer tool that can help me read the cookies similar to the safari web inspector?
Or do the developers have to use a certain framework to make the cookies readable?
Can I use xcode to debug an app - similar web inspector for safari - without having the code?
Thanks in advance for any hints.

This is kind of an old question but nevertheless relevant. So for the sake of posterity here's is how to connect an iOS mobile device to an OSX device to view web inspector.
https://appletoolbox.com/use-web-inspector-debug-mobile-safari/

Related

How to enable Cross-Site tracking on WKWebView

I have an iOS webview app which require access to third party cookies accessed from inside an iFrame, even if I clear the Prevent Cross Site Tracking on IPhone Safari Settings, it does not work!
But when I access the webview link directly using Safari (Desktop) and clear the Prevent Cross-Site Tracking, it works fine!
I have been trying for over a week now, and no luck
I have added NSCrossWebsiteTrackingUsageDescription to the info.plist on the iOS app and I can see the new settings for the app, but even if I allow cross-site tracking, still does not work!
I have also added WKAppBoundDomains to the info.plist as an array with different combination as below:
thirdparty.com
*.thirdparty.com
a.thirdparty.com
a.b.thirdparty.com
with no luck either!
I have been searching SO, Apple Forum and webkit for many days, seems some people have it working but i have no clue how did they get it to work as there were no clear solutions?
I am not sure why Safari (Desktop) behaves in a different manner to Safari (Mobile)!
I have tried on simulator and an iphone device, cleared all data and website cookies, still not working.
If you have successfully implemented WkAppBoundDomains or NSCrossWebsiteTrackingUsageDescription, please share your solution as I am out of ideas.
Your time is greatly appreciated
Xcode: 12, iOS: 14

Open an URL in a web browser that isn't safari, with Objective-C

I'm making a simple tweak for jailbroken iOS devices running iOS 13, which adds a "Paste and Go" option when you force touch web browsers.
I've managed to make it work with Safari, but the problem comes when I try to use it with other Web browsers. I manage to show the option, but I can't make the web browser to open the link.
I'm posting this here as this is more of a normal programming question than a jailbreaking question because I'm sure there's a way to do this in stock iOS.
Thanks in advance, and sorry if this is a dumb question.

How to open Safari from ios app with specified cookies

I want to open Safari from my iOS application with specified cookies. But i found that NSHTTPCookieStorage is not shared between apps in iOS. So i don't know how to do that. Please help.
I suggest to go with SFSafariViewController which will launch the web page inside your app and whatever the cookies you have those will be retained by SFSafariViewController without extra work.

How to allow app to use Mobile Data in xcode

I'm a beginner in iOS. I'm making an app that works both offline and online. On the default Settings app on iOS, my app has only access to Notifications and background App Refresh. How do I add the option to allow users to use mobile data?
Thanks!
It's enabled by default - you don't have to do anything. The option will appear in the Settings page the first time you use mobile data with your app.
When starting a basic project on Xcode your application by default is routed to work with cellular data. There is no need for any kind of external settings manipulation. If you really feel like configuring the overalls and the connection structures feel free to explore the " Networks " tab to better optimise your app.
And good luck with your new project !
I just build an app in Xcode 14 and mobile data was off by default!

Why is Web Inspector showing me "no inspectable applications"?

Background
My company recently made a shift to app development. While developing and Q/Aing on Android was relatively painless, iOS, on the other hand is proving to be a pain.
The task involves looking at the page source of our app (which has a custom browser). I heard that Web Inspector is a great tool, so I went with it.
Problem
First of all, Web Inspector has been able to detect the custom browser before.
But quite frequently, Web Inspector's menu gives the "No Inspectable Applications" prompt.
This happens with the exact same version of the app that worked earlier.
There seems to be no trigger whatsoever; yesterday Web Inspector was working with the custom browser, and then after a few hours (during which I may have disconnected and reconnected the iPhone) it stopped working.
I have not been able to figure out why despite breaking my head for a week.
Observations
I have an iPhone 4S running iOS 7.0.4. My Mac Mini has Safari 7.0.
In the phone options
Web Inspector is turned on in the iPhone menu
All privacy modes are set to off - Do Not Track, Block Cookies, etc. (this question)
Javascript is turned on in the phone.
In Safari on my Mac Mini
- Develop menu is enabled (obviously)
More observations
iOS Safari is detected by Web Inspector.
So, how do I go about debugging this? What could be a possible cause and what could be the solution?
I was having the same problem, it was cause I was running iOS 8,fixed by updating Safari to 7.1 .
An update for iOS 9 (using OSX El Capitan):
On your mobile device under Settings -> Safari -> Fraudulent Website Warning = OFF [default = ON]
For me to make it work I needed to go into iPhone's Settings -> Safari > Advanced and enable Web Inspector option. (iOS 9.1)
I was having exactly same trouble. I managed to correct the situation by clearing the cookies and history from the mobile Safari menu. After this, it showed up in the Mac Develop menu.
Hopefully this will correct your situation as well.
this is probably an oversight where someone forgot to include the ios 8 version of Mobile Safari as an inspectable application. Get with it guys. I was able to connect my iPad to a MacMini we have with Yosemite Beta.
So I have also discovered that the web inspector in Yosemite Beta doesn't inspect well. I am able to Breakpoint in Javascript, but items are not inspectable in the inspection pane. The console does report correct information. Don't be fooled as I was! To inspect the value of something in this web inspector you must access the values via the console, type in the variable and it will return the result it has correctly.
As it happens, the solution that worked for me (reliably) was:
Build the app from source locally (in Xcode)
Deploy it to the iPhone, connected through USB
For some reason, Web Inspector works reliably when the app is started this way. I am unable to figure out why, but it works. Comments welcome.
Here's a possibility, mostly because I just ran into this myself...
Is your browser set for private browsing?
If it is, turn that off! You can't use the inspector while it's on.

Resources