Ionic v3 Social Sharing Plugin - ionic-framework

Im working on adding social sharing to an Ionic app. I would like to data coming from my CMS to populate the data needed for the Social Sharing Plugin but I cannot get the syntax right. Can anyone see what I am doing wrong?
<ion-content class="home">
<button default (click)="share('{{post.name}}', '{{post.desk}}', null, '{{post.url}}')">Share</button>
<button default (click)="shareViaTwitter('{{post.name}}', null, '{{post.url}}')">Share on Twitter</button>
</ion-content>

Related

ionic app not loading updated html when using iframe

I have an html page in ionic that loads another html file from S3 using iframe. my ionic html looks like this:
<ion-view view-title={{header1}}>
<div class="item item-divider item-{{colorTheme}}">Privacy policy</div>
<ion-content class="padding has-header">
<iframe ng-src="http://backoffice.taralets.com.ph.s3-website-ap-northeast-1.amazonaws.com/partials/partial-privacyPolicy.html"
style="height:100%; width:100%;overflow:hidden;"
height="100%"
width="100%"></iframe>
</ion-content>
</ion-view>
After my initial testing, the html file from S3 is being displayed correctly. Here is the html file in S3:
<div class="text-left">
<h2>Privacy Policy</h2>
<p>Apps Privacy Policy</p>
</div>
The problem that I am having is that when I change the content of the html file in s3 - say change "Apps Privacy Policy" to "This is a Privacy Policy", the display in my ionic app is still showing the original content "Apps Privacy Policy". I am debugging this in the browser using ionic serve. Even if I clear the Application site data when doing "inspect" in chrome, the problem still exists. Is there a cache somewhere that's causing this problem? Note that if I try to access the page from our website, it is reflecting the updated content.
Use the below code for disabling cache for the specific page
<ion-view cache-view="false">
you can disable caching globally by using
$ionicConfigProvider.views.maxCache(0);
in your configurations

Facebook Register Plugin not showing up?

I am trying to implement Facebook Register Plugin on my website for landing pages.
I am following this guide:
https://developers.facebook.com/docs/plugins/registration/v2.0
I've written following code:
<div id="registration">
<iframe src="https://www.facebook.com/plugins/registration?client_id=660604224016242&redirect_uri=http://automaton.in/store_user_data.php?&fields=[{"name":"name"},{"name":"email"},{"name":"password"},{"name":"gender"},{"name":"birthday"}]">
</iframe>
</div>
But nothing is showing up instead of a box with border.
I've also created my facebook app with app-id 660604224016242.
Also, I am running my site locally without a local server! Do I need to run this on a server?
Please help me, I really need to implement this plugin!

Reducing social media requests

I got about 30 requests from the various social media widgets.
Is there a way to reduce the number of requests?
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone_badge" g:plusone:size="small"></a>
<a class="addthis_counter addthis_pill_style"></a>
http://s7.addthis.com/js/300/addthis_widget.js%23pubid=xa-5284e3896308a336
Are you using a wordpress website?
If yes you can use an lazy load social buttons plugin to reduce requests, if not, you can dig in a plugin's code like these and check the code to do the same for your website.

Load Adsense in Durandal

I'm using Durandal to make a Single-Page Application. Is there a way to add Adsense code into the view/model?
I'm currently using iframe's to add the ads into the views. My concern is that this could violate Google's terms and conditions.
You could bind the script using Knockout, but have you tried using Durandal's Composition to include an HTML page?
Example:
<div>
<div data-bind="compose: 'views/adsense.html'"></div>
</div>
Inspired from docs here: http://durandaljs.com/documentation/Using-Composition/

jQTouch Phonegap problems

I am using jQTouch and Phonegap and it perfectly runs in my Xcode and iPhone simulator. What I am trying to develop is to dynamically display external webpages within my application.
For example, when you first run the application it shows table with data "User Interface", "Animations" ... etc. What I want to make is when user taps on "User Interface" it should display some external web pages ( lets say google's home page).
I wrote the following code and this is inside User Interface->Edge to Edge->(here I want to dispaly the home page of google). The width:340 and height:420 will be the display area of google's home page. Please help me to make it.
<div id="edge">
<div class="toolbar">
<h1>Edge to Edge</h1>
back
</div>
<div style="width:340px; height:420px; background:red;">
<ul class="edgetoedge scroll">
<li class="sep">under construction...</li>
</ul>
</div>
</div>
Thank you
You will need to load an <iframe> into the div you want to display the content of the external page.
http://www.w3schools.com/tags/tag_iframe.asp
Make sure to add the external URL to the whitelist (ExternalHosts entry in PhoneGap.plist as per the PhoneGap for iOS FAQ: http://wiki.phonegap.com/w/page/41631150/PhoneGap%20for%20iOS%20FAQ) and set the Boolean for OpenAllWhitelistURLsInWebView to YES.