Heap should work with Cordova on iOS. For iOS, you would need to use a cookie manager. You can create your own, or you can use our Electron library.
Cordova apps use UI Web Views, which do not inherently support cookies at this time. For questions, reach out to support@heap.io.
Heap will also work with Android with some slight modifications. For Android, add this line within /android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java
:
CookieManager.setAcceptFileSchemeCookies(true);
To work, setAcceptFileSchemeCookies(true)
has to be run before CookieManager is instantiated. For example:
public SystemCookieManager(WebView webview) {
webView = webview;
CookieManager.setAcceptFileSchemeCookies(true);
cookieManager = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
cookieManager.setAcceptThirdPartyCookies(webView, true);
}
}
If you use Crosswalk, Cordova and Ionic will work on Android if you add this line within platforms/android/src/org/crosswalk/engine/XWalkCordovaCookieManager.java
:
public XWalkCordovaCookieManager() {
cookieManager = new XWalkCookieManager(); ///forces file cookies
cookieManager.setAcceptFileSchemeCookies(true);
}
If you have any questions about your specific use case, please reach out to support@heap.io for help!