Embed Yammer into Ionic/Cordova Hybrid app - html

Just wondering if anyone had done this before, i have used the code that yammer provide in order to embed a certain group or page into an application, here is my class file below:
<ion-view view-title="Feed">
<ion-content>
<body>
<div id="embedded-feed" style="height:200px;width:100px;"></div>
<script type="text/javascript" src="https://assets.yammer.com/assets/platform_embed.js"></script>
<script type="text/javascript"> yam.connect.embedFeed({
container: "#embedded-feed",
network: "MyGroup.com",
feedType: "group",
feedId: "111111"});
</script>
</body>
</ion-content>
</ion-view>
when i run the page in a browser it shows fine, yet nothing shows when ran on an ios simulator.
Any help is appriciated,
thanks.

You probably need to add https://assets.yammer.com (or maybe even *.yammer.com) to the whitelisted urls in the cordova container, otherwise all communications will be blocked.

yammer embedded-feed is not possible in cordova hybrid app. Use REST APIs to get the message/ feed .

Related

How to use Panorama with Forge Viewer v6

Based on https://forge.autodesk.com/blog/iphone-panorama-forge-viewer example, I am able to use panorama on my iphone. However, when I tried to implement this extension using Forge Viewer v6, it does not work.
How do I implement this feature in v6?
Due to some changes between the versions, the process of overriding the Gamepad behavior is now a little different:
In your HTML, include a <script> tag with the FirstPerson extension, and follow it by another <script> tag with the deviceOrientationExt extension:
<head>
...
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/viewer3D.min.js?v=v6.0"></script>
...
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/extensions/FirstPerson/FirstPerson.js?v=v6.0"></script>
<script src="https://raw.githubusercontent.com/wallabyway/deviceOrientationExt/master/docs/deviceOrientationExt.js"></script>
</head>
And in your JavaScript code, activate the first person tool after loading the FirstPerson extension:
viewer.loadExtension('Autodesk.FirstPerson').then(function() {
viewer.toolController.activateTool('firstperson');
});

How can I add a working iframe in a phonegap android app?

I have a phonegap project and I have /assets/www/index.html. In the index.html file, I have an iframe. I preview the app and the iframe works but when I export the app as an apk the iframe is blank. Can anyone help me or tell me why this happens ? Thanks
If you want to use iFrames in cordova make sure you white list the domain by adding
<allow-navigation href="urls which you navigate to" /> to your config.xml
and
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; frame-src 'self' https://iframe url">
to your .html file where you are using iframe.
Or you can use jQuery onload for any div like Racil said
<div id="divid"></div>
<script>
$( "#divid" ).load( "url to load" );
</script>
Source
jquery
iframe can be very tricky in mobile apps and different platforms. Maybe it can be done in another way? You can inject those pages directly into a div using jQuery ('selector').load('url') method. Here is an example that loads twitter page into a div:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="MyLittleBrowser" style="width: 200px; height: 200px; border: 1px solid #000; overflow: scroll;"></div>
<script>
$("#MyLittleBrowser").load("https://crossorigin.me/https://www.twitter.com/");
</script>
Make sure you whitelist all the websites that you will be loading. With the new phonegap versions >= 5, you need the whitelist plugin which has the new syntax for that purpose. If you want to use the old syntax, you can use the legacy plugin. For example, to run my code above, you need to add this to your config.xml:
<plugin name="cordova-plugin-legacy-whitelist" spec="1.1.1" />
<access origin="https://crossorigin.me" />
Note: I used the https://crossorigin.me service in my example because otherwise twitter would give me a CORS error because it's a different domain than SO and it doesn't allow CORS. In your project, you don't need to use this service as long as the page your loading allows CORS access. If the page is yours, remember to allow CORS by adding this header to your page:
header("Access-Control-Allow-Origin: *"); //PHP
Response.AddHeader("Access-Control-Allow-Origin", "*"); //C#

404 file not found on believed correct path?

I have a simple Angular application that I am bundling with Gulp. The index.html has a script reference of:
<script src="./../../js/all.js" charset="utf-8"></script>
and a file structure:
Does this not seem accurately relative?
I am also serving from the public/html/layout/index.html
try
<script src="../../js/all.js" charset="utf-8"></script>
The resolution involved a best practice of placing the index.html at a higher level directory. Still didn't explain why the issue occurred, but the issue is no longer affecting me.
If you are using Google Chrome then you can open your index.html in the browser and goto View Source.
Find this line in the source: <script src="./../../js/all.js" charset="utf-8"></script>
and click the hyperlink of the file. It will then show you the complete address of the javascript file the browser is trying to load. Once you get the complete address I believe you can fix this issue easily.

Mobile links in an Iframe and IOS

I was trying today to open a mobile link from one of my webapp that runs in an iframe (same domain).
It looks like these links aren't recognized by apple ?
https://plnkr.co/edit/9Rp87NcVi9Kr4MGDgIwL?p=preview
Body file
<html>
<body>
1-888-888-1212
<iframe src="iframe.html"></iframe>
</body>
</html>
iframe.html
<body>
1-877-877-2323
</body>
In the following plunkr i made a little example of that.
My Local computer can recognize those links, both, and so does my multiple android devices. Although when it comes to IOS, nothing to be done about it, it will only work for the link that is not in an Iframe.
Anybody had a simillar problem and or knows a solution to this issue ?
By using a script to select the parent document from the iframe, it should work. try this:
edit Adding "target="_parent" to the anchor is the solution for those viewing this answer.
Dated answer:
<iframe id="test" src="iframe.html"></iframe>
<script>
var iframe = document.getElementById("test");
var iDoc = iframe.contentDocument;
iDoc.write('<a target="_parent" href="tel://1-888-888-1212">1-888-888-1212</a>');
</script>

ReferenceError: google is not defined

I use google map's api in my website to show couple of locations. Google Maps is working just fine in my local solution but not in my website. I changed this source
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.5&sensor=false"> </script>
to this one. and i again changed this
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"> </script>
with this one...
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"> </script>
Only thing it says: ReferenceError: google is not defined
Does anyone familiar with such problem?
Owing to the fact that my website uses https for the connection, I can not use http://maps.google.com/maps/api/js?sensor=false. When I debug the whole page, this link says: Warning : The page index.html ran insecure content. so I made another search on google and came across to this question. so what basically causes a problem is not using https link in the source part so the correct link will be (for me)
https://maps.google.com/maps/api/js?sensor=false
now everything works just fine!
That's an old URL. If you look at the examples from the documentation, almost all of them use:
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
To me, with the new Google Maps API, simply this solution worked:
Just omit "async defer" from the script provided by goolge:
<script async defer src="https://maps.googleapis.com/maps/api/js?key={your_key}"></script>
TO
<script src="https://maps.googleapis.com/maps/api/js?key={your_key}"></script>
i met this problem in the rails application.
request to googlemap was from http and https pages
and it solved:
= javascript_include_tag "//maps.google.com/maps/api/js?sensor=false"
if protocol not defined rails inserts automatic