Flarum is a new-age forum software and it has a brilliant mobile web app that works incredibly well on iOS/Android's chrome. It has lots of functionality such as swiping discussions, tapping on replies etc etc.
My goal is to load that same mobile web app from an Ionic hybrid app. The first thing I tried loading the mobile web app from an iFrame. This caused a lot of problems. Initially the page wouldn't even scroll, only after a couple session of serious google-fu was I able to get the scrolling to work, that too it was very choppy.
Then I started looking at ngCordova's InAppBrowser. The problem is I can't seem to get the same functionality as loading it from Chrome within iOS/Android. Scrolling works fine, but the other functionality is missing ie swiping of discussion and many other things.
Is this a limitation within Ionic/ngCordova, or is there something that I should look at ? I've looked at the documentation and followed the steps from here
Any tips, pointers, or sample apps would be greatly appreciated. Thanks !
tl;dr: I want to load a mobile website from Ionic ngCordova's InAppBrowser, but can get the same functionality as loading it from chrome/safari on a mobile device.
JS
window.open(‘http://example.com’, ‘_system’); //Loads in the system browser
window.open(‘http://example.com’, ‘_blank’); //Loads in the InAppBrowser
window.open(‘http://example.com’, ‘_blank’, ‘location=no’); //Loads in the InAppBrowser with no location bar
window.open(‘http://example.com’, ‘_self’); //Loads in the Cordova web view
HTML
<ion-view title="Test Page">
<ion-content>
<div class="list">
<a class="item" href="#" onclick="window.open('http://www.nraboy.com/contact', '_system', 'location=yes'); return false;">
Open a Browser
</a>
<a class="item" href="#" onclick="window.open('http://www.twitter.com/nraboy', '_system', 'location=yes'); return false;">
Open a Twitter Client or Browser
</a>
<a class="item" href="#" onclick="window.open('https://plus.google.com/+NicRaboy', '_system', 'location=yes'); return false;">
Open a Google+ Client or Browser
</a>
</div>
</ion-content>
</ion-view>
Source https://www.thepolyglotdeveloper.com/2014/07/launch-external-urls-ionicframework/
Related
I had to embed an external web page using an iframe, I found no issue and it is working fine for me.
<iframe src="<?php echo $uri; ?>" width="100%" height="100%" frameborder="0"></iframe>
However a user have informed that in iphones, the "src" url in iframe loads in browser (parent window without iframe) when accessed via iphone.
Can anyone please suggest a suitable solution. The target url is from an external domain .
Best Regards
Indunil
I'm having inconsistent results when using social media "widgets", more specifically the Facebook Like button. It is shown differently on different browsers.
I'm trying to use the "large" version of both widgets. Whereas Chromium can display the large and small versions of the twitter widget without any issues, a quite different facebook button shows up.
At a first glance, it doesn't seem to be a rendering issue, as apparently facebook is using different source assets for the widget -- notice the white "f" and the baloon counter.
What's causing this and how can I solve it?
Code
<span class="fb-like"
data-size="large"
data-href="http://www.google.com"
data-layout="button_count"
data-action="like"
data-show-faces="false"
data-share="false"></span>
<a href="https://twitter.com/share"
class="twitter-share-button"
data-size="large"
data-text="TEXT"
data-url="http://www.google.com"
data-via="username"
data-related="username"
data-lang="pt"
data-show-count="false"></a>
<br>
<span class="fb-like"
data-size="small"
data-href="http://www.google.com"
data-layout="button_count"
data-action="like"
data-show-faces="false"
data-share="false"></span>
<a href="https://twitter.com/share"
class="twitter-share-button"
data-size="small"
data-text="TEXT"
data-url="http://www.google.com"
data-via="username"
data-related="username"
data-lang="pt"
data-show-count="false"></a>
<script type='text/javascript' src='//platform.twitter.com/widgets.js?ver=4.6.1'></script>
<script type='text/javascript' src='//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.8'></script>
Result
Firefox (50.1.0 Linux):
Chromium (51.0.2704.103 Russian Fedora 64-bit):
They're not shown differently on different browsers, they're shown differently if the user is not logged in (you're probably logged in Chrome browser, that's why this happens).
For some reason, Facebook is now using different styles for its buttons when user is logged in or not. And the whole thing is around this input:
<input type="hidden" autocomplete="off" name="new_ui" value="true">
It's not a configurable feature, they just release things as they go. :)
Facebook has rolled out new updates for logged in users and not logged in users. That is why you are seeing different buttons. While changing that an be impossible, another thing that comes to my mind is explicitly changing the default values and overriding the CSS aka CSS Reset.
Default: https://developers.facebook.com/docs/plugins/share-button/
Also this:
Why jquery ui button looks different in Firefox and Chrome
Ok, so I've looked around a number of different websites but seem to get mixed information. Does anyone have any advice for implementing a Facebook Like button in an HTML email campaign?
I have already tried this article but for some reason, clicking the like opens a blank page with another like button. http://emailexpert.org/adding-a-facebook-like-button-to-your-email-template/
Any help would be appreciated.
Here is how you can add a Facebook Like button, Share Button, and Tweet Buttons. Please Note: Where it says my-campaign-url.com is the webpage of the email newsletter. Replace img src with your own image for the button. Also I am not sure you need everything in the Facebook button but you can clean it up with some testing =>
Facebook Like
<a title="Like this on Facebook" href="http://www.facebook.com/plugins/like.
php?href=http://my-campaign-url.com&layout=standard&show_faces=
false&width=450&action=like&colorscheme=light&height=427%20">
<img src="/Images/network_icons/fblike-button-small.png" style="border:
0 none;" alt="Like This on Facebook"></a>
Facebook Share
<a title="Share this on Facebook" href='http://www.facebook.com/share.php?u=http://my-campaign-url.com'><img src='/Images/network_icons/fb-share.png' alt='Share my campaign' /></a>
Tweet Button
<a title="Share Via Twitter" href="http://twitter.com/intent/tweet?
url=http://my-campaign-url&text=My%20Text%20-%20&via=My Name&">
<img src="/Images/network_icons/tweet-button-small.png"
style="border:0 none;" alt="Share Via Twitter"></a>
Another (possibly easier) option.
Use the AddThis Service for E-Mail Marketing. See AddThis site for more info. Example Code Follows:
<!-- AddThis Button BEGIN -->
<!-- Facebook -->
<a href="http://api.addthis.com/oexchange/0.8/forward/facebook/offer?pco=tbx32nj-1.0&url=http%3A%2F%2Fmy-site.com%2Fnewsletter&pubid=ra-[Your AddThis ID for Analytics]" target="_blank" ><img src="http://cache.addthiscdn.com/icons/v1/thumbs/32x32/facebook.png" border="0" alt="Facebook" /></a>
<!-- Twitter -->
<a href="http://api.addthis.com/oexchange/0.8/forward/twitter/offer?pco=tbx32nj-1.0&url=http%3A%2F%2Fmy-site.com%2Fnewsletter&pubid=ra-[Your AddThis ID for Analytics]" target="_blank" ><img src="http://cache.addthiscdn.com/icons/v1/thumbs/32x32/twitter.png" border="0" alt="Twitter" /></a>
<!-- Rest of AddThis Services-->
<a href="http://www.addthis.com/bookmark.php?source=tbx32nj-1.0&=250&pubid=ra-[Your AddThis ID for Analytics]&url=http%3A%2F%2Fmy-site.com%2Fnewsletter " target="_blank" ><img src="http://cache.addthiscdn.com/icons/v1/thumbs/32x32/more.png" border="0" alt="More..." /></a>
I had this problem also. But the answers above, and elsewhere, didn't help me too much.
It seemed like often the solution being offered was creating a way to allow people to like the EMAIL CAMPAIGN itself. That's definitely not what I want... I want it to make it so that people can click to like MY ORGANIZATION'S FACEBOOK PAGE.
Fortunately, I am a mailChimp user, and for those of you that use MailChimp, this is the article that explains it very easily: http://kb.mailchimp.com/article/how-can-i-add-a-become-a-fan-on-facebook-button-to-my-campaigns
this allows you to simply put a special tag and to specify the URL of your FB page... awesome. And it works. Sure, you do have to confirm with a second click, but that is OK.
I am trying to use AddThis button on a web page of mine, which you can share, like (facebook), and tweet (twitter) -
the AddThis code is pretty straight forward below,
<!-- AddThis Button BEGIN -->
<div id="share" class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a><!---->
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4cdb5be51dc49c98"></script>
<!-- AddThis Button END -->
but I don't understand - in the code above, where can I put the image or video url which I have uploaded and posted on my fb page? for instance the url below is the image from my facebook page that I want to track how many people like this picture through my website,
http://www.facebook.com/photo.php?fbid=10150115644909972&set=a.10150115644754972.329183.55239684971
I have read through the documentation on AddThis but it doesnt explain this at all!
http://www.addthis.com/help/client-api#configuration-sharing
It points me to this,
http://developers.facebook.com/docs/reference/plugins/like#
again, this is a Facebook plugin, no used within AddThis. If I am using the Like button from the Facebook API, then I cannot use the AddThis plugin above, can I?
furthermore, The Like button from Faebook API seems to work on the Facebook page, but not an individual picture or video I uploaded/ posted on my Facebook Page, for instance, I tried this on my localhost, the picture on my Facebook Page won't collect the number of likes even though I have clicked the Like button on my screen.
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://www.facebook.com/photo.php?fbid=10150115644909972&set=a.10150115644754972.329183.55239684971" layout="button_count" font="arial"></fb:like>
so my main doubt on the Like button itself - does it work on facebook only or does it apply to the individual picture/ video on my facebook page? I tried to find this answer from the facebook Like documentation but it doesn't explain anything about this.
it would be grateful if you have any idea. thanks!
Try this:
...
<div class="addthis_toolbox addthis_default_style"
expr:addthis:title='Photo'
expr:addthis:url='http://www.facebook.com/photo.php?fbid=10150115644909972&set=a.10150115644754972.329183.55239684971'>
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a><!---->
</div>
...
See also: http://www.addthis.com/help/widget-sharing#tagging
You might get an error with the add this way to display the Facebook Like Button and IIS7.0.
I had the problem yesterday and have posted a solution here.
Hope this helps,
Covo
An associate of mine maintains a facebook page for the company we work for.
The company wants a widget to put on their facebook to allow users to enter their email and subscribe to our newsletter.
The associate who does facebook is not a programer so he asked me to build something.
I made a small page that uses jquery and ajax to allow you to enter your email address and it sends it to our server using ajax so you never leave the page you are on.
We want to embed this page on facebook using an iframe.
First we just tried entering the iframe, which did not work,
then we found a tutorial and tried to embed the iframe the way it says like this:
<a onClick="outside_location.setInnerFBML(link_1);" style="cursor: pointer;">Let's see that iframe....</a>
<div id="outside_location"></div>
<fb:js-string var="link_1">
<fb:iframe height="500" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%; border:none" src="http://URL-TO-OUTSIDE-LOCATION"></fb:iframe>
</fb:js-string>
<script type="text/javascript" charset="utf-8">
var outside_location = document.getElementById('outside_location');
</script>
It seems like facebook is appending things to our variables so link_1 becomes something like a325461252_link_1
Then we get a JS error like this:
Uncaught reference error:
a325461252_link_1 not defined
But every once in a while it will work but 99% of the time we get this error.
I have never built anything for facebook before, I am not sure there is is some sort of facebook way of doing things.
Is there something I am doing wrong? I have done many google searches trying to find answers and everything I find varies from "facebook does not allow iframes" to "facebook recommends iframes" so I really don't know what to think.
Check to see that your application is setup as an FBML applicaiton and not an Iframe application. An iframe application will not expand fb:... tags by default. Also inspect the DOM (Chrome or Firebug) to see if the Dom is getting changed when you click the link, but the iframe just isn't visible.
I just tested the following and it worked:
<hr/>
<a onClick="outside_location.setInnerFBML(location_two);" style="cursor: pointer;">Other IFrame Location</a>
<div id="outside_location" width="540" height="270" >
<fb:iframe width="540" height="270" frameborder="1" src="http://www.yahoo.com" />
</div>
<fb:js-string var="location_two">
<fb:iframe width="540" height="270" frameborder='1' src='http://www.google.com' />
</fb:js-string>
<script type="text/javascript" charset="utf-8">
var outside_location = document.getElementById('outside_location');
</script>
If all you wanted to do is add an iFrame to your application canvas then you can simply use this line:
<fb:iframe width="720" height="570" frameborder="1" src="http://www.yahoo.com" />
Or just change your application from an FBML canvas application to an iFrame application and point your Canvas Callback and Connect URL to your current page or page's directory. If you aren't using Facebook's API or FBML elements then you may not need to be in an FBML application at all.
BTW: To programmatically add iframes in Facebook you can use JavaScript like so:
<script type="text/javascript">
var Iframe = document.createElement('iframe');
Iframe.setStyle('smartsize','true');
Iframe.setStyle('frameborder','yes');
Iframe.setStyle('scrolling','no');
Iframe.setStyle('include_fb_sig','true');
Iframe.setStyle('width','500px');
Iframe.setStyle('height','500px');
Iframe.setSrc("http://www.msn.com");
document.getRootElement().appendChild(Iframe);
</script>
Good Luck!