varun aaruru
varun aaruru

Reputation: 2940

ionic3 plugin and platform errors

I am using ionic CLI version 3.0.0-beta.5

When I am trying to install native plugins, I am getting these errors. for example, installing social-sharing plugin

ionic plugin add cordova-plugin-x-socialsharing

and the error is

[ERROR] Unknown plugin: @ionic/cli-plugin-.

same error while adding platforms also..

C:\Users\varun\Desktop\apps\app>ionic platform add android
The platform command is no longer available. To find out more about the equivalent please run:

 ionic cordova:platform --help

C:\Users\varun\Desktop\apps\app>ionic cordova:platform --help
[ERROR] Unable to find command: cordova:platform. It is possible that you are trying to get help on a project based command and you are not in a project directory.

Has anyone faced this problem? I am not getting enough information on official blog.

Upvotes: 1

Views: 1449

Answers (2)

Andrei Drynov
Andrei Drynov

Reputation: 8592

To fix "The platform command is no longer available" issue on Ionic3 beta 7 I tried the following:

ionic cordova:platform add android

However, it only worked for newly started projects so need to update ionic-scripts in your project.

Upvotes: 1

Atul Sharma
Atul Sharma

Reputation: 10730

Use this instead

cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git

The repo name cordova-plugin-x-socialsharing is changed/missing

so, we can directly add plugin from plugin git repo.

shareWithOptions(option, successcallback, errorcallback);

Usage :

window.plugins.socialsharing.shareWithOptions( {
  message: 'share this',
  subject: 'the subject',
  files: ['', ''],
  url: 'https://www.gooogle.com',
  chooserTitle: 'Pick an app' 
  }, 
function(success){
  console.log(success);
  }, 
function(err){
 console.log(err);});

Upvotes: 0

Related Questions