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

Sharing to Gmail app sets body as subject #414

Closed
kennym opened this issue Dec 3, 2018 · 41 comments
Closed

Sharing to Gmail app sets body as subject #414

kennym opened this issue Dec 3, 2018 · 41 comments
Labels
bug help wanted os: ios stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@kennym
Copy link

kennym commented Dec 3, 2018

Steps to reproduce

  1. Call share dialog with title/subject set to test, and set body param to test body
  2. When opening with Gmail app, the subject line and body will be set to test body, effectively ignoring the subject/title params

Expected behaviour

Email subject set to 'test'

Actual behaviour

Email subject set to 'test body'

Environment

  • React Native version: 0.55.4
  • React Native platform + platform version: iOS 12.1.2

react-native-share

Version: 1.1.3

@jgcmarins jgcmarins added the bug label Dec 3, 2018
@SergeyNedayvoda
Copy link

SergeyNedayvoda commented Feb 17, 2019

+1

@rlemasquerier
Copy link

Same issue here, occurring on iOS only.

@nartjie101
Copy link

+1

@stale
Copy link

stale bot commented May 26, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open.

@stale stale bot added the stale There has been a lack of activity on this issue and it may be closed soon. label May 26, 2019
@kennym
Copy link
Author

kennym commented May 26, 2019

any comment?

@stale stale bot removed the stale There has been a lack of activity on this issue and it may be closed soon. label May 26, 2019
@MateusAndrade
Copy link
Collaborator

any comment?

You can give a try ate the latest version? I suspect this is something related on how the app handle params on both ios and android, when calling Share.

You can provide the sample code that you used in this test?

@zymr-viveksharma
Copy link

same issue facing. did any one got solution for this?
Any other alternative to handle share to all installed apps including gmail.

@kennym
Copy link
Author

kennym commented May 27, 2019

@MateusAndrade share anything on iOS with this library to the Gmail app... you'll see what we mean.

Basically using the same code you provide in the README.

@MateusAndrade
Copy link
Collaborator

@MateusAndrade share anything on iOS with this library to the Gmail app... you'll see what we mean.

Basically using the same code you provide in the README.

Im going to give a try with this today. Thanks for your feedback. 😄

@sitanshu-zymr
Copy link

Any ETA, To fixing this? Its a kind of eyecatcher thing.

@mikehardy
Copy link
Collaborator

As soon as you PR a change to the example that lets others test I'm guessing :-). Asking for ETAs in open source is like heading to the charity food center and asking why they aren't hurrying up with your free stuff right?

@sitanshu-zymr
Copy link

Ok I will try.

@dungkv-1044
Copy link

