Im facing this issue for 3 days already. Help needed.
Im creating a hybrid app with push notification features for both Android and iOS using Worklight V6.2. Different issue found on these 2 environment.
Below is steps to create and deploy apps to remote server.
- Create hybrid app
- Include WL.Client.Connect in /common/js/main.js. Include also function for onSuccess and onFailure.
- Created new environment - tick box Android, iPhone, iPad
- Run As -> Build all environment (Successful)
- Change the Build Setting and Deploy Target. Tick on Build the application to work with a different worklight server. Enter the IP (https://:) and contextroot(/MyPushProject).
- Run As -> Run on worklight development server.
- Open remote server Worklight console
- Deploy XXXXX-all.wlapp file (Successful)
- Export android apps to apk file. Install in android apps.
- Run as Xcode Project -> Run in authorized ipad and iphone.
Below is the output for both platform. I didnt test it using Android emulator due to slowness and capabilites of my laptop.
Android: Build and deploy to remote server successful. Viewed using web browser.
Preview using android. WL.Client.Connect received this error - https://XX.XX.XXX.XXX:XXXX/MyPushProject/apps/services/api/MyPushApps/android/init. Failed to load resource: the server responded with a status of 401 (Unauthorized)
iOS (iPad & iPhone): Build and deploy to remote server successful. Viewed using web browser.
Preview using iphone and ipad. WL.Client.Connect received successful to connect to Worklight Server. Build apps using Xcode 7.1 run into iPad and iPhone (iOS 9.0) and received error "Failed to connect to Worklight Server".
From the xcode log:
[ERROR] [NONE] [https://xxxx.xxxxxxxxx.xxx.xx:444/MyPushProject/apps/services/api/MyPushApps/iphone/init] Host is not responsive.
Can someone give me some idea how to solve this issue? Thanks alot.