ionicthemes / ionic-wordpress-integration

Ionic Wordpress starter app 😎. Learn how to communicate your ionic app with Wordpress REST API with this starter and detailed tutorial.
https://ionicthemes.com/tutorials/about/ionic-wordpress-integration
265 stars 126 forks source link

How do i add native sharing of post in the post.html #7

Closed sayseee closed 6 years ago

sayseee commented 6 years ago

I need to create a function for sharing a post via all sharing apps that are installed in the phone. The function should capture "post excerpt", "post title", "post image +url", "post url" e.g

shareItems() {
        excerpt: post.excerpt.rendered,
        title: post.title.rendered, // fi. for email
        image_url: post.images_url, // no idea how to get it
        url: post.link
      }

The reason i need it as a function is because i tried using the {{post.title.rendered}} in the html (click)="" and it had some errors.

djabif commented 6 years ago

For social sharing you can read this tutorial https://ionicthemes.com/tutorials/about/ionic2-app-with-socialsharing-and-deeplinking or if you are looking for a ready template with social sharing included you should check Ion2FullApp https://ionicthemes.com/product/ion2fullapp-full-ionic2-app-template-pro-version

sayseee commented 6 years ago

Thanks ... i got it working but it does not clean the html special characters e.g this.socialSharing.share(this.post.excerpt.rendered, this.post.title.rendered, this.post.images.large, this.post.link)

Shows

title shows: catering & Cleaning Services 
Excerpt shows:   <p>Some text[&hellip;]</p>

How do i remove those special characters.

djabif commented 6 years ago

Hi, did you manage to solve this?