[TIMOB-19615] iOS: Suppress missing UIBackgroundModes "fetch" and "remote-notification" warnings
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-10-14T15:50:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.1.0 |
Components | iOS |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Chee Kiat Ng |
Created | 2015-09-29T15:10:21.000+0000 |
Updated | 2015-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
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 projectExpected 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_FETCHSteps to test if these 2 properties still work when declared in tiapp.xml
1. in the same project, include this in tiapp.xml2. 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.[~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)
Master PR: https://github.com/appcelerator/titanium_mobile/pull/7293 Backport: https://github.com/appcelerator/titanium_mobile/pull/7294
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)