Embedding a Flex Google Map in a WordPress Page - apache-flex

I'm embedding a Flex app in a WordPress page using Matt Carpenter's great plugin. It's a map created using Google Maps' Flash API.
I'm getting an initialization failure. Is that because the API key is in the Flex app and
Google can't "see" it?
This is the error that I'm getting:
Initialization failed: please check
the API key, swf location, version and
network availability.
Or do I have something else going on? Any suggestions?

Generally, the API key can only be used on 1 domain. Try creating a new key that's specifically to be used for online files. Use the other key you already have for offline testing.
Lewis

Related

My single page website doesn't have API calls and url paramaters. Can I Implement Angular Universal with firebase hosting without using cloud function

I have an angular 9 application deployed in firebase. I am planning to implement Angular Universal SSR for SEO.
Could anyone please clarify my doubts regarding Angular 9 Universal + Firebase hosting.
(I am currently using Spark plan which does not includes cloud functions.)
Can I implement SSR without Firebase cloud functions ?
Also,
My website doesn't have API calls(other than Google Analythics on index.html), no database connectivity and no query string parameters. That means, my home page contents are always same**. In this case, can I use static server side rendering without cloud functions.
If this is possible, How to deploy the output to firebase ?
3.1, Will copy the dist folder contents to server works?
3.2 How to run SSR and non SSR version in my local?
Note: **My website is not static html page, I am providing some client side fuctionality using javascript/typescript code which does not have server calls.
Other than implementing Angular Universal, Is there any way to to achivbe SEO with Angular Apps?
This can be done via Angular pre rendering.
Prerendering does not requires cloud function or node support in server.
It is easy and Angular CLI version > 11 directly supports it.
Now Web crawlers can able to read the entire HTML content. Because the output of prerender is a rendered HTML file.
Steps
Install Angular Express Engine using the below command
ng add #nguniversal/express-engine --clientProject project-example
Run the below command
npm run prerender
Goto dist folder
Copy/deploy contents from the folder 'Browser' to server environment
Note that any code related to window, document, navigator will throw error and should be wrapped inside if condition like this.
if(isPlatformBrowser(this.platformId)){
// your code accessing window, document, navigator.
}

Check for PNR existence from JS in a web RedApp

We are creating a web RedApp from SabreRedWorkspace and we need to check for the existence of a valid PNR before adding some passive segments.
We need to do it from an Angular app, and we can't find ant doc or example about it. Everything talks about RestAPI or the new NativeAPI and we can't find anything about web RedApps
Any help? Someone could point us to any doc or example?
You can use Javascript API for that, using SrwApi3.retrievePnr("1.0.0") which is injected on the DOM for Web RedApps.
Please make sure to download the latest SDK from https://beta.developer.sabre.com/guides/travel-agency/sdks/sabre-red-360-resources, version 19.5, there where changes on this release exactly about "Get PNR" APIs.
For more documentation, you can check on the SDK documentation folder : [extracted dir]/red-app-sdk-3.0-19.5/documentation/htmls/get_pnr_(web_api).html, ob by navigating from index->New Sabre Red Workspace Developer Toolkit->Sabre Services 3.0, Get PNR (Web API)
Also theres sample code provided on SDK, look for the compressed project under samples folder : com.sabre.redapp.example.webkit-1.0.8-SNAPSHOT-v20190516-1622.zip

Google Drive API - Example code is not working

