Partage
  • Partager sur Facebook
  • Partager sur Twitter

IONIC 3 SOCIAL SHARING

    1 avril 2019 à 14:57:03

    bonjour à tous 

    j'ai cree monapplication mobile que permettra de publier mes articles qur les reseaux sociaux . 

    quand je le "run" sur android emilator " le boutons " share" ne fonctionne pas ? et pirtant aucun message d'erreur est affiché . 

    je ne sais pas pkoi . 

    1 -  j'ai cree un provider pour social sharing social.ts 

    je fait l'appel dans post.ts et j'implemente mes methodes : 

    [code]


    presentActionSheet() {
    const actionSheet = this.actionShettCtrl.create({
    buttons: [
    {
    text: "Share on Facebook",
    role: "destructive",
    cssClass: " action-facebook",
    icon: "logo-facebook",
    handler: () => {
    this.social.share(
    "com.facebook.katana",
    "Facebook",
    "facebook",
    this.message,
    this.subject,
    this.image,
    this.url
    );
    }
    },
    {
    text: "Share on Instagram",
    role: "destructive",
    cssClass: " action-instagram",
    icon: "logo-instagram",
    handler: () => {
    this.social.share(
    "com.instagram.android",
    "Instagram",
    "instagram",
    this.message,
    this.subject,
    this.image,
    this.url
    );
    }
    },
    {
    text: "Share on Twitter",
    role: "destructive",
    cssClass: " action-twitter",
    icon: "logo-twitter",
    handler: () => {
    this.social.share(
    "com.twitter.android",
    "Twitter",
    "twitter",
    this.message,
    this.subject,
    this.image,
    this.url
    );
    }
    },
    {
    text: "Share on other Social medias",
    role: "destructive",
    cssClass: " action-regular",
    icon: "share",
    handler: () => {
    this.social.share(
    "none",
    "Share",
    "none",
    this.message,
    this.subject,
    this.image,
    this.url
    );
    }
    }
    ]
    });
    actionSheet.present();
    }

    [code]

    ma page post.html 

    [code ] 

    ion-content padding>

    <ion-card *ngFor="let post of posts" (click)="onSelectPost(post)">
    <img src=/>
    <ion-card-content>
    <ion-card-title>
    {{post.title.rendered}}
    </ion-card-title>
    <p [innerHtml]="post.excerpt.rendered"></p>
    <!--Categories: {{post.categories}}-->
    Tags: {{post.tags}}
    <div class="icon"><ion-icon [name]="icon"></ion-icon></div>

    <div class="container">
    <button ion-button
    (click)="presentActionSheet()"
    round
    medium
    text-capitalize
    color="blue">Yes I want to share this</button>
    <br>
    <button ion-button
    (click)="navigateBack()"
    clear
    small
    text-capitalize
    color="danger">Go back</button>
    </div>
    </ion-card-content>
    </ion-card>

    </ion-content>

    [code ]

    j'ai telecharger le plugin necessaire et les importations sont bonnes normalemnt . pas d'erreur de compilation :) 

    merci je suis coincée depuis HIER :) 

    • Partager sur Facebook
    • Partager sur Twitter

    IONIC 3 SOCIAL SHARING

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown