titanium-sdk icon indicating copy to clipboard operation
titanium-sdk copied to clipboard

feat(ios): support iOS 13 background task API

Open vijaysingh-axway opened this issue 3 years ago • 2 comments

https://jira.appcelerator.org/browse/TIMOB-27864

Test Case -

const win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});

const label = Ti.UI.createLabel({
    text: 'Background task',
});

win.add(label);
win.open();

Ti.App.iOS.registerBackgroundTask({
	'identifier': 'com.test.bgrefresh',
	'type': Ti.App.iOS.BACKGROUND_TASK_TYPE_REFRESH,
});

Ti.App.iOS.registerBackgroundTask({
	'identifier': 'com.test.bgprocessing',
	'type': Ti.App.iOS.BACKGROUND_TASK_TYPE_PROCESS,
	'powerConnect': true,
	'networkConnect': true
});

Ti.App.iOS.addEventListener('backgroundfetch', function(e) {
    Ti.API.info('backgroundfetch: ' + JSON.stringify(e));

    label.text = 'backgroundfetch';

    Ti.App.iOS.endBackgroundHandler(e.handlerId);
});

Ti.App.iOS.addEventListener('backgroundprocess', function(e) {
    Ti.API.info('backgroundprocess: ' + JSON.stringify(e));

    label.text = 'backgroundprocess';
 
    Ti.App.iOS.endBackgroundHandler(e.handlerId);
});

vijaysingh-axway avatar Jan 23 '21 00:01 vijaysingh-axway

Warnings
:warning:

Commit 715805a3b74870ce61dfc35b279e4a23ee874352 has a message "doc(ios): fixed docs" giving 1 errors:

  • type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]
:warning:

Commit 53aa06ce197990818718bb265d84a1f409cd2ae3 has a message "doc(ios): fixed linting issue" giving 1 errors:

  • type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]
:warning: This PR has milestone set to 10.0.0, but the version defined in package.json is 10.1.0 Please either: - Update the milestone on the PR - Update the version in package.json - Hold the PR to be merged later after a release and version bump on this branch
Messages
:book:

:rotating_light: This PR has one or more commits with warnings/errors for commit messages not matching our configuration. You may want to squash merge this PR and edit the message to match our conventions, or ask the original developer to modify their history.

:book:

:white_check_mark: All tests are passing Nice one! All 14303 tests are passing. (There are 955 skipped tests not included in that total)

:book:

:floppy_disk: Here's the generated SDK zipfile.

Generated by :no_entry_sign: dangerJS against 3476343c295c44fd881cd620fae4005e32939e04

build avatar Jan 23 '21 01:01 build

@m1ga @joshualambert The CLI check fails. What do we do with PR's that came from the Appc times? @vijaysingh-axway Are you still here? :) In case you are, would you mind signing the TiDev CLA, so we can merge this? https://github.com/tidev/organization-docs/blob/main/AUTHORIZED_CONTRIBUTORS.md

hansemannn avatar Nov 28 '22 09:11 hansemannn