I want to use Google API to transfer SharePoint Documents to Google Drive using dot net. For that to happen I want to use this link Google Quick Start.
I have followed every little piece of information. It states in beginning "Complete the steps described in the rest of this page, and in about five minutes you'll have a simple Drive app that uploads a file to Google Drive" but it is not true.
I am trying to run this sample example since yesterday but failed.
// Register the authenticator and create the service
var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description, CLIENT_ID, CLIENT_SECRET);
var auth = new OAuth2Authenticator<NativeApplicationClient>(provider, GetAuthorization);
So it seems that this code example is outdated and Google APIs have been upgraded.
Here comes the warning
[Obsolete("GoogleAuthenticationServer is not supported any more and it's going to be removed in 1.7.0-beta. Consider using the new Google.Apis.Auth NuGet package which supports .NET 4, .NET for Windows Store apps, Windows Phone 7.5 and 8 and Portable Class Libraries as well")]
Another code
var service = new DriveService(new BaseClientService.Initializer()
{
Authenticator = auth
});
And the error
Cannot implicitly convert type 'Google.Apis.Authentication.OAuth2.DotNetOpenAuth.NativeApplicationClient' to 'Google.Apis.Http.IConfigurableHttpClientInitializer'. An explicit conversion exists (are you missing a cast?)
Then I was looking for [latest release samples] there I found the source files.
I was not able able to run the sample also.
Here I was successfully authenticated but then had error for redirect Uri
My Client_Secrets.JSON looks like, as you can see I have set default redirect Uri to http://localhost/.
{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"secret","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":email","redirect_uris":["http://localhost/"],"client_x509_cert_url":"aa#developer.gserviceaccount.com","client_id":"id","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","javascript_origins":["http://localhost:53404/"]}}
Now I can run this application but as mentioned getting error
Error: redirect_uri_mismatch
The redirect URI in the request: [[http://localhost:2430/authorize/]] did not match a registered redirect URI
I really don’t know from where this port number comes and from where this authorize comes. As you can see in my JSON, I have not set anything similar.
I am using VS 2010 SP1 Ultimate and Windows 7 home Basic.
I have tried to give complete information and my end goal is upload document in Google drive.
The tutorial you are following uses an older version of google.apis thats why you are seeing the not supported. Here are a couple of tutorials on how it works with the new version of the api.
http://daimto.com/google-oauth2-csharp/
http://daimto.com/google-drive-api-c/
Take a look in https://code.google.com/p/google-api-dotnet-client/source/browse/Tasks.ASP.NET.SimpleOAuth2/Default.aspx.cs?repo=samples. It's a Task API ASP.NET sample. As you can see you need to add several lines of code, but it works.
I downloaded the samples Eyal mentions and got that compiling before integrating with my own app. .Net needs to be 4 although it states it supports higher.
You have to set the redirect URI in the google developer console, not in your JSON. In your case, you would want to set it to http://localhost:2430/authorize/.

Update to twitter api 1.1 in flex mobile

I build an app with Flash Builder 4.6 which displays the timeline of a specified user. Since twitter updated their api to version 1.1 I just can't seem to get it to work. According to the dev. site i had to use https://api.twitter.com/1.1/statuses/user_timeline.json, with the parameters include_enties an screen_name.
When I test the operation it says:
{"errors":[{"message":"Bad Authentication data","code":215}]}
How do I get this to work with Flash Builder? I just want to display the timeline; not edit or post things on it.
Must I send some form of authentication from within my code (and if so, an example would be higly appreciated)? Or is it possible to take care of this from within the twitter app (on https://dev.twitter.com/apps/myapp)?
I recently wrote a little mini-lib that works with app-only authentication (which is what you need the read the timeline):
https://github.com/denisdanielyan/as3-Application-Only-Twitter
See Pin based authorization for Twitter.
For the authorization process itself see Authorizing request

How can we get google map api key for flex application?

How can we get google map api key for flex application?
I am using flex web application which display google maps, it is working fine in local host
but when i deploy in server,application gives error.
**
Initialization failed: please check the API key, swf location, version
and network availability.
**
How can i resolve this problem, plez suggest me.
Thanks in advance
First, understand that the Flash Maps API is deprecated, and could be turned off in less than 2 years. So if you're doing development on a project that is going to stick around, you should use the JavaScript Maps API.
If this is an existing application and you moved domain or for some reason the key isn't working, here are the directions to request a key:
https://developers.google.com/maps/documentation/flash/intro#API_Key

Resources