IBM Worklight Hybrid Application似乎在初始化之前停滞不前

时间:2015-07-29 19:43:48

标签: ios backbone.js ibm-mobilefirst

我在使用Worklight 6.2.0.1时遇到了一个奇怪的问题。它仅在iOS上发生。

有时当我启动应用程序时,它似乎卡住了,所以我必须最小化并重新打开它才能继续初始化流程。

这是Xcode日志:

2015-07-29 16:33:02.693 SocialClosing[695:127943] [DEBUG] [WL_INIT] -[WLImpl initWL] in WLImpl.m:124 :: At first launch
2015-07-29 16:33:02.705 SocialClosing[695:127943] [DEBUG] [WL_INIT] -[WLImpl initWL] in WLImpl.m:150 :: Web resources should not be extracted.
2015-07-29 16:33:02.866 SocialClosing[695:127878] Multi-tasking -> Device: YES, App: YES
2015-07-29 16:33:02.875 SocialClosing[695:127878] Unlimited access to network resources
2015-07-29 16:33:02.884 SocialClosing[695:127878] [CDVTimer][wlapp] 0.239968ms
2015-07-29 16:33:02.884 SocialClosing[695:127878] [CDVTimer][push] 0.120997ms
2015-07-29 16:33:02.884 SocialClosing[695:127878] [CDVTimer][TotalPluginStartup] 0.899971ms
2015-07-29 16:33:02.896 SocialClosing[695:127878] Unbalanced calls to begin/end appearance transitions for <Compatibility50ViewController: 0x15e81e60>.
2015-07-29 16:33:02.900 SocialClosing[695:127878] Resetting plugins due to page load.
2015-07-29 16:33:05.231 SocialClosing[695:127878] Finished load of: file:///private/var/mobile/Containers/Bundle/Application/E4ED8DED-718D-44BA-9B45-A1195F6F7AE4/SocialClosing.app/www/default/index.html
2015-07-29 16:33:06.887 SocialClosing[695:127903] [DEBUG] [NONE] ondeviceready event dispatched
2015-07-29 16:33:06.904 SocialClosing[695:127878] THREAD WARNING: ['WLApp'] took '17.299072' ms. Plugin should use a background thread.
2015-07-29 16:33:06.930 SocialClosing[695:127903] [WARN] [NONE] Initialization options 'enableLogger' and 'logger' are deprecated. Use WL.Logger.config to set logger behavior.
2015-07-29 16:33:06.934 SocialClosing[695:127878] log1
2015-07-29 16:33:06.935 SocialClosing[695:127906] [DEBUG] [NONE] wlclient init started
2015-07-29 16:33:06.940 SocialClosing[695:127904] [DEBUG] [NONE] CookieMgr read cookies: {}
2015-07-29 16:33:06.944 SocialClosing[695:127948] [DEBUG] [NONE] Read cookies: null
2015-07-29 16:33:06.963 SocialClosing[695:127878] THREAD WARNING: ['DeviceAuth'] took '17.553711' ms. Plugin should use a background thread.
2015-07-29 16:33:06.973 SocialClosing[695:127903] [DEBUG] [NONE] before: initOptions.onSuccess
2015-07-29 16:33:06.978 SocialClosing[695:127948] [DEBUG] [NONE] after: initOptions.onSuccess
2015-07-29 16:33:06.984 SocialClosing[695:127905] [DEBUG] [NONE] added onPause event handler 
2015-07-29 16:33:06.991 SocialClosing[695:127906] [DEBUG] [NONE] wlclient init success

在我最小化并重新打开应用程序后(通过iOS设备上的主页按钮),它继续并运行我的javascript代码,如下所示:

{2015-07-29 16:35:28.632 SocialClosing[695:127878] Login Initialized
2015-07-29 16:35:28.652 SocialClosing[695:127878] THREAD WARNING: ['NotificationEx'] took '18.151123' ms. Plugin should use a background thread.
2015-07-29 16:35:28.653 SocialClosing[695:127878] UserDAO initialize begin.
2015-07-29 16:35:28.654 SocialClosing[695:127878] BaseDAO initialize begin.
2015-07-29 16:35:28.654 SocialClosing[695:127878] BaseDAO _initializeJSONStoreCollection begin.
2015-07-29 16:35:41.795 SocialClosing[695:127878] JSONStore collection UserCollection opened successfully.
2015-07-29 16:35:42.695 SocialClosing[695:127878] UserPersistenceDAO initialize begin.
2015-07-29 16:35:42.696 SocialClosing[695:127878] BaseDAO initialize begin.
2015-07-29 16:35:42.696 SocialClosing[695:127878] BaseDAO _initializeJSONStoreCollection begin.
2015-07-29 16:35:44.281 SocialClosing[695:127878] JSONStore collection UserPersistenceCollection opened successfully.
2015-07-29 16:35:44.281 SocialClosing[695:127878] UserPersistenceDAO getUser begin.
2015-07-29 16:35:44.281 SocialClosing[695:127878] BaseDAO _getAllRegistries begin.
2015-07-29 16:35:45.931 SocialClosing[695:127878] Find All registries successfully executed on UserPersistenceCollection JSONStore.}

我一直试图解决这个问题一个多星期没有成功。

以下是一些注意事项:

  • 每次都不会发生这个问题;
  • 我在真实设备(iPad Air和iPhone 5c)上调试应用程序;
  • 我在Safari上调试了它,它似乎在调用之前卡住了 pageview(我正在使用骨干)初始化方法;

请随时向我提出更多信息。

提前致谢!

1 个答案:

答案 0 :(得分:0)

我正在为我的问题写一个答案,但这不是完整的解决方案。

由于我使用Require JS来管理依赖项,我让它来处理以下Worklight文件:

  • initOptions.js
  • main.js
  • messages.js

现在JsonStore正在初始化,但有时我得到这个:

2015-08-18 11:12:39.373 SocialClosing[2387:711665] [DEBUG] [NONE] establishSSLClientAuth
2015-08-18 11:12:39.379 SocialClosing[2387:711640] [WARN] [USER_CERT_AUTH] +[WLUserAuthManager getCertificateIdentifier] in WLUserAuthManager.m:68 :: Certificate Identifier Key: com.worklight.userenrollment.certificate:com.ibm.cio.be.SocialClosing
2015-08-18 11:12:39.387 SocialClosing[2387:711640] THREAD WARNING: ['UserAuth'] took '11.081055' ms. Plugin should use a background thread.
2015-08-18 11:12:39.388 SocialClosing[2387:711640] Error in error callback: UserAuth318076151 = TypeError: null is not a valid argument for 'in' (evaluating 'field in profile')

在这种情况下,启动画面不会消失。

不幸的是,直到现在我还不知道如何解决这个问题。