phonagep ios app xhr reponse null - ios

I have developed a phonegap app with xmhttprequest to get some text from the web. It works fine in android, but it is not working in iOS.
Here are the problems:
In index.html, I include external resource of jquery mobile. It's not working.
xmlhttprequest response is null, but status=200. Neither success nor error function be called.
I have :
cordova 3.9.1
access origin=""
allow-navigation href=""
What should I do?

#Agnes,this is a mixed answer. On Cordove/Phonegap versions before 4.0.0, whitelist is NOT required, neither is the new requirement of CSP(Content Security Policy). However as of iOS9, Apple has a new ATS (App Transport Security) that is being enforced.
I don't have a good answer for you because the current Cordova whitelist documentation is mess. My raw notes show the confusion. I'm still sorting it out for blog post.
The best that I can do is turn you towards the clean FAQ
Top Mistakes by Developers new to Cordova/Phonegap
Read 10. Not adding the new "white-list", "white-list plugin" parameters in config.xml AND "Content Security Policy"
The Apple stuff is at the bottom of that section.
Please let me know what you figure out.
TIA

Related

How debug Universal links

I use the cordova plugin "ionic-plugin-deeplinks" (to my knowledge also works with a plain cordova app).
On Android, links when clicked let users choice between chrome and my application.
=> I suppose that app links works
=> As I'm able to access window.IonicDeeplink and redirect the user to the right page
I'm not able to have the same behavior on iOS, when I click a link I always get the app open in Safari.
How can I find clue on issues ?
More context:
apple-app-site-association is got with a HTTP 200 (over https only), it's located in /.well-known/apple-app-site-association:
I checked TeamID and BundleID 5 times (at least);
with the branch.io validator i get all validations green:
Your domain is valid (valid DNS).
Your file is served over HTTPS.
Your server does not return error status codes greater than 400.
Your file's 'content-type' header was found :)
Your JSON is validated.
with the apple validator, I got : "Action required
Could not extract required information for Universal Links. Learn how to implement the recommended Universal Links.
Error no apps with domain entitlements
The entitlement data used to verify deep link dual authentication is from the current released version of your app. This data may take 48 hours to update." (but some devs said that working app add the same error) what to do with that result?
when monitoring server's log while installing the app with Xcode I see a request get a HTTP 200 on apple-app-site-association
while installing the app with Xcode I got no logs referring to swcd in Xcode (I read here that I should if I had error while installing the app). Is a successful installation silent?
I followed that guide to setup entitlements, but some things feel odd with it:
Unlike the snapshot in the guide, I didn't found any *.entitlements file in my project. Should I have one with cordova? (my xCode seems to remember my setting though). Is it possible to check that installed app get entitlements?
I did set my domain in Xcode like this: applinks:mydomain.com and the switch is ON. But I never uploaded any thing from my local dev environment to apple services. Should I have? If yes, how ?
My current interrogations are highlighted but any explanations on any lack of understanding will be more than welcome!!!
Until then I started a verification for testFlight looking for more info.
while installing the app with Xcode I got no logs referring to swcd in xCode
I implemented Universal Links manually, but situation was similar. Particularly I mentioned empty swcd process log while installing the app, and it turned out that most likely iOS didn't even try to download apple-app-site-association file, like if responsible process wasn't run. In my case device restart helped and deep-linking began to work.
Thus I think restarting device is one another step in troubleshooting when you are sure about all your setup.
For anyone trying to debug this in development:
In XCode, ensure you're editing the Debug version of Signing & Capabilities.
To bypass the Apple Universal Links CDN, configure your Debug domains like applinks:?mode=developer -- adding that query string in development is important.
On your iOS Device, go to Settings->Developer->Universal Links and ensure the Associated Domains Development toggle is switched on.
On your iOS Device in Settings->Developer->Universal Links->Diagnostics, enter your Universal Links URL and ensure you get a green checkmark.
After following all of these steps, Universal Links work locally.

How do I find an apps/websites Deep Link?

I have a cordova app which uses the AppAvailability Plugin (https://www.npmjs.com/package/cordova-plugin-appavailability) and I have to find out if a specific app is installed. Its easy on Android, since I just know the packagename, but on IOS I have to know the URI Scheme or the DeepLink (eg. myapp://).
But I just seems to not be able to find out how to get it. Example is the asos.com.au website and their app. The Package name is 'com.asos.app', so that part is solved.
But if you go on the website (or in my usecase, if you are forwarding to their website) it opens the app if is available. And if it is available I want to have my app know that it wont redirect to the website (this is actually pretty important).
So, on IOS I have to know this URI Scheme.
Any Ideas?
This sounds like asos.com has implemented deep linking, and indeed http://www.asos.com/apple-app-site-association is present and looks good. Find more documentation here: https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html

React Native - iOS is not recognizing Branch Links

We are trying to analyze where the users come from with branch's getLatestReferringParams in React Native, however in iOS the params for ['+clicked_branch_link'] is always undefined when the actual sessions comes from a branch link, this problem is only happening with iOS (it's working with Android), and we have also tested trying to open this link via Chrome in the iPhone and it worked. I'm not completely sure if it's related to something going on with Safari or with the OS versions. Any guideline would be very welcome. Thanks Here is a small snippet of the code we are trying to implement
const lastParams = await branch.getLatestReferringParams()
const comesFromBranchLink = lastParams['+clicked_branch_link'] # Giving us undefined when it comes from a branch link
const isAReferralLink = lastParams['~feature'] === 'referral'
Edit: We tested again and basically it doesn't recognize the branch link, only if it comes from Google Chrome.
Alex from Branch.io here: this sounds like a possible configuration issue with Universal Links.
I see you have also submitted a ticket to our Integrations team, which is the quickest way to get a solution. I will make sure we follow up here with an update when the issue has been resolved!

Google Maps iOS street view URL scheme not working?

My app has some code for opening directly to Google Maps. We're attempting to open directly to Street View for a particular coordinate using a URL like so:
comgooglemaps-x-callback://?center=47.613371,-122.313167&mapmode=streetview&x-success=myurlscheme://noop&x-source=MyApp
I'm seeing an infinite spinner with the Street View never loading.
This URL scheme is documented and has worked for several years, until a recent update.
https://developers.google.com/maps/documentation/ios-sdk/urlscheme
Is this feature of the app busted or did the URL scheme change?
This has been fixed in the latest release of google maps iOS app. Please check it.
Reference : https://github.com/googlemaps/OpenInGoogleMaps-iOS/issues/6
This is a bug ( or documentation needs updating) as I was able to verify this working with the previous Google Maps iOS build of 4.14(the last update). Also verified with other iOS apps that use StreetView.
submitted issue but this has not been acknowledged as a bug yet.
https://code.google.com/p/gmaps-api-issues/issues/list?can=2&q=streetview&colspec=ID+Type+Status+Introduced+Fixed+Summary+Internal+Stars&cells=tiles
It looks like it's been accepted as a bug according to Google. I've heard that it will be fixed with next update, but that is not official.
http://code.google.com/p/gmaps-api-issues/issues/detail?id=9095&q=apitype%3AIosSDK%20type%3ADefect&sort=-stars&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Internal%20Stars
Google has a new app, I believe we are supposed to use this instead but I've not tried it yet!! I still have not seen updated documentation on website that confirms this.
https://itunes.apple.com/us/app/google-street-view/id904418768?mt=8
https://github.com/googlemaps/OpenInGoogleMaps-iOS/issues/6

Does Phonegap mobile app require having "Access-Control-Allow-Origin:*" on server?

I'm developing an ios app with phonegap and Jquery. I'm facing an issue where sending ajax request failed due to the xmlhttprequest-cannot-load No 'Access-Control-Allow-Origin' header is present on the requested resource error. I have white-listed all domain with < access origin="*" / > in config.xml.
However adding Access-Control-Allow-Origin:* on server could resolve the issue. But I don't want to use this approach because this exposes another security issue. Does Phonegap app requires this? I'm confused because someone says yes and someones says no, and official documentation doesn't mention this either.
I just got the answer. phoneGap does not need this. What I'm experiencing is a known bug in the latest phoneGap (https://github.com/phonegap/phonegap-app-developer/issues/169) which should be resolved soon.
Not on the server no.
You can whitelist the origin though: http://docs.phonegap.com/en/3.0.0/guide_appdev_whitelist_index.md.html

Resources