Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ios): reviving PR #12411 for ios background tasks #14142

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

AbdullahFaqeir
Copy link
Contributor

@AbdullahFaqeir AbdullahFaqeir commented Nov 9, 2024

This PR is solely to revive PR #12411

@AbdullahFaqeir AbdullahFaqeir changed the title feat(ios): reviving PR (#12411) for ios background tasks feat(ios): reviving PR #12411 for ios background tasks Nov 9, 2024
@AbdullahFaqeir
Copy link
Contributor Author

@hansemannn @m1ga if we can check this

@m1ga
Copy link
Contributor

m1ga commented Nov 12, 2024

@AbdullahFaqeir I think you are still on a different branch as I can see some of your "ios dark mode icons" stuff in there.

@AbdullahFaqeir
Copy link
Contributor Author

@AbdullahFaqeir I think you are still on a different branch as I can see some of your "ios dark mode icons" stuff in there.

@m1ga already cleaned up

@m1ga
Copy link
Contributor

m1ga commented Nov 12, 2024

@AbdullahFaqeir
Copy link
Contributor Author

I only reverted the file to it's original content from the main repo

@m1ga
Copy link
Contributor

m1ga commented Nov 12, 2024

That part (and the other file you reverted already) is from your other PR: https://github.com/tidev/titanium-sdk/pull/14137/files . It looks like you didn't start from the master branch to start the PR but from this branch ios-dark-mode-icons

Copy link
Collaborator

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some open issues before we can proceed, but it looks good in general!

ENSURE_STRING(args[@"identifier"]);
ENSURE_STRING(args[@"type"]);

if ([TiUtils isIOSVersionLower:@"13.0"]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Titanium SDK has a current minimum of iOS 13 already, so you can remove this

@@ -433,6 +433,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// Create application support directory if not exists
[self createDefaultDirectories];

if ([TiUtils isIOSVersionOrGreater:@"13.0"]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove guard, not necessary

@@ -1083,20 +1087,26 @@ - (void)applicationDidEnterBackground:(UIApplication *)application

[[NSNotificationCenter defaultCenter] postNotificationName:kTiPausedNotification object:self];

if ([TiUtils isIOSVersionOrGreater:@"13.0"]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

}
}

- (void)handleBGTask:(BGTask *)task
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- (void)handleBGTask:(BGTask *)task
- (void)handleBackgroundTask:(BGTask *)task

// Fo processing task, if it is not completed in time then only submit it again.
[self submitTaskForIdentifier:task.identifier];
}
[task setTaskCompletedWithSuccess:false];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use proper Objc types

Suggested change
[task setTaskCompletedWithSuccess:false];
[task setTaskCompletedWithSuccess:NO];

NSDictionary *bgTask = nil;
for (NSDictionary *backgroundTask in backgroundTasks) {
if (backgroundTask[@"identifier"] == identifier) {
bgTask = backgroundTask;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply return here, so you save the extra assignment. Return nil by default after the loop

}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change (add extra line again)

@@ -2391,6 +2391,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
EXCLUDED_ARCHS = "";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change

@@ -2454,6 +2455,7 @@
ENABLE_BITCODE = NO;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
ENABLE_NS_ASSERTIONS = NO;
EXCLUDED_ARCHS = "";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change

@@ -1,68 +1,117 @@
{
"images" : [
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restore all change in this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants