Scope identifiers to bundle ID for multi-instance support#572
Closed
bjorkert wants to merge 3 commits intolive-activityfrom
Closed
Scope identifiers to bundle ID for multi-instance support#572bjorkert wants to merge 3 commits intolive-activityfrom
bjorkert wants to merge 3 commits intolive-activityfrom
Conversation
Derive BGTask IDs, notification IDs, URL schemes, and notification categories from Bundle.main.bundleIdentifier so that LoopFollow, LoopFollow_Second, and LoopFollow_Third each get isolated identifiers and don't interfere with each other's background tasks, notifications, or Live Activities. Also show the configured display name in the Live Activity footer (next to the update time) when the existing "Show Display Name" toggle is enabled, so users can identify which instance a LA belongs to.
Users upgrading from the old hardcoded identifiers would have orphaned pending notifications that the new bundle-ID-scoped code can't cancel. This one-time migration cleans them up on first launch.
Contributor
Author
|
Closing since this code is already in the branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundle.main.bundleIdentifierso LoopFollow, LoopFollow_Second, and LoopFollow_Third each get isolated identifiersIdentifiers fixed
com.loopfollow.audiorefresh<bundleID>.audiorefreshloopfollow.la.renewal.failed<bundleID>.la.renewal.failedloopfollow.background.alert.*<bundleID>.background.alert.*loopfollow.background.alert<bundleID>.background.alertloopfollowloopfollow$(app_suffix)com.loopfollow.audiorefreshcom.$(unique_id).LoopFollow$(app_suffix).audiorefreshDisplay name in LA footer
Last Update: 14:32LoopFollow — 14:32(or whatever custom name is configured)Migration step 7
Cancels any pending/delivered notifications with the old hardcoded identifiers (
loopfollow.background.alert.*,loopfollow.la.renewal.failed) so users upgrading don't get orphaned notifications.Files changed
AppGroupID.swift— addedbaseBundleIDandurlSchemehelpersInfo.plist— BGTask ID and URL scheme use build variablesBackgroundRefreshManager.swift— task ID from bundle IDLiveActivityManager.swift— notification ID from bundle ID, writes display name to App GroupBackgroundAlertManager.swift— all notification IDs from bundle IDAppDelegate.swift— category ID fromBackgroundAlertIdentifierSceneDelegate.swift— URL scheme fromAppGroupID.urlSchemeRestartLiveActivityIntent.swift— URL scheme fromAppGroupID.urlSchemeLAAppGroupSettings.swift— display name + show toggle via App Group UserDefaultsLoopFollowLiveActivity.swift— URL scheme fromAppGroupID.urlScheme, conditional footerStorage+Migrate.swift— migration step 7: cancel legacy notification identifiersMainViewController.swift— run migration step 7