Session Cookie Lost when using ionic native advanced http - struts2

I'm using cordova-plugin-advanced-http to solve CORS issue in iOS but there's one issue i'm facing and I'm really out of idea on solving this.
On my backend server, once user logged in, there will be one session cookie used to store user info. User is expected to see his/her logged in account in the in-app-browser once the user is logged into the mobile application. However, when I logged into the mobile application and click to open the in-app-browser, the cookie was null.
This issue only happened when using this plugin. When I tried using angular http in android, there is no such issue.
I tried setting cookie but the issue still persists. Can you please give me some directions on how I should tackle this issue?

I ended up solving this issue by using this. Not sure if it's just workaround or a proper solution.
Update
Workaround only – Not a perfect solution
I changed the web view option of my ionic app.
WKWebView ===> UIWebView
First, open config.xml and add the following properties
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
then run the following commands – I hope you are familiar with this commands
ionic cordova plugin remove cordova cordova-plugin-ionic-webview --save
rm -rf platforms/
rm -rf plugins/
ionic cordova build ios

Related

Ionic Cordova IOS Livereload Failed to load webpage with error: Could not connect to the server

So, I get the error "Failed to load webpage with error: Could not connect to the server" when I try to livereload my app on iOS. I have tried everything I can find on the topic. I've spent all day trying things. So I realized that maybe there is something needed that I don't understand. Here are the things I tried: "ionic cordova prepare iOS", "ionic cordova build iOS", "ionic cordova run ios --address=0.0.0.0 --debug --consolelogs -l", "
<allow-navigation href="http://localhost:8080/*" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
", "cordova plugin rm cordova-plugin-ionic-webview
cordova plugin add cordova-plugin-ionic-webview".
I thought maybe someone might have a different idea, or questions that will lead to the solution.
The app opens, and I get that message as an alert on my splash screen, but then it never moves past the splash screen.
Something I just thought of, if I use "ionic cordova run ios --address=0.0.0.0 --debug --consolelogs -l", do I need to use the ip address of my computer?
Any other suggestions or questions?
The docs will help you here.
Firstly, you will need to run the server.
Do this by running
ionic serve
This should give you something like this at the end:
App running at:
- Local: http://localhost:8100/
- Network: http://192.168.x.xxx:8100/
If you are wanting to run this on an actual iOS device on your network, then you will need to use your servers ip address. eg. 192.168.x.xxx.
Then you should be able to run the cordova livereload like this:
ionic cordova run ios --livereload-url=http://192.168.x.xxx:8100
Hopefully that works for you.

IBM mobile-first direct update not applying after successful download in IOS

I have implemented mobile-first non-secure direct update feature by following this document in IONIC project.
https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/direct-update/
When I push an update using MFP server, It gives a popup in application to download it. It's working fine in Android.
In IOS, After finishing of update, changes are not getting reflected in application. On next adapter call it again shows me update popup and it's going in loop.
Error after finish of update :-
Failed to load webpage with error: The URL can’t be shown
If I kill the application and open again, it's started working with pushed changes.
Mobilefirst plugin works fine with cordova project but with ionic project it gives above error. And plugin cordova-plugin-ionic-webview cause this issue.
MobileFirst server version :- 8.0.0.00-20180220-083852
MobileFirst Cordova(plugin) version :- 8.0.0.00-20180227-121751
iPhone IOS version :-10.3.2
Ionic version :- 3.8.0
Cordova version :- 6.5.0
Permissions in config :-
<access origin="*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
Ionic packs "WKWebview" which on iOS causes direct update not to work. This is a known limitation.
The resolution is to run the following command:
cordova plugin add https://github.com/apache/cordova-plugins.git#master:wkwebview-engine-localhost
More details here.
Update your ionic project with latest Cordova MFP Plugin by running following command.
ionic cordova plugin add cordova-plugin-mfp#latest.
This should resolve the issue which you are facing.

Cordova ios platform version too high

I am having problems running the cordova project in the ios emulator. The console.log file does not exist. On Android it is working though. I think it is because of the version of my cordova ios platform, cause when I do:
cordova plugin add cordova-plugin-console
it says:
Plugin doesn't support this project's cordova-ios version. cordova-ios: 4.5.2, failed version requirement: <4.5.0
So my version is too high and does not meet the requirement. What should I do? Should I downgrade it, if yes how can I do that?
Since cordova-ios 4.5.0 cordova-plugin-console is included in the cordova-ios base, you do not need this plugin anymore. You can read about it here.
Check if there is this feature element in the config.xml:
<feature name="Console">
<param name="ios-package" value="CDVLogger"/>
<param name="onload" value="true"/>
</feature>
If not you have to add it as a child of the ios platform tag to use console.log() and other console functions. You can comment it out for production builds.

Ionic CLI error - Error: Cannot read property 'indexOf' of null on terminal

im new to ionic and angular js. I was building my app succesfully using the ionic cli, now I am having an issue while building for ios which was working fine since yesterday. I have updated ionic, create new project but still cannot run this command "ionic build ios", however "ionic serve" works successfully. Please note that I am using a mac and these command were working fine before. Grateful if someone can help me. Thanks.
For people who are having this issue, it looks like it's a bug in Node 5.7.0, to be fixed in 5.7.1:
https://github.com/driftyco/ionic-cli/issues/815
https://issues.apache.org/jira/browse/CB-10675
https://github.com/nodejs/node/issues/5393
Downgrading your Node version or updating when 5.7.1 comes out should resolve the issue.
Ok, just ran into the same issue, while building on iOS (Android worked fine). It seems that it has got to do with config.xml .
I had to put <access origin="mailto: ... launch-external="true"/> under <platform name="android"> and the issue was solved.
Hope that helps.
To solve this problem just move all <access origin="file:..." or <allow-navigation href="file:.." /> under <platform name="android"> in your config.xml

How do I update my IOS App with PhoneGap 2.7 to 3.4 when I use an old plugin

How do I update my IOS App with PhoneGap 2.7 to 3.4 when I use an old plugin.
My problem is that I use a PhoneGap plugin "ios-Tabbar plugin" which unfortunately has not been updated for PhoneGap 3 *.
Is it possible to update PhoneGap manual in Xcode, by replacing the packages and classes that belong to PhoneGap, just as you could in the old PhoneGap versions prior to 3.0.
Jacob
Main changes
config.xml structure changed
in 2.7
<plugin name="Echo" value="Echo" onload="true" />
in 3.4
<feature name="Echo">
<param name="ios-package" value="Echo" />
</feature>
and you can use older native code because no changes in the native side check plugin dev docs 3.4 and 2.7 i think this may help you.

Resources