Skip to content

feat: Allow handling Open URL actions in user code#118

Merged
gyoshev merged 2 commits intodevelopfrom
allow-handling-openurl-actions
Nov 1, 2020
Merged

feat: Allow handling Open URL actions in user code#118
gyoshev merged 2 commits intodevelopfrom
allow-handling-openurl-actions

Conversation

@gyoshev
Copy link
Copy Markdown
Contributor

@gyoshev gyoshev commented Oct 30, 2020

Allows handling of Open URL actions in user code, replacing the default window.location.assign code.

Triggers a preventable openUrl event that receives the URL to open. User code looks like:

Leanplum.on('openUrl', function(e) {
  // prevent default open
  e.preventDefault();

  // open in new tab, or use in client-side router, etc.
  window.open(e.url, '_blank');
});

@gyoshev gyoshev requested a review from iignatov October 30, 2020 06:25
@gyoshev gyoshev merged commit 85c1bdc into develop Nov 1, 2020
@gyoshev gyoshev deleted the allow-handling-openurl-actions branch November 1, 2020 06:03
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