Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25779] Foreground Push notification cannot get received when there is "Content-Available" in payload

GitHub Issuen/a
TypeBug
PriorityNone
StatusResolved
ResolutionNot Our Bug
Resolution Date2018-09-01T12:05:31.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterShuo Liang
AssigneeEric Wieber
Created2018-02-14T08:20:36.000+0000
Updated2018-09-01T12:05:31.000+0000

Description

Reproduce

1. Run the following app on iOS device. https://github.com/sliang0904/SimlpePushCode/blob/master/app.js 2. Click subscribe button to register to channel. And keep the app in foreground. 3. Send push notification from dashboard. But with 'Content-Available' checked. (attached screen shot) 4. Then the app can not get the push notification. 5. But if you put the app in background. Then send same push again. then app can receive the push.

Attachments

FileDateSize
Screen Shot 2018-02-14 at 4.18.33 PM.png2018-02-14T08:20:20.000+0000171936

Comments

  1. Hans Knöchel 2018-02-14

    Hey there! Looking in the Apple forums, it seems to be a [known issue](https://forums.developer.apple.com/thread/88239) on iOS 11. Some posts indicate it is fixed in iOS 11.1 and later which would be interesting to confirm. We didn't change anything to silent push-notifications on our side, so the above link provide some guidance. More references: - https://forums.developer.apple.com/thread/79734 - https://stackoverflow.com/questions/44796613/silent-pushes-not-delivered-to-the-app-on-ios-11 - http://www.openradar.me/34139840
  2. Abir Mukherjee 2018-02-14

    [~ewieber] can you try and reproduce?
  3. Eric Wieber 2018-02-16

    [~amukherjee] [~hknoechel] I am able to reproduce this issue as described. Push notifications are not received if content-available is true and if the app is in the foreground. If the app is in the background or content-available is false, the notification is received normally. As Hans mentioned, it appears to be an Apple bug and I do not see it fixed in 11.2.5 or the latest 11.3 beta
  4. Hans Knöchel 2018-02-18

    [~ewieber] Does this work on iOS < 11, e.g. iOS 10? Also, is there a difference when testing in SDK 6.0.x? We did one change in 6.1.0 that may affect that, although it should not. Finally, I expect that you all have a proper silent push environment set up, e.g. UIBackgroundModes containing the remote-notification key as documented [in the docs](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.App.iOS-event-silentpush):
           <ios>
               <plist>
                   <dict>
                       <key>UIBackgroundModes</key>
                       <array>
                           <string>remote-notification</string>
                       </array>
                       <!-- More keys of the tiapp.xml ... -->
                   </dict>
               </plist>
           </ios>
       
    And finally, a [quote from Apple](https://developer.apple.com/library/content/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG23): {quote} If your notification payload contains the content-available key, your app will receive the notification if iOS or OS X determines it is energy-efficient to do so. If the energy or data budget for the device has been exceeded, your app will not receive any more notifications with the content-available key until the budget has been reset. This occurs once a day and cannot be changed by user or developer action. This throttle is disabled if the app is run from Xcode, so be sure to test your app by running it from the device to have the same user experience your customers will have. {quote}
  5. Victor Vazquez Montero 2018-02-21

    [~hknoechel] do we have any update for the customer on this ticket?
  6. Eric Wieber 2018-02-28

    [~hknoechel], I have silent push properly set up for my project. However, when testing again today I saw the push notification show up twice (once with app in foreground and once with app in background), but then It stopped showing notifications after those 2. I also checked with iOS 10.3.3 and SDK 6.0.0.GA and saw the same behavior. I could see your quote from Apple being a factor here and effecting the results from my testing. Even so, I am unsure why I was originally able to send the same push notification to the app and it would succeed with the app in the background but not with the app in the foreground. [~vvazquezmontero], can you confirm that the customer is using the appropriate tiapp.xml configuration, that Hans mentioned, to be sure we have similar environments?

JSON Source