How to enable cookies for Android phonegap 1.8.0 app?

后端 未结 3 797
臣服心动
臣服心动 2020-12-15 14:43

I understood that in order to use cookies inside of phonegap native app there must be piece of code which enables it.

When building phonegap for iOS using xcode 4 th

3条回答
  •  再見小時候
    2020-12-15 15:34

    you actually wanna do

    import android.webkit.CookieManager;
    import org.apache.cordova.*;
    
    public class MainActivity extends DroidGap {
    
      @Override
      public void onCreate(Bundle savedInstanceState) {
          try{
              CookieManager.setAcceptFileSchemeCookies(true);
          }catch(Throwable e){}
    

    Since the CookieManager does not exist on older Android versions

提交回复
热议问题