question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not use this with a button

See original GitHub issue

According to the Apple Developer guidelines

Because this method may or may not present an alert, it’s not appropriate to call it in response to a button tap or other user action.

I would suggest including this in the README just so it’s explicit.

This had me tapping my head for some time trying to figure out why it was failing to show in my app, even though it worked in development. Well, folks, if anyone else is having this issue, that’s why. However, do not despair, there is a workaround:

import {
  Linking,
  Platform,
} from 'react-native';


const APP_STORE_LINK = `itms-apps://itunes.apple.com/app/${IOS_APP_ID}?action=write-review`;
const PLAY_STORE_LINK = `market://details?id=${ANDROID_APP_ID}`;

const STORE_LINK = Platform.select({
  ios: APP_STORE_LINK,
  android: PLAY_STORE_LINK,
});

export default {
  requestReview: () => Linking.openURL(STORE_LINK),
};

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
obladorcommented, Apr 19, 2018

@jnrepo no, this flag is only wheter the API itself is available.

0reactions
obladorcommented, Feb 22, 2021

Updated readme further and added example for button usage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When Is A Button Not A Button? - Smashing Magazine
No, but you can always start with a button for almost any element that can be clicked or interacted with in a similar...
Read more >
Using <a> instead of <button> - any instances where this is ...
Use an a tag when you want to navigate to a new page or an external resource i.e. links. Use a button tag...
Read more >
Stop Using Buttons as Links - YouTube
Despite what CSS would have you believe, buttons, spans, and anchors are not the same when it comes to understandable functionality.
Read more >
The Button element - HTML: HyperText Markup Language
The <button> HTML element is an interactive element activated by a user with a mouse, keyboard, finger, voice command, or other assistive ...
Read more >
When To Use The Button Element | CSS-Tricks
Button is a Form Element · Buttons can have content · Let's consider: “if a button doesn't have a meaningful href, it's a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found