same issue :(
occurring on ios :(

@MateusAndrade
Copy link
Collaborator

same issue :(
occurring on ios :(

HI @dungkv-1044 recently we landed a PR that handle this. You can gave a look at this here: https://github.com/react-native-community/react-native-share#sharesingleoptions-in-ios--android

#557

@thisisablock
Copy link

with the latest master

on Android, everything is fine.
on iOS the target email address and subject is not filled.

const options = {
url: blob,
email: 'hello@world.com',
subject: 'Hellol',
type: 'application/pdf',
social: Share.Social.EMAIL
}

@MateusAndrade
Copy link
Collaborator

@thisisablock you can try pass a share_subjectto the options? This was implemented on #38

@thisisablock
Copy link

@MateusAndrade

made a retest on the latest master branch on iOS 13.1.1

const options = {
url: blob,
email: 'hello@world.com',
subject: 'Hellol',
type: 'application/pdf',
social: Share.Social.EMAIL
}

on iOS 13.1.1 Subject is now working.
But the email sender is still not working on iOS.
Android works as expected.

@leteach
Copy link

leteach commented Nov 11, 2019

I am having the same issue. Any word on a fix?

@nehaj2995
Copy link

target email not setting in android ,how do I fix this ?

@RadoAz
Copy link

RadoAz commented Jan 23, 2020

Hi! Any updates here? We have react-native-share 3.0.0 and bug is still here.

@MateusAndrade
Copy link
Collaborator

MateusAndrade commented Jan 23, 2020

Hi! Any updates here? We have react-native-share 3.0.0 and bug is still here.

Hi @RadoAz ? Which payload are you passing to Share and which platforms are you seeing this issue?

@RadoAz
Copy link

RadoAz commented Jan 23, 2020

Hi, @MateusAndrade! On iOS. PDF file
const options = {
message: 'message.',
type: type,
url: filePath
};

@Gazfay
Copy link

Gazfay commented Apr 1, 2020

Any updates? Still have this issue in 3.1.2.

@AlixBou
Copy link

AlixBou commented Apr 9, 2020

The issue is still present on 3.2.0

Code used :
Share.open({
message: 'message',
subject: 'subject',
});

Result on the native mailer of ios 12 :
image

Result on gmail :
image

@KisaneNeko
Copy link

Anyone had luck finding a workaround for this issue? Config proposed by @thisisablock did not change anything for me - subject is still replaced with message in gmail app

@jozan
Copy link

jozan commented Apr 23, 2020

I'm seeing this issue only on iOS and Gmail app. Gmail app seems to ignore type or filename on iOS. I suspect that sharing a file from filesystem could work but I haven't tested that.

Share.open({
  url: fileRef.current, // 'data:application/pdf;base64,<my pdf file data>'
  title: 'PDF-file',
  type: 'application/pdf',
  subject: 'PDF-file',
  filename: 'PDF-file.pdf',
})

This work for any other app I have tested on iOS. On Android this works with Gmail.

The file attached to the email is PDF-file. I can download it and add .pdf extension into it and it opens fine in macOS Preview.

@rezvalari
Copy link

Any workaround for this issue?

@MateusAndrade
Copy link
Collaborator

Any workaround for this issue?

The @jozan answer doesn't work for you?

@rezvalari
Copy link

@MateusAndrade I'm not sharing any file. Just texts and that doesn't look like a workaround. @jozan confirmed it is still problematic in Gmail.

@hieuhoit
Copy link

hieuhoit commented Jul 19, 2020

still present on 3.7.0 with Gmail, Yandex app

@sergiulucaci
Copy link

sergiulucaci commented Jul 21, 2020

hei guys, after a quick search I found a few issues related to this:

So it might be a gmail bug instead. Just try share an iOS note (from Notes app) via gmail. The entire body will be set as subject.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open

@github-actions github-actions bot added the stale There has been a lack of activity on this issue and it may be closed soon. label May 19, 2021
@d-patira
Copy link

d-patira commented Nov 18, 2021

Probably put a lot of empty space in front of the message, that will at-least clear off the subject field in iOS Gmail app.

For eg:

const space = `
`;

Share.open({
title: "your title here",
subject: "your subject here",
message: space+ 'your message here'
})

@Dror-Bar
Copy link

In regard to Gmail ignoring title / subject - this seems to be a bug with gmail app and not with this library. You can test this on your device - try to share a note and you will notice it has no subject (while sharing with apple email app has a subject).

@clemaccountable
Copy link

Any chance to re-open this issue? This bug is still happening

@mikehardy
Copy link
Collaborator

Is there some actionable task here and/or a desire to pursue it? Las comment is nearly a year ago and there's no action per last commenter. If you have information and desire to move this forward via presentation of your test results and/or a PR, sure?

@Jaseyacey
Copy link

Is there any progress here? Still an issue

@MorganTrudeau
Copy link

You can start your message with "\n" so the subject is blank. Let the user enter their own subject. Arguably better.

@HyopeR
Copy link

HyopeR commented Aug 23, 2023

I tried it for Android and Ios. This bug still persists for Ios.

1- On Android phones, gmail correctly takes the "Subject" field.
2- On IOS phones, gmail takes "Message" field instead of "Subject" field.

@dimaokk
Copy link

dimaokk commented Aug 24, 2023

same problem

@LaGregance
Copy link

Same problem, is there any news or workaround ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted os: ios stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests