-1

I have made a stackblitz project with the issue.

https://stackblitz.com/edit/ionic6-angular13-yngs1m?file=src/app/app.component.css

Whenever I try to use this plugin I get a rxjs error about incompatibility with Ionic Native. Ive tried installing it with --force and --legacy-peer-deps, and downgrading rxjs, which doesnt even work. Whatever I do, rxjs is always version 7.8.0.

To recreate this issue yourself in your own environment:

  1. Create a new blank Ionic project with Angular
  2. Install the @ionic-native/social-sharing@4 plugin with npm i @ionic-native/social-sharing@4.
  3. Import the plugin in your component with: import { SocialSharing } from '@ionic-native/social-sharing'.
  4. Instantiate SocialSharing in the constructor with: private socialSharing: SocialSharing

In my case, when I run the app I already get issues with rxjs.

  1. Add the following code to the ts in a method (in my case share() {}):

let options = { subject: "Subject", message: "Message" }

this.socialSharing.shareWithOptions(options);

Let me know if you know a way to fix this issue. My goal is to be able to share images using their local path. Clicking the share button will call the share() method and bring up the native share window for IOS and Android where users can select which platform they want to use to share the image

JDausyd
  • 17
  • 2

1 Answers1

3

@ionic-native is deprecated and was donated to the community. It’s now called @awesome-cordova-plugins, and versión 6 of it includes compatibility with latest rxjs.

Replace any @ionic-native/whatever package with its equivalent @awesome-cordova-plugins/whatever

jcesarmobile
  • 51,328
  • 11
  • 132
  • 176