Social Sharing Keeps Asking to Select App


#1

I’m working on an app where the user needs to be able to take a picture, attach it to an email and open it in the email app. It will never need to be shared via any other app so I tried to use the shareViaEmail method on the social sharing plugin/module. The problem I’m having is the app should not ask the user to select the app each time they do it. After they select their email client the first time, it should just use that app from then on. Once I select GMAIL, the email shows up with the entire email set up correctly. But then I try it again and it asks me again. So why does it continuously ask for the user to specify the email each time?

Here’s the code:

          let message = `Here is the email about ${selectedName}`;
          this.socialSharing.shareViaEmail(
            message, 
            'REPORTING', 
            [ 'security@fakeemail.com'], 
            null, 
            null, 
            picurl
          ).catch((err) => {
            this.alerts.messageAlert('An email app could not be opened.  Is a default email app installed?');
          });

The one quirk to this question is I’m testing on the emulator (and it always asks for gmail or google drive) and I’m testing on a Samsung Galaxy S7 (where I can’t seem to set GMAIL to be the default email app). Did Android Oreo take away the ability to set a default email app? Does Samsung’s version of Android prevent you from selecting a default email app? Should this module even select the email app default?


#2

I also tried to switch to Email Composer and that also requires the user to select the app to open the email:

     let message = `Here is the email about ${selectedName}`;
     let _email: EmailComposerOptions = {
      to: 'security@fakeemail.com',
      subject: 'REPORTING',
      body: message,
      attachments: [
        picurl
      ],
      isHtml: true,
      app: 'mailto'
    };

    this.email.open(_email).catch((err) => {
      this.alerts.messageAlert('An email app could not be opened.  Is a default email app installed?');
    });

So either way I go, it’s making the user set the app each time. I was able to set up the default email (mailto: from Chrome opens GMAIL immediately). Any ideas?