NativeScript / NativeScript/NativeScript

WebView iOS cookie issue

Open
#5,327 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

♥ community PR feature os: ios
Dominant language
TypeScript
Stars
25.7k
Forks
1.7k
Avg merge
1d 5h
Merged PRs (30d)
35

Description

Tell us about the problem

web-view for iOS is not automatically passing the cookies after the recent change of iOS UIWebView to WKWebView(https://github.com/NativeScript/NativeScript/pull/5093)

Previous Nativescript "web-view" was using UIWebView and native code cookies(using NSURLConnection/NSURISession) is shared and the application worked fine.

We are using this feature for authentication cookies to be shared between native and web-view.

Also, I don't see easy way to set the http cookie for the current NativeScript web-view ui control.

Take a look the following link for ways to set cookie for WKWebView

https://stackoverflow.com/questions/26573137/can-i-set-the-cookies-to-be-used-by-a-wkwebview

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:
  • CLI: (run tns --version to fetch it)
$ tns --version
3.5.0-2017-12-20-10289
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)
  "typings": "tns-core-modules.d.ts",
  "version": "3.4.0"
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the
    package.json file of your project)
   "tns-ios": {
      "version": "3.4.0-rc-2017-12-4-1"
    }

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR #5093 and the linked WKWebView cookie-setting approaches. Reproduce the iOS WebView authentication flow with the reported NativeScript versions, then verify that cookies are shared with native code and can be set for the current WebView control.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios
Domain
authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.