Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error #8

Open
devjva opened this issue Oct 7, 2019 · 7 comments
Open

Error #8

devjva opened this issue Oct 7, 2019 · 7 comments

Comments

@devjva
Copy link

devjva commented Oct 7, 2019

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndexedSubscript:]: index 2 beyond bounds [0 .. 1]'
*** First throw call stack:
(0x199af6190 0x198ccb9f8 0x199a6fbfc 0x1999f4bfc 0x10024fb7c 0x1002928f8 0x10024cd98 0x10024e314 0x1a91320cc 0x1a9295744 0x1a94010b8 0x1a9022e38 0x1a91e28a8 0x1a90139a8 0x1a9016498 0x1a0cc8648 0x1a0cc8908 0x199a87f2c 0x199a87eac 0x199a87794 0x199a826d0 0x199a81fc4 0x19bc8379c 0x1c640ac38 0x10023a14c 0x1995428e0)
libc++abi.dylib: terminating with uncaught exception of type NSException

in

NSString *domain = command.arguments[2];

@jsnfwlr
Copy link

jsnfwlr commented Nov 6, 2019

I'm getting the same issue.

I worked around it by defining the other params/arguments the function really needs:

cordova.exec(null, null, 'WKWebViewSyncCookies', 'sync', 'GET', 'https://site.com/index.php', 'site.com', '/index.php');

Then I ran in to another error ...

2019-11-06 08:18:01.553229+0800 Grain Market[11784:316114] -[NSTaggedPointerString count]: unrecognized selector sent to instance 0xa000000005445473 2019-11-06 08:18:01.558914+0800 Grain Market[11784:316114] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString count]: unrecognized selector sent to instance 0xa000000005445473'

@guirip
Copy link

guirip commented Dec 5, 2019

Have you tried this plugin? It seems that it fulfills the same goal.

https://github.com/CWBudde/cordova-plugin-wkwebview-inject-cookie

I added it to a project today and it works like a charm, no more cookie issue on cordova iOS. 👍

@monkeychops
Copy link

@guirip OMG - This plugin has just absolutely made my day. Thank you

@guirip
Copy link

guirip commented May 20, 2020

@monkeychops Glad I could be helpful :)
🍻

@batmanbury
Copy link

@guirip How did you import or require cordova-plugin-wkwebview-inject-cookie to get it working? Are you on iOS 11?

@guirip
Copy link

guirip commented Jul 16, 2020

@batmanbury You just have to add the plugin cordova-plugin-wkwebview-inject-cookie

cordova plugin rm cordova-plugin-wkwebview-sync-cookies
cordova plugin add cordova-plugin-wkwebview-inject-cookie

important
After the 'deviceready' event don't forget to call the plugin js function to declare the needed domains and paths ➡️ See Usage

@kelkmere
Copy link

kelkmere commented Aug 26, 2020

I couldn't get cordova-plugin-wkwebview-inject-cookie to work because the cookie doesn't seem to set when the app is first launched.

I managed to get this plugin work by editing WKWebViewSyncCookies.m directly:

NSString *domain = @"example.com";
NSString *path = @"/";

NSString *urlHttpMethod = @"https";
NSString *urlString = @"example.com";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants