IBM mobileFirst IOS application screen blackout after direct update - ibm-mobilefirst

Details of Project :
Application Framework - Ionic V3.0
IBM MobileFirst server(devKit) - Product version: 8.0.0.00-20170911-123510
Application Mobilefirst version -
config.xml -
mfp:platformVersion -8.0.0.00-20170218-003050
plugin name="cordova-plugin-mfp" spec="8.0.2017021815"
It's working fine in android. But in IOS, after finishing of soft update, application screen goes blank (black screen). After killing and restart of application, it's started working fine.
I have implement Direct update feature in mobilefirst 8 application as below :
// Direct Update - Used to trigger a request to the MobileFirst Server, to check for updated web resources.
WLAuthorizationManager.obtainAccessToken()
.then(
function () {
console.log("*** Obtained token successfully.");
},
function () {
console.log("*** Failed obtaining token.");
}
);
Reference : https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/direct-update/#secure-direct-update

This is perhaps has to do with the fact that Ionic now uses the WKWebView by default. See https://ionicframework.com/docs/wkwebview/
And it is a known limitation with MobileFirst Direct update on the WKWebview. See https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/product-overview/release-notes/known-issues-limitations/#wkwebview-support-for-ios-cordova-applications
As mentioned in the above link, use the wkwebview-engine-localhost plugin to ensure Direct update continues to work.

It's fixed in latest IBM MobileFirst version.

Related

MobileFirst 7.1 Direct update issue

(1). MobileFirst APP will crash or unstable (sometimes) when the following conditions occur :
We used WL.Client.connect API to trigger direct update at the same time when iOS native code is running (some native process we wrote) .
(2). We found that different version of timestamp will not trigger direct update. for example:
Our MobileFirst console version is 7.1.0.00-20151107-1647.We deployed wlapp(builded by 7.1.0.00-20151107-1647 Studio) to that console.
If the mobile client APP version is 7.1.0.00-20151114-1616 then the direct update won't trigger
Should we make sure that MobileFirst server and client version must be the same?
If so, How to deal with old MobileFirst version APP in Apple store or Google Play to connect new version of MobileFirst server and make sure the direct update , notify and remote disable still work.
If the Studio build that you're using contains fixes/changes to the underlying native component of MobileFirst, then Direct Update may not work. You can see this when building in Studio - you get a warning stating this.
In such cases you will need to up the environment version value in application-descriptor.xml and upload a new .ipa/.apk to the App Store/Google Play.

Why Doesn't Direct Update happen on IBM MobileFirst Platform?

I have developed a hybrid sample app on MobileFirst Platform 7.0. When I make any change in the .html file, direct update won't appear on the client mobile application (Android and iOS). Am I missing something? I have already deployed the .wlapp file on the server.
Direct Update will only work if the application connects to the server. Make sure that you are using the API method WL.Client.connect(), otherwise even if deploying an updated .wlapp to the server, the update will not be received in the application.
You say you haven't updated the .wlapp; you should. The Direct Update process works by fetching updated web content (HTML/CSS/JS/etc.) from inside the .wlapp. As Idan says, you also need to make sure your client is connecting to the server.
In order to begin communicating with MobileFirst Server you need to call WL.Client.connect() API method once the application start.
For Example in a main.js file :
WL.Client.connect({
onSuccess: function(){
console.log("App is connected to the server...");
// Call some methods ...
},
onFailure: function(){
alert("unable to connect to the server...");
}
});
Make sure that you have built the .wlapp file with the correct configuration(Deployment target) and that's deployed successfully in the server.

Unable to change the Server URL in android in IBM mobile first platform

I am migrating worklight hybrid projects from 6.0.2 to 6.3. When i do this and install the application on to android device, I am unable to edit worklight settings and change the URL.However the same feature is working on IOS devices.
But when I create new project on 6.3 , the above feature works fine in android as well.
In application-descriptor.xml worklight settings is enabled though.
.
However when I try to change the URL in android device by editing the settings, below exception is thrown.
02-16 18:48:27.173: E/EnterpriseContainerManager(552): ContainerPolicy Service is not yet ready!!!
02-16 18:48:27.173: E/ViewRootImpl(27590): sendUserActionEvent() mView == null
02-16 18:48:50.155: E/Watchdog(552): !#Sync 706
Settings pop up is not showing up , to change the URL. Please suggest.
Worklight Settings is unreliable on Android devices using API Level 10 and above. The settings screen may appear but not work, or the Options Menu that invokes it may not appear at all, etc.
However, starting MobileFirst Platform 6.3 there is dedicated API for setting & getting the Server URL, enabling you to change it during runtime: WL.App.getServerUrl and WL.App.setServerUrl.
There is a blog post on this new ability that explains how to use the API methods as well as provides a sample application. You can follow it and integrate it in your application instead of using the Worklight Settings screen in Android.
Blog post: https://developer.ibm.com/mobilefirstplatform/2015/02/02/changing-server-url-runtime/

Direct update on iPad to Worklight Studio development server on Windows not working

I want to develop on my Windows machine and push my changes to an iPad (iOS 7.1.2) test device via direct update. This worked for me in WL 6.1, but since my update to WL 6.2 I'm having some issues. Following scenario describes my problem.
Create new WL project and add iPad as environment
Enabled worklightSettings in application-descriptor.xml
Add the code snippet below to main.js
Run on Worklight Development Server
Open project in Xcode via eclipse
Clean project in Xcode and run on iPad
Make a change, re-deploy and verify Direct Update is received
Copy the project to a Windows machine and open in eclipse
Run on Worklight Development Server on Windows machine
Open the app settings via Settings.app and enable use Custom Server URL
Replace the IP of your mac by the IP of your windows machine
On windows: Make a change and re-deploy
Restart the app on the iPad
The moment I restart my app I get the following exception in my In the worklight development server console on my Windows machine:
[WARNING ] SRVE0190E: File not found: //apps/services/api/HelloDirectUpdate/ipad/init
[ERROR ] FWLSE0048E: Unhandled exception caught: SRVE0190E: File not found: //apps/services/api/HelloDirectUpdate/ipad/init
When I modify the custom server URL and I remove the last slash, I get the message that an update is available. But when I click update the progress bar in the downloading popup doesn't move. My Windows machine and MAC both have the following WL Studio version: platformVersion="6.2.0.00.20140724-2139". What am I doing wrong?
main.js
function wlCommonInit(){
WL.Client.connect({
onSuccess: onConnectSuccess,
onFailure: onConnectFailure
});
}
function onConnectSuccess() {
WL.Logger.debug("Connect success.");
}
function onConnectFailure() {
WL.Logger.debug("Connect failed.");
}
This is indeed a defect in Worklight 6.2.
On the one hand, as you mention in your reproduction steps you need to remove the forweawrd slash from the custom server URL in order to be able to connect to the Worklight Server (because otherwise there are 2 slashes in the URL and it fails connecting).
On the other hand, the client requires this forward slash.
You can see this in Wireshark:
Bad: GET /test3directUpdate/test3/iphone/1.0?skin=default HTTP/1.1
Good: GET /test3/directUpdate/test3/iphone/1.0?skin=default HTTP/1.1
I've opened a defect for this; you will need to create a PMR in order to receive a fix, once available (or wait until it is publicly available via IBM Fix Central / Eclipse Marketplace).

Worklight 6.1.0.1 Fix Pack Contents Definitive List

When looking at the contents of Version 6.1.0 Fix Pack 1, it doesn't appear to list PI06519 as one of it's constituents, yet when applying the fix pack in a bid to address the slow start up issue, it appears to fix the problem.
Is this supposed to be the definitive list of the contents of the fix pack and is simply an oversight, or should I be looking somewhere else for the full contents of it?
There is some problem with listing this APAR in the list of fixes which has yet to be resolved.
Here is a copy of the fixed APARs in Worklight 6.1.0.1:
Changes since: 6.1.0.0
Fixes (APARs):
PI12596 A HYBRID APPLICATION MAY FORCE CLOSE OR FAIL TO CAPTURE DATA WHEN RETURNING FROM THE CAMERA VIEW.
PI12471 RICH PAGE EDITOR'S PERFORMANCE SUFFERS WHILE TYPING.
PI12337 WHITE LINE AT THE BOTTOM IN IOS 7.1
PI11962 SECURITY ISSUE WITH WORKLIGHT CONSOLE
PI11561 STUCK IN A DIALOG ENDLESS LOOP IN ECLIPSE WORKLIGHT PREFERENCES
PI11502 EVENT LISTENERS ATTACHED WHEN CONNECT() IS INVOKED BUT NEVER UNBOUND.
PI11350 IN THE WL STUDIO WITH BUILT-IN SERVER, THE FEATURE OPEN WORKLIGHT CONSOLE DOES NOT START THE SERVER AUTOMATICALLY.
PI11168 WORKIGHT PAGE DOES NOT RESPOND TO CHANGING RICH PAGE EDITOR DEVICE ORIENTATION TO PORTRAIT
PI10959 JSONSTORE FAILS TO REMOVE ALL DOCS IN THE DOC ARRAY WHEN A DOC ARRAY IS PASSED
PI10818 FAILURE WHEN DEPLOYING WORKLIGHT APPLICATION ON WORKLIGHT PUREAPPLICATION PATTERN WHEN SCALING POLICY IS IN EFFECT
PI10775 SERVER CONFIGURATION TOOL DEPLOYMENT CAN NOT PROCEED WHEN USING DB2 DATABASE IF DB2 INSTANCE OWNER ID DOES NOT HAVE SSH ACCESS
PI10398 PROBLEM CUSTOMIZING TIMEOUTS WITH WL.CLIENT.CONNECT API.
PI10149 MOBILE BROWSER SIMULATOR IS BLOCKED IN BROWSER WHEN USING ORACLE JAVA 7 UPDATE 51 WITH "HIGH" SECURITY SETTING
PI10127 NATIVEPAGE FEATURE DOES NOT WORK PROPERLY ON WINDOWS PHONE 8
PI09913 WORKLIGHT UNDER HIGH VOLUMES SHOWS MEMORY INCREASE WHEN REPORTING ENABLED
PI09863 IF REMOVING THE OPTIONAL FIELD "BADGE", AN ERROR IS RECEIVED: "MANDATORY FIELD 'BADGE' NOT FOUND."
PI09770 IOS PUSH NOTIFICATION ERROR AFTER UPGRADING OR APPLYING FIX
PI09711 [WINDOWS 8] - CANNOT OPEN A WL.SIMPLEDIALOG AFTER IT WAS OPENED AND CLOSED
PI09666 ADDING ENVIRONMENT WAITS ON "BUILD PREVIEW PAGES"
PI09569 WHEN BACKEND IS STALE/SLOW UNDER LOAD THEN GOES BACK TO NORMAL SERVER CANNOT RECOVER UNTIL RESTART
PI09530 ADAPTER INVOCATION IS FAILING IN IOS 5 IN WORKLIGHT 6.1 ENVIRONMENT.
PI09432 CALLING ACQUIREPOSITION AFTER STARTACQUISITION HAS BEEN CALLED WITH A GEO POLICY, MAY NOT ACTIVATE TRIGGERS FOR NEW POSITIONS.
PI09373 RARELY, ON NATIVE ANDROID, MULTIPLE SUCCESS CALLBACK EXECUTIONS CAN TAKE PLACE FOR WLDEVICE.ACQUIREGEOPOSITION.
PI09372 IN NATIVE ANDROID, USE OF THE WLGEOACQUISITIONPOLICY MUST BE DONE IN A LOOPER THREAD.
PI09370 WHEN USING GEO DWELL TRIGGERS, WLGEOFAILURECALLBACK INSTANCES MAY BE EXECUTED AFTER WLDEVICE.STOPACQUISITION() IS CALLED.
PI09356 ADAPT APPLICATION CENTER PUBLISH SHORTCUT TO HANDLE XAP FILES
PI09349 WHEN IMPORTING THE IBMAPPCENTER HYBRID PROJECT, AN INCORRECT WARNING SUGGESTS TO INCREASE THE VERSION
PI09326 APPCENTER OTA INSTALLER: TITLE TRUNCATION ON DETAILS VIEW
PI09325 APPCENTER CLIENT TABLET PORTRAIT, BUTTON TRUNCATION ON DETAILS VIEW
PI09324 APPCENTER CLIENT IOS: DATES APPEAR A PHONE NUMBERS
PI09323 APPCENTER OTA CAN START IN TABLET MODE ON A PHONE IN LANDSCAPE ORIENTATION.
PI09321 WORKLIGHT APPCENTER MOBILE CLIENT: AFTER SENDING A REVIEW, THE APP IS MISSING FROM LISTS IF ITS POSITION CHANGED
PI09315 APPLICATION CENTER MOBILE CLIENT ON TABLET: SOME APPLICATIONS MAY NOT BE DISPLAYED IN CATALOG.
PI09233 WORKLIGHT SERVER THROWS EXCEPTION WHEN RE-AUTHENTICATING WITH THE ANTIXSRF REALM
PI09224 WHEN MIGRATING A PROJECT FROM WORKLIGHT 6.0 TO 6.1, AN ERROR OCCURS STATING THAT THE UPGRADE PATH IS NOT SUPPORTED
PI09029 IOS APP LINK FAILS WHEN SETTING IOS DEPLOYMENT TARGET TO 7.0
PI08960 WL RUNTIME LOGS THE FULL CLIENT REQUEST WHEN AN ERROR HAPPENS
PI08819 INCORRECT DATA MAY RETURNED WHEN SUBSCRIBING/UNSUBSCRIBING FOR SMS EVENTS
PI08807 DESIGN PANE FOR JSF PAGES FAILS TO UPDATE
PI08806 INACCURATE JSP VALIDATION
PI08789 FIX WLJQ.JS TO SUPPORT WINDOWS 8 AND WINDOWS PHONE 8
PI08777 "ITMS-SERVICES" PROTOCOL DOES NOT WORK
PI08689 INCORRECT DATA MAY BE RETURNED FROM THE SERVER TO THE APPLICATION
PI08685 IMPROVE PERFORMANCE WHEN USING THE IBM SDK FOR JAVA
PI08632 APP CLIENT CLOSES WHEN CONNECTING TO SERVER WITH ANALYTICS ENABLED.
PI08609 CLUSTER SYNC TASK REPEATEDLY TRIES TO DEPLOY OLD APP FROM THE DB TO A NEW PROJECT
PI08601 WL.SERVER.INVOKEHTTP WITH DELETE METHOD DOESN'T ACCEPT QUERY PARAM
PI08583 BLACK LINE APPEARS AT TOP OF SPLASH SCREEN ON IPAD RUNNING IOS7
PI08580 ECLIPSE CRASHES WHEN OPENING WORKLIGHT APPLICATION FRAMEWORK VIEW.HTML ON WINDOWS
PI08574 FAILURE TO MIGRATE WORKLIGHT PRE-5.0.5.0 APPLICATIONS TO WORKLIGHT 6.1.0.0
PI08511 OLD LTPA TOKEN IS BEING USED WHEN USER LOGIN AGAIN WITHIN A MINUTE OF LOGOUT
PI08189 ERROR WHEN CONNECTING TO SERVER AFTER SETTING APP TO ACTIVE IN THE CONSOLE.
PI08127 SLOW SERVER PERFORMANCE AND REPEATED DATABASE QUERIES WHEN REMOTE DISABLE IS ENABLED
PI07660 MISSING API GETDEFAULTMOBILECONFIGURATION4ANDROID_IOS() IN LOGINCONFIGURATIONSERVICE INTERFACE
PI07549 SHELL COMPONENT CHANGES ARE NOT SHOWN PROPERLY IN BROWSER DURING PREVIEW
PI07263 SCREEN TURNS BLACK ON IPAD DURING DIRECT UPDATE
PI07256 INAPPBROWSER NOT ABLE TO OPEN LOCAL URL LINKS ON ANDROID 4.4
PI06943 DIRECT UPDATE NOTIFICATION WHEN NONE AVAILABLE, THEN FAILS UPON UPDATE ATTEMPT
PI06828 ANT DEPLOMENT TASKS DON'T WORK WHEN CONSOLE IS PROTECTED WITH LTPA AUTHENTICATION
PI06652 DIRECT UPDATE ALLOWS USERS TO KEEP USING OUTDATED VERSIONS.
PI06586 INCORRECT PUSH NOTIFICATION RECEIVED WHEN MULTIPLE WL APPS ON AN ANDROID DEVICE
PI06568 DIFFERENT VERSIONS OF A WORKLIGHT APPLICATION ENVIRONMENT GET WR ONG SECURITY TEST IF SECURITY TEST IS CHANGED BETWEEN VERSIONS.
PI05454 WORKLIGHT APPLICATION CENTER ON LIBERTY PROFILE 8.5.5 PRODUCES "LAST-MODIFIED" DATES IN BAD FORMAT.
PI05447 NULLPOINTEREXCEPTION OCCURS WHEN CALLING WL.SERVER.LOGACTIVITY.
Status: Fix Pack
Additional Information: Please see http://www-01.ibm.com/support/docview.wss?uid=swg27028172 for information on installing the fix.