Skip to content

Share Method Multiple Dialogs #18153

Closed
Closed

Description

@sfm2222

I’m using react native share, to share text content. The issue is multiple share dialog are opened over each other on clicking share button multiple times. Even I have disabled button on share click but it is of no use as well.

Expected Behavior

The standard way is if share dialoge is already open, on clicking the share button again the window get closed. How can it be done?

Actual Behavior

Opening multiple share dialogs.

Environment

	"react-native": "0.50.3",

Steps to Reproduce


<Button 
 transparent
 disabled={this.state.isShareDisabled}
  onPress={() => that.onShare(index)}>

onShare() {
    if(!this.state.isShareDisabled)
    {
    this.setState(
        {
            isShareDisabled:true
        }
    )
    Share.share({
      message: “Message test”,
      url: ”www.google.com”,
      title: “Title test”
    }, {
      // Android only:
      dialogTitle: 'Share',
      // iOS only:
      excludedActivityTypes: [
        'com.apple.UIKit.activity.PostToTwitter'
      ]
    }) .then((result) => {
        this.setState(
            {
                isShareDisabled: false,
            }
        )
    })
}
  }

Activity

  1. added
    Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.
    on Mar 1, 2018
  2. sfm2222 commented on Mar 1, 2018

    @sfm2222
    Author

    @kelset I have already asked on this question stackoverflow. I have received no answer.

    Can you tell how to check if share dialog is already open or not.

    https://stackoverflow.com/questions/49046409/react-native-share-method-multiple-windows

  3. hramos commented on Mar 1, 2018

    @hramos
    Contributor

    It looks like your Stack Overflow question was posted six hours ago. It usually takes a bit longer to see an answer there. In any case, lack of answers in Stack Overflow is not a good enough reason to post the question here. I'm going to close the issue as we'd like to focus on bug reports. I hope you understand.

  4. sfm2222 commented on Mar 2, 2018

    @sfm2222
    Author

    @hramos thank you, yes I get your point but I think It is possibly a feature request because I cannot find cancel event for share in the documentation anywhere.

    I have found another similar question with a slightly different issue asked on stackoverflow. This is asked 9 months ago and there is no answer to it as well.

    https://stackoverflow.com/questions/44095828/react-native-share-method-cancel-event

  5. locked as resolved and limited conversation to collaborators on Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions