preflight response issue with ionic3 app on ios build only [ resolved ]

Problem

I was running with the same problem, My ionic 3 app with ASP.net backend was working just fine, it was not working with IOS ( Iphone x – IoS 11 simulator ). I got some errors like the following.

[Error] failed to load resource: Preflight response is not successful.

[Error] Failed to load resource: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.

I’m not seeing this issue from the Android version of the application. Is there a setting or something that can be enabled within the Ionic app to fix the CORS issue?

Solution/Workaround

Workaround only – Not a perfect solution

I changed the `web view` option of my ionic app.
WKWebView ===> UIWebView

First, open config.xml and add the following properties

<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

then run the following commands – I hope you are familiar with this commands

ionic cordova plugin remove cordova cordova-plugin-ionic-webview --save
rm -rf platforms/
rm -rf plugins/
ionic cordova build ios

 



Note:

In iOS, there have been two webviews for a few years now, UIWebView and WKWebView. Historically, Ionic apps have used UIWebView, but no longer. Ionic now uses WKWebview by default when building for iOS.

We strongly believe WKWebview is the best option for any app, as it features many improvements over the older, legacy webview (UIWebView). These features include:

  • JIT conversion of JS code down to machine code, which runs much faster
  • Improved rendering performance
  • Less memory consumption
  • Better adherence to web standards
  • Reliable scroll events (important for virtual-list)

We wanted to make sure that people could easily switch to WKWebView without many issues, but there are still some things that you’ll need to consider.

Reference : Ionic wkwebview

Firestore

Google Cloud Firestore is database service from google and is has very similar features like firebase realtime data base. It is a NoSQL database like MongoDB and it will sync the data with all connected applications automatically in real time.

It has some cool properties like multi regional data replication, multi document transaction and much more..

Key features of Cloud Firestore include:

  • Documents and collections with powerful querying
  • iOS, Android, and Web SDKs with offline data access
  • Real-time data synchronization
  • Automatic, multi-region data replication with strong consistency
  • Node, Python, Go, and Java server SDKs

Right now it is available for the developers in BETA mode, however google may release the stable version with in few months.

What is the difference between Firebase Realtime Database and FireStore ?

Firebase realtime db does not offer the actual NoSQL database however can be store data like a tree structure.

This is a best tutorial for some one who would like to get started with Google Cloud Firestore SDK.

technical content writers

Looking for content editor who have the ability to handle technical articles. I am looking for writers who can write/edit content that developers can understand. Typical topics will be around web development, android app development, Programming Languages, IoT etc.

Qualifications :-

Graduation with good score in English.

We will consider anyone who have good skill in English and Technical Knowledge

Payment :-

Content Editing work : Rs. 30 / 500 Words [ Check the grammar mistakes ]
Content Writing work : Rs. 70 / 600 Words [ Write new article based on the topic ]

Payment threshold : Rs. 300/-
Mail your updated resume to angularguru@gmail.com

android feature graphic generator

Android Feature Graphic Generator

The Android Feature Graphic Generator allows developers to create a simple attractive feature graphic for your Android application which you are going to publish in google play store. This tool will generate a PNG image based on the Google’s guidelines for the Feature Graphic .

NEW!!! Support for the Promo Graphic and TV Banner sizes.

“Beginning August 31, 2014, you are required to submit a Feature Graphic to update your app or Store Listing.”Read more…

Freelance job notification extension for google chrome

This Extension brings new freelance project notifications to Chrome - You'll never miss any project from most popular websites ( Currently We supporting Guru.com only).
You will get notification from more other websites by upcoming updates of this extension.

On this extension, You won't need to enter your username or password into the extension itself, so your freelance account details are completely secure.

Features:
 - You can Enable Or Disable Job notifications
 - You can filter the job notification by popular categories
 - preview jobs in extension

Supported Websites:
- www.guru.com


Download the extension 

How to find chrome extension location in our computer ?

If you are trying to develop a chrome extension, probably you will try to use existing code of the installed extension in your chrome browser. But how to find the location of the source code ?

Use the following steps to find the chrome extension directory.

  1. Open your chrome browser and type this url  chrome://version/ then hit the enter key
  2. Now it will show you a screen like given below
    chrome-extension-directory-location
  3. In this screen you see label ‘Profile Path’ , it will be your active chrome profile extension directory.

Extensions, Apps, Themes are located in the same directory.

Difference between single-quoted and double-quoted strings in PHP

Single quotes :

  1. Single quote is little bit faster than double quote because they do not need to be parsed and also use less memory
  2. Everything inside a single quote will be treated as plain string in php.
  3. This method is used when we want the string to be written exactly as it is.
  4. We can’t use variables inside singe quotes. If we use variables inside single quotes then it will output as it is variable name
  5. When  string is specified in single quotes PHP will not evaluate it or  interpret escape characters except single quote with backslash (‘) and  backslash(\) which has to be escaped.

$age = 10;

echo 'Hello \n  \'sample\' my age is $age';

// Hello \n 'sample' my age is $age

Copy and Try this code here

Double quote:

  1. It will display a host of escaped characters (including some regexes), and  variables in the strings will be evaluated.
  2. An important point here is  that you can use curly braces to isolate the name of the variable you want evaluated.
  3. For example let’s say you have the variable $type and you what to echo “The $types are” That will look for the variable $types. To get around this use echo “The {$type}s are” You can put the left brace before or after the dollar sign. Take a look at string parsing to see how to use array variables and such.
  4. Use double quotes in PHP to avoid having to use the period to separate code in string.

$count = 1;
echo " \n The count is $count";
//Output: The count is 1

Copy and Try this code here