Skip to content

Add capability to open app or redirect to AppStore #72

Open
@victorjspinto

Description

@victorjspinto

Hello!!

Nice project that you have here!

I would like to improve this project with a simple snipet that detect that app is already installed and redirect to it or app wans't installed and redirect to app store.

It could improve the user experience =D

Here are the proposal:

iOS

When smartbanner opens on iOS, the following snippet may apply:

var ifrm = document.getElementById("innerFrame");
function redirect_to_store() {
  if (!document.hidden) {
    window.location.href = store_link;
  }
}
try {
  ifrm.src = app_link;
} catch (e) {
  window.location.href = store_link;
}
setTimeout (redirect_to_store, 1000);

Android

On android, we can use something called Intent Links. Here is a post with better explanation.

https://developer.chrome.com/multidevice/android/intents

We can define some metas with data needed and i can made an PullRequest =)

Hope i can help :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions