-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
base: master
Are you sure you want to change the base?
Conversation
@hansemannn @m1ga if we can check this |
@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 |
checked the changed files: it still has https://github.com/tidev/titanium-sdk/pull/14142/files#diff-2c47f46b98744ab36764749bd8937002f06e1293a9b41d4ff2e12c1790e47d77 |
I only reverted the file to it's original content from the main repo |
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 |
There was a problem hiding this 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"]) { |
There was a problem hiding this comment.
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"]) { |
There was a problem hiding this comment.
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"]) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- (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]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use proper Objc types
[task setTaskCompletedWithSuccess:false]; | |
[task setTaskCompletedWithSuccess:NO]; |
NSDictionary *bgTask = nil; | ||
for (NSDictionary *backgroundTask in backgroundTasks) { | ||
if (backgroundTask[@"identifier"] == identifier) { | ||
bgTask = backgroundTask; |
There was a problem hiding this comment.
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
} |
There was a problem hiding this comment.
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 = ""; |
There was a problem hiding this comment.
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 = ""; |
There was a problem hiding this comment.
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" : [ | |||
{ |
There was a problem hiding this comment.
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
This PR is solely to revive PR #12411