ipohfly
ipohfly

Reputation: 2009

IBM Worklight - App hang at splash screen after applying FixPack

After applying FixPack 1 (for Worklight 6.1.01) on the device, we notice some unexpected behaviour in iOS. We had tried on both iOS 6 and 7.1 and they both display the same behavior.

We had increase the version number of the app (i.e. from 1.2 to 1.3) for the deployment. When the user try to update the app via the AppCenter Mobile Client, after installing, the app will just stop at the splash screen with the IBM logo. Only by delete / uninstall the app and reinstall again the app can work as per usual.

We check the console log in xcode and got the following print out:

May 26 13:16:42 MY-iPad profiled[713] <Notice>: (Note ) profiled: Service stopping.
May 26 13:16:42 MY-iPad kernel[0] <Debug>: launchd[714] Container: /private/var/mobile/Applications/284CEAF0-8B89-467C-BA55-0F277FFA6521 (sandbox)
May 26 13:16:42 MY-iPad backboardd[28] <Error>: HID: The 'Passive' connection 'MyMobileApp' access to protected services is denied.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [DEBUG] [WORKLIGHT] -[WLCordovaAppDelegate handleAppWebResources:] in WLCordovaAppDelegate.m:373 :: NativeInitUntilWebViewLoad : START
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [DEBUG] [OCLogger] Max file size exceeded for log messages.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Web resources integrity test is disabled.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Application windows are expected to have a root view controller at the end of application launch
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Multi-tasking -> Device: YES, App: YES
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Unlimited access to network resources
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [CDVTimer][splashscreen] 15.210986ms
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [CDVTimer][TotalPluginStartup] 17.367005ms
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: WARNING: AutoHideSplashScreen key in Cordova.plist is missing or set to NO! SplashScreen will display indefinitley unless you manually hide it. Set value to YES to autohide.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [DEBUG] [WORKLIGHT] -[WLCordovaAppDelegate postInitOnMainThread:] in WLCordovaAppDelegate.m:303 :: NativeInitUntilWebViewLoad : END
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [DEBUG] [OCLogger] Max file size exceeded for log messages.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Resetting plugins due to page load.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Failed to load webpage with error: The requested URL was not found on this server.

Some googling on the issue lead to this Worklight 6.1 "access to protected services is denied" after app is deployed to App Store. It is a similar issue albeit with a different behaviour.

For now we had instructed the user to clear all their data before they upgrade the app, but we can't use this method going forward as there will be crucial data in the device that we can't erase simply for upgrading the app.

Any info or idea on this is appreciated.

UPDATE

We tried to redeploy the app by using the Server Configuration Tool but still the same problem persists. We checked the log for the Fixpack installation and there was no error reported. Also the IBM Installation Manager shows that the version installed is the latest 6.1.01 and it doesn't allow me to Update it, only Modify.

UPDATE 2

After deleting the native folder and redeploy the apps (from the .wlapp file to the .ipa file), the same issue still appear. However a pattern is observed.

If the app is rebuild and redeploy, the first install from the AppCenter will run as per usual with no problem, meaning the data will be preserved and the apps run normally, even though there are no changes in the code and version no. However if you click on the install button another time to install again, then the problem will appear.

Upvotes: 1

Views: 1131

Answers (2)

ipohfly
ipohfly

Reputation: 2009

IBM had released a quick fix patch for the issue, and after installing onto the development server, things look fine.

Upvotes: 0

Michael Galaxy
Michael Galaxy

Reputation: 1283

I figured it out - there's a bug in worklight (not cordova).

In the file:

helloHelloIphone/Classes/hello.m, the Xcode debugger reported that the following auto-generated worklight code was loading an incorrect value for "startPage":

-(void)wlInitDidCompleteSuccessfully
{
    UIViewController* rootViewController = self.window.rootViewController;

    // Create a Cordova View Controller
    CDVViewController* cordovaViewController = [[CDVViewController alloc] init] ;

    cordovaViewController.startPage = [[WL sharedInstance] mainHtmlFilePath];

Because the value of “startPage” turned out to be:

       @"worklight:///Users/mrhines/Library/Application Support/iPhone Simulator/6.1/Applications/A2E1427C-7DFF-4843-BF3D-0B7E4B470E43/hello.app/www/default/(null)”

This is clearly wrong - the end of the string should say “index.html”, not null.

So, by replacing the last line of code above with the following line:

       cordovaViewController.startPage = [[[WL sharedInstance] mainHtmlFilePath] stringByReplacingOccurrencesOfString:@"(null)" withString:@"index.html"];

My application reliably starts up and moves past the hung splash screen, fixing the bug in Worklight.

Upvotes: 2

Related Questions