Answer the question
In order to leave comments, you need to log in
Can't connect cordova-cookie-master plugin to Apache Cordova in MS VS 2015, what should I do?
I think that many who made applications on Cordova know that this thing does not know how to work with cookies. You run it in a browser - everything is perfect, you run it on a device - if you please, go to npmjs.com for a plugin. I found the necessary plugin, but MS Visual Studio 2015 does not want to accept it. It says "Visual Studio could not parse the plugin.xml file. Make sure the plugin.xml file exists and is free of errors." Cordova-cookie-master plugin, found it on NPM.
Plugin is here . Here's another git .
I even tried to download the plugin itself from github and install it locally, but the result is the same. Good people, do you have any thoughts on this issue?
Answer the question
In order to leave comments, you need to log in
In general, I solved the problem myself, without extraneous plugins. To enable cookies:
1) Go to /platforms/android/src/ru/youdomain/yourapp/
2) Open MainActivity.java in any text editor
3) Fix this code:
package ru.youdomain.yourapp;
import android.os.Bundle;
import org.apache.cordova.*;
public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
package ru.youdomain.yourapp;
import android.os.Bundle;
import android.webkit.CookieManager;
import org.apache.cordova.*;
public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
CookieManager.setAcceptFileSchemeCookies(true);
super.onCreate(savedInstanceState);
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question