Skip to content

Use environment appName instead of hardcoded Loop #14

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

marionbarker
Copy link
Contributor

  1. Add code needed to use environment that ties appName to CFBundleDisplayName
  2. Use the appName from the environment to replace hardcoded Loop in strings
    • For one file, I did not know how to insert the environment variable for appName, so I put in a work-around string instead
    • This can be updated if someone provides instructions (PumpOpsSession.swift)

None of these changes could be tested.

  • I think some of these views just aren't used anymore
  • The one that is used requires an MDT with MySentry to test and I only have an MDT


return vc
}

static func useMySentry(_ value: Bool) -> T {
let vc = T()
@Environment(\.appName) var appName
Copy link
Contributor

Choose a reason for hiding this comment

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

@Environment is generally used on a SwiftUI view (this is an extension on a UIKit View controller), as the data is passed through the view hierarchy. I'm not sure how/if this is working?

@marionbarker
Copy link
Contributor Author

I prepared code to use appName based off a few hints. I am working via "prototype example" and don't have a solid understanding of how and why it works. Your comment above that "@Environment is generally used on a SwiftUI view (this is an extension on a UIKit View controller)" probably indicates this will not work for MinimedKitUI/RadioSelectionTableViewController.swift as desired.

I was not able to test the modification for this file because I do not have a Medtronic pump that supports MySentry. I was able to test the other instances and show that they did work as expected.

There was a case for OmniBLE/Kit (BeepPreference) where the attempt to use appName did not succeed. See this link:

To summarize tests done in that PR: "To reiterate the problem, this picks up the defaultValue from LoopKit instead of the appName from the environment that I expected."

In that case, I demonstrated that whatever value was found on this line in LoopKit/LoopKitUI/Extensions/Environment+AppName.swift is what is inserted into appName when I tried to use it.

marionbarker added a commit to loopandlearn/MinimedKit that referenced this pull request Jun 19, 2024
Parallel PR to LoopKit LoopKit#14, Enable app name instead of hardcoded Loop
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.

2 participants