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): addDelegateHandler to add App Delegate handlers #10371

Merged
merged 1 commit into from Sep 2, 2023

Conversation

rigor789
Copy link
Member

PR Checklist

What is the current behavior?

In order to add delegate handlers, users must replace the Application.ios.delegate with their own - accounting for existing delegates if any (ie. from plugins).

What is the new behavior?

To simplify adding delegate handlers, users no longer need to replace the delegate, and can just add/register them via the new api:

Application.ios.addDelegateHandler('applicationDidBecomeActive', (application: UIApplication) => {
  console.log('applicationDidBecomeActive', application);
});

The types should automatically be inferred for the handler function.

Implementation loosely based off of https://github.com/nativescript-community/universal-links/blob/master/src/universal-links/index.ios.ts#L6-L31

@NathanWalker NathanWalker merged commit a959a79 into main Sep 2, 2023
3 checks passed
@NathanWalker NathanWalker deleted the feat/addDelegateHandler branch September 2, 2023 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants