Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1653] Black screen on resume when background processing is interrupted iOS

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2015-07-03T23:36:42.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
LabelsTCSupportTriage, ios
ReporterNick Kemp
AssigneeRadamantis Torres-Lechuga
Created2014-09-10T22:15:15.000+0000
Updated2016-03-08T07:38:08.000+0000

Description

When I add the remote-notification UIBackgroundMode to tiapp.xml, opening the app immediately after a push notification arrives results in a black screen. The app continues to run (confirmed by doing a test alert and logging), but the UI is missing. I have tried opening a new dummy window in the resume event, but nothing is displayed, just a black screen. If I go back to the home screen and then re-enter the app, the UI is displayed as normal. Removing the remote-notification plist settings returns the app to normal resume behaviour. This problem has also been reported by users using background-fetch. Further testing has showed that alert(); does produce a dialog on screen (while the screen is black). So may point to a Window unload issue?

Comments

  1. Nick Kemp 2014-09-11

    Further testing has shown that the UI is not returned to "Normal" state until Ti.App.iOS.endBackgroundHandler is called. Immediatly calling Ti.App.iOS.endBackgroundHandler on the Ti.App.iOS.addEventListener('silentpush', function(e)) corrects the black screen issue. However I believe the intention is to call Ti.App.iOS.endBackgroundHandler when processing is complete, not arbitrarily.
  2. Mauro Parra-Miranda 2014-09-17

    Hello Nick! Please follow the instructions on how to add a bug report : https://wiki.appcelerator.org/display/guides2/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-SubmittingTickets In short: 1. Provide a clean simple title 2. Provide a simple straightforward description 3. Steps to reproduce the issue 4. Sample code that reproduces the issue (in the form of app.js that can be added to a new mobile project in classic titanium) 5. Expected results 6. Actual results Best Regards!
  3. Naveen R 2014-09-24

    I have this issue too Sample Code: var window = Ti.UI.createWindow({ }); var view = Titanium.UI.createView({ borderRadius:10, backgroundColor:'red', width:50, height:50 }); Ti.App.iOS.addEventListener("silentpush", function (e) { if (e && typeof e !== 'undefined' && e.aps && e.aps['content-available'] && typeof e.aps['content-available'] !== 'undefined') { Ti.API.info('silent push received in app.js'); } }); window.add(view); window.open(); Steps to reproduce: 1. Send a silent push to the above app while it is in background 2. Open the app immediately after the push notification is received 3. You will see a black screen. Expected Result: App should open Acutal result: Black screen Additional findings If a silent push is received and I open the app, I get a black screen. If I press the home button again and reopen the app, the black screen vanishes. Also if I call Ti.App.iOS.endBackgroundHandler(e.handlerId); inside the event listener, the black screen doesn't appear. But I guess Ti.App.iOS.endBackgroundHandler(e.handlerId); should be called only when the processing is complete. Generally if the app is opened before the expiration of the 30 second window provided by apple for background download or before Ti.App.iOS.endBackgroundHandler(e.handlerId); is called, I get a black screen.
  4. erez pilosof 2014-10-01

    any thought why it happens ? way around it ? also happens on ios8 remotenotificationaction handlers...
  5. Martin Guillon 2014-10-02

    I have been heavily testing this one with xcode. - it won't always happen. - Only happen when the app must be started in the background: remote-notification - You MUST wait for the app to start in the background before opening it to see the bug. - I think it s related to drawing not happening. I have seen the black screen but not only. On thing i also see is a drawing problem with UITableView. If the UITableView is loaded in the background, then my cells are not drawing. THey are layed out correctly but drawing is not called. Still investigating, this is a really hard one ...
  6. Nick Kemp 2015-07-03

    There is sample code in the comments -why has this been closed?
  7. Radamantis Torres-Lechuga 2015-07-04

    [~nickkemp] we can not replicate the issue with the information provided, are you able to replicate?

JSON Source