Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19615] iOS: Suppress missing UIBackgroundModes "fetch" and "remote-notification" warnings

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2015-10-14T15:50:36.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.1.0
ComponentsiOS
Labelsn/a
ReporterChris Barber
AssigneeChee Kiat Ng
Created2015-09-29T15:10:21.000+0000
Updated2015-10-15T11:16:53.000+0000

Description

When running a Titanium app in the simulator I noticed the following in the console:
Sep 25 12:39:01 yojimbo itworks[99959]: You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.
Sep 25 12:39:01 yojimbo itworks[99959]: You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
It appears that we need to add "fetch" and "remote-notification" to the list of UIBackgroundModes but only if these features are used. Perhaps we need to use the following to control this:
#ifdef USE_TI_FETCH

#ifdef USE_TI_SILENTPUSH

Comments

  1. Chee Kiat Ng 2015-10-01

    PR HERE: https://github.com/appcelerator/titanium_mobile/pull/7257

    Steps to test for removal of warnings

    1. create a new project 2. build the project

    Expected result

    - you will no longer see the warnings - if you look in project/build/iphone/classes/defines.h, you will not see TI_SILENTPUSH or TI_FETCH

    Steps to test if these 2 properties still work when declared in tiapp.xml

    1. in the same project, include this in tiapp.xml
       	<ios>
       		<plist>
       			<dict>
       				<key>UIBackgroundModes</key>
       				<array>
       					<string>remote-notification</string>
                                               <string>fetch</string>
       				</array>
       ....
       
    2. build the project again

    Expected result

    - there is still no warnings - if you look in project/build/iphone/classes/defines.h, you will see TI_SILENTPUSH and TI_FETCH Run above tests with simulator as well as device.
  2. Satyam Sekhri 2015-10-13

    [~cng] following the test instructions mentioned by you, the warnings are suppressed however if we add the two properties in tiapp.xml and build the project on iOS simulator then we do not see these in defines.h. These properties are present in defines.h file if we build to a device. Hence, reopening the ticket. Verified on: Mac OS: 10.10.5 Ti SDK: 5.1.0.v20151009204425 Xcode: 7.0.1 Appc CLI NPM: 4.2.0 Appc CLI Core: 5.1.0-38 Appc Studio: 4.3.1.201509302304 Device: iPhone Simulator (v9.0), iPhone 6S (v9.0.2)
  3. Chee Kiat Ng 2015-10-13

    Master PR: https://github.com/appcelerator/titanium_mobile/pull/7293 Backport: https://github.com/appcelerator/titanium_mobile/pull/7294
  4. Satyam Sekhri 2015-10-15

    Verified based on test instructions in the comments. Verified on: Mac OS: 10.10.5 Ti SDK: 5.1.0.v20151014101225 Xcode: 7.0.1 Appc CLI NPM: 4.2.1-1 Appc CLI Core: 5.1.0-38 Appc Studio: 4.4.0.201510092420 Device: iPhone Simulator (v9.0), iPhone 6S (v9.0.2)

JSON Source