Enable Cookies in Crosswalk Cordova for Android App

we are trying to enable cookie storage in our Crosswalk Cordova Android app. Are we having trouble finding a place to do this? Any directions are appreciated.

+3


source to share


2 answers


In the java template you are using (usually AppTemplateActivity.java in the pedestrian folder) you need to change it to import the CookieManager and enable cookies (and / or filesystem files, probably probably)



package org.xwalk.app.template;

import org.xwalk.core.XWalkView;
import org.xwalk.core.internal.XWalkCookieManager;
import org.xwalk.core.internal.XWalkClient;

public class AppTemplateActivity extends XWalkRuntimeActivityBase {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void didTryLoadRuntimeView(View runtimeView) {
        if (runtimeView != null) {
            XWalkCookieManager mCookieManager = new XWalkCookieManager();
            mCookieManager.setAcceptCookie(true);
            mCookieManager.setAcceptFileSchemeCookies(true);

            setContentView(runtimeView);
            ....
        } else {
          .....
        }
    }

      

+3


source


XWalkCookieManager is not supported when embedding api ... https://crosswalk-project.org/jira/browse/XWALK-3185 but I think we can set cookies using javascript but I haven't tried it yet ...



0


source







All Articles