An app can't load remote web content in the local context - windows-phone

I m trying to integrate Bing Maps V8 SDK in a Windows Phone JavaScript app.
I m following the current sample: http://www.bing.com/api/maps/sdk/mapcontrol/isdk#loadMapSync+HTML
In the HTML page, when it comes to <script type='text/javascript' src='http://www.bing.com/api/maps/mapcontrol'></script>, I get the following error at app runtime: An app can't load remote web content in the local context
I understand what it means but I can't download the JavaScript file locally because this file also refers to other js files, etc. The problem remains the same. For the same reason, I m also unable to make an XHR request.
Thanks

Here are examples of how to load the Bing Maps control into a mobile app.
https://code.msdn.microsoft.com/Cross-Platform-Bing-Maps-e96600d5#content
https://jkebeck.wordpress.com/2013/06/22/cross-platform-development-with-bing-maps-and-phonegap/
http://soulsolutions.com.au/bing-maps-on-iphone-with-phone-gapapache-cordova/
http://soulsolutions.com.au/showing-gps-position-on-bing-maps-with-phonegapapache-cordova/

Related

Google ClientID works for Google Sign-in platform library but not new GIS library

I'm trying to migrate my application from the older Google Sign-In platform library to the newer Google Identity Services library.
I have a client ID that works for the old method, but when I load the "Google Sign-in" button using GIS, I get 403 errors and an error log that GSI_Logger says my origin is not allowed for the client ID. I'm on localhost, but when I use the old method, there are no issues with localhost.
The only thing I can think of being different is that I load my Google client ID as a constant and rendered the button in the mounted() section of my Vue app's Login.vue, while previously I loaded it in main.js.
"Google One Tap can only be displayed in HTTPS domains".
So, it doesn't work because localhost is HTTP. I deployed to my testing environment which is HTTPS and got no such 403 errors.
Source: https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid

Can React Js application be hosted on S3 bucket

I thought we can only host Static websites onto S3 bucket.
How can React Js apps be hosted onto S3? React pages are dynamic in my understanding. The content of the page changes based on the user choices made on the page. Isn't that correct?
thank you
React pages are dynamic in my understanding.
Your definition of "dynamic" and S3's definition of "dynamic" are not the same thing.
Everything that's changing in the React application is happening in the browser. It's just the browser running JavaScript code. Nothing on S3 prevents a browser from running JavaScript code.
What they mean is that you can't have dynamic server-side content, such as a Node.js application or a PHP application.
The React application is served to the user by static HTML/JavaScript/CSS files.
React is a Single-page application (SPA) with browser -side rendering. A Single-page application (SPA) is a web application implementation that loads a web document and updates it by using JavaScript APIs in the browser. In simple terms, when a web application written in react works, the browser download the application files and run it using JavaScript on browser with the support of react libraries. Therfore the content in react app (min.js files and other assests in a production build) are not changing with time. A static storage and a public access(url) is the sufficiant to host a react application. So it can be host in a S3 bucket or github-pages or similar static storage without any computing power.
In a react webapp what's dynamic is the rendering of HTML elements using javascript. A dynamic web application refered by AWS is a one with dynamic server side rendering as Node.js. You can refer this guide to learn more on how to deploy a React application in Amazon S3.

opening an Instant App by a Firebase Dynamic Link with custom parameters (App Links)

I'm searching for a way to open an Android Instant app in a mobile browser.
The app supports app links (deep linking in http/https).
My Android app is working as an instant app and can be opened by an app link in different apps that are not browsers (Gmail, Whatsapp, etc.).
I have concluded that the only way to be able to have an instant experience in browser apps is by using Firebase Dynamic Links.
The only way it works is by using short Firebase Dynamic Links (without app parameters in the link). I need to be able to build the link manually with parameters, so the app will know it's desired actions.
In order to use Firebase Dynamic Links, I've:
set up all basic requirements in my app for Firebase Dynamic Links.
set up a sub-domain and enabled it in the Firebase console (the Hosting section).
created a long dynamic link manually (described as the only way to send parameters by link).
example:
https://sub.example.com/?link=https://example.com/some-path/file?param1=value1&param2=value2&apn=package.name.com
This long link works (in mobile browsers) only if the app is installed / is in cache.
If the app is not installed, the app's play store page opens and offers to install / try it (as instant app).
I've contacted Firebase support, and got a solution:
Adding the "afl" parameter in the link with the value of the app link.
Example:
https://sub.example.com/?link=https://example.com/some-path/file?param1=value1&param2=value2&apn=package.name.com**&afl=https://example.com/some-path/file?param1=value1&param2=value2**
The Android app links work properly if the user follows the following steps:
Verify that you are logged into Google, Chrome, and Google play with the account you plan to use for the instant apps.
Go into Google Play Store settings, find the tab for Instant Apps and Enable Instant Apps enable Instant Apps
In your website add html to index.html or the equivalent file where you want to place the embedded link such as this:
<!DOCTYPE html>
<html>
<body>
<h2>HTML Links</h2>
<p>HTML links are defined with the a tag:</p>
This is a link to the instant app </body>
</html>
The instant app linking will only work from links embedded within an app such as in gmail or Chrome and not from directly pasting the url in a browser navigation bar.
If you have any questions about this approach, please let me know.

JavaScript redirect in web context of HTML & JS store app

I'm having an issue with an which sits behind an enterprise authentication system. The app is an HTML5 web app which is loaded remotely through an iframe. This works fine, until the authentication system is integrated; this uses a javascript redirect which WinJS refuses to follow and logs an error APPHOST9624.
Is there a way around this?

iOS App & jQuery Mobile Site - Include JS file ONLY if page is viewed in native iPhone app

I have a mobile website built using jQuery Mobile. I am currently designing an iOS native app with a single webView to display this mobile website.
PROBLEM:
If the jQuery mobile webpage is viewed in a normal mobile browser, I want all to function normally. BUT if the webpage is viewed using the webView in the iPhone app (not Safari.app) I am designing, I want to include an additional line of code on the webpage to pull in some custom JS.
Here's what I want to be added to the page ONLY IF viewed inside of my iPhone app's webView:
<script type="text/javascript" src="http://www.example.com/mobile/js/custom-jqm-defaults.js"></script>
This code needs to be pulled in (according to the jQuery mobile docs) before jQuery Mobile is loaded. Is this possible? And if so, could you point me in the right direction and give me some code?
EDIT
I found this link whereby Facebook detects if they are being viewed WITHIN an app. Is there another way to do this obviously NOT using the FB API? Here is their code:
if (FB.UA.nativeApp()) {
// Hide your credits stuff
}
You can change the user agent in your NSURLRequest, and then check for that agent on your server.
Changing it app-side is easy.