Posts

Showing posts from June, 2020

Testing IAP

iOS First, add In App Purchase in capability Make sure that your development profile bundle ID match with the production one that is IAP products Make sure you always run from xcworkspace file 

Installing flutter on MacOS

Download flutter stable from the flutter development website https://flutter.dev/ Create new folder in user document cd ~ mkdir development Then move the downloaded file to your development folder Go to your development from terminal cd development export PATH="$PATH:`pwd`/flutter/bin" Note : You need to be in your development folder and this only set temporary to your current terminal windows Updating the path permanently In your mac go to your user folder (Cmd + Shift + H from finder) Make sure you show your hidden files by pressing (Cmd + Shift + Dot) Open .bash_profile file to add the path permanently. If you don't have .bash_profile or .zpofile, create one Start up Terminal. Type "cd ~/" to go to your home folder. Type "touch .   bash_profile " to create your new file. Edit .   bash_profile   with your favorite editor (or you can just type "open -e .   bash_profile " to open it in TextEdit). Type "source...

Solving flutter web app CORS policy

If you're calling to another URL from your flutter app,  you need to manually allows the origin domains to avoid CORS policy for extra security. This is time consuming if you're setting up the policy on your production API server. So how do we solve it? We can solve it by two methods. 1- Allow your trusted domain from your development API server 2 - Run chrome with disable web security The second one is the easiest method so we'll start with the second method unless your app is already running on production server.  Run chrome with disable web security Right click on desktop, add new shortcut.  Add the target as "[PATH_TO_CHROME]\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp.  Click OK. Make sure you run the created shortcut with admin rights. Allow your trusted domain from your development API server

Common Errors

Flutter throws“ log reader stopped unexpectedly” It happens sometime when debugging on actual device. To Solove run flutter clean in terminal and build again

Flutter web blank screen

Are you having blank screen when launching flutter app on web? Try this one first since flutter web is only supported on beta channel flutter channel beta flutter upgrade If it still doesn't work, go to dev channel and try again flutter channel dev flutter upgrade After these flutter run -d web and go to the url provided in chrome

Debugging flutter apps

Install dev tools for flutter flutter pub global activate devtools Run dev tools flutter pub global run devtools and run your flutter app and go to 127.0.0.1:9100 and enter your url to start debugging https://flutter.dev/docs/development/tools/devtools/cli

Creating and publishing VSCode extension

Register new account at the marketplace https://marketplace.visualstudio.com/ Create a new publish and extension name there Building a new package Once you've done writing your extension, run vsce package in your terminal and you'll get vsix file Then just upload that file on the newly created extension on the marketplace. Updating the package Increase the version name in your extension project and then run vsce package Then just upload the updated extenion on the marketplace  Install VSCE extension npm install -g vsce If you're having script run is disabled on the system warnings x64  (64 bit) Open  C:\Windows\system32\cmd.exe Run the command  powershell Set-ExecutionPolicy RemoteSigned