Skip to content

feat(build): add API to update the iOS entitlements file - #7448

Merged
lucasfernog merged 1 commit into
devfrom
feat/update-entitlements-file
Jul 18, 2023
Merged

feat(build): add API to update the iOS entitlements file#7448
lucasfernog merged 1 commit into
devfrom
feat/update-entitlements-file

Conversation

@lucasfernog

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

@lucasfernog
lucasfernog requested a review from a team as a code owner July 18, 2023 12:31
@lucasfernog

Copy link
Copy Markdown
Member Author

Needs #7445 and #7446

@lucasfernog

Copy link
Copy Markdown
Member Author

Example usage together with #7447

// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

#[derive(serde::Deserialize)]
struct Config {
    domains: Vec<String>,
}

fn main() {
    if let Some(config) = tauri_build::config::plugin_config::<Config>("deepLink") {
        #[cfg(target_os = "macos")]
        {
            tauri_build::mobile::update_entitlements(|entitlements| {
                entitlements.insert(
                    "com.apple.developer.associated-domains".into(),
                    config
                        .domains
                        .into_iter()
                        .map(Into::into)
                        .collect::<Vec<_>>()
                        .into(),
                );
            })
            .expect("failed to update entitlements");
        }
    }
}

@lucasfernog
lucasfernog merged commit aba04fa into dev Jul 18, 2023
@lucasfernog
lucasfernog deleted the feat/update-entitlements-file branch July 18, 2023 13:20
krzykro2 pushed a commit to krzykro2/tauri that referenced this pull request Jul 24, 2023
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