Nikola Brežnjak blog - Tackling software development with a dose of humor
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Home
Daily Thoughts
Ionic
Stack Overflow
Books
About me
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Nikola Brežnjak blog - Tackling software development with a dose of humor
Breaking News, Ionic

Ionic 1.2 is out!

The team from Ionic announced their new 1.2 version today. This should get you very excited because the things these guys are making are truly praiseworthy.

As they say in the report:

  • it has over 100 bug fixes
  • uses native scrolling by default on all platforms (which means better responsiveness on Android especially)
  • new Slide box component (use the new <ion-slides> tag)
  • support for Windows 10 and Edge, which runs on the new Windows Phone 10 platform
  • if you want to build a mobile website, you’re fully and officially encouraged to do so (not just an app for the app store). As many of you know, this was not the case so far.
  • new <ion-input> tag
  • dropping support for the raw HTML and CSS versions of Radio and Checkbox, instead you’ll have to use directives <ion-radio> and <ion-checkbox>
  • better integration with Cordova plugins in terms of better console log error output
  • Ionic Native
  • …

You can read the full report on their blog post: http://blog.ionic.io/announcing-ionic-1-2/.

@ionicframework Awesome Ionic 1.2 is out! Mobile website mode supported! https://t.co/QsdhghpPdP pic.twitter.com/pvFpZVARvg

— Nikola Brežnjak (@HitmanHR) December 10, 2015

Ionic, Pluralsight

How to polish, create icons and splash screen images, add ads, share and test our calculator application

In my third tutorial about Ionic framework for Pluralsight, I’m going to show you how to:

  • polish,
  • create icons and splash screen images,
  • add ads,
  • share and test our calculator application

The post is live and you can access it for free here:  How to polish, create icons and splash screen images, add ads, share and test our calculator application.

Btw, if you’re wondering where is the main image from, it’s actually from a landing page of the published apps (we’ll show you how to do that for both Play Store and App Store in the next tutorial), and you can take a look at it here: SuperSimple Calculator.

This will be a series of posts which will teach you how to take advantage of your web development knowledge in building hybrid applications for iOS and Android.

The first tutorial, as you may remember, was all about how to get started with Ionic framework on Mac andWindows. The second tutorial was about how to create a calculator application with Ionic framework by using Ionic Creator for UI.

If you have any questions please don’t hesitate to ask, and please share if you like it.

How to polish, create #icons and #splash screen images, add #ads, share and test our #ionic #calculator application https://t.co/52k5f1G9CH

— Nikola Brežnjak (@HitmanHR) December 9, 2015

Ionic, Stack Overflow

How to deploy Ionic as a website?

profile for Nikola at Stack Overflow, Q&A for professional and enthusiast programmers
I’m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%). In this category (stackoverflow) of posts, I will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread here.

As you may know, I’m really into Ionic framework lately and am helping out on StackOverflow with the knowledge I gained so far with the framework. I’m in the top All time answerers list.

edit: As of version 1.2 Ionic is officially saying that you are free to deploy Ionic as a website.

I answered this question by user Ayush Chordia:

I have created an ionic app and want to deploy it as a website. What’s the best way to deploy it on a custom domain ? I was thinking of using azure web app to host the ionic app. All the documentation refers to use it as hybrid app for IOS and Android. But at this point we are only interested for it to function as a website.

In my answer I disagreed with this one:

As I stated in the comment to the only provided answer – I disagree.

If you’re not using any Cordova plugins then there is no problem (if you really wish to) to upload the contents of the www folder to your server, and woila – you’ll have the same app.

However, it is important to note that Ionic never intended for such a use, and the users of your “website” will have to have a newest browser in order to see the “website” correctly (not broken down due to some feature that Ionic is using in either CSS or HTML that some older browsers do not support).

You can see such example here: http://nikola-dev.com/IonicCalculator/mobile.html, and you can take a look at the tutorial with step by step on how to recreate the application. I literally took out the contents of the www folder and put it on the web server, and as you can see it works.

https://twitter.com/HitmanHR/status/674121400911863808

Books

UR – Stephen King

My notes from the book UR by the master Stephen King, which I marked as favorite and rated  5/5 on my Shelfari account.

Why don’t you just read from the computer, like the rest of us!?

Living well isn’t the best revenge; loving well is.

Can you keep a secret? Say no and I’ll have to kill you.

https://twitter.com/HitmanHR/status/673728553876389888

Ionic, Pluralsight

How to create a calculator application with Ionic framework by using Ionic Creator for UI

edit: the old link is not working anymore and all four posts have now been merged into one huge post: Ionic Framework: A definitive 10,000 word guide.

In my second tutorial about Ionic framework for Pluralsight, I’m going to show you how to create a calculator application with Ionic framework by using Ionic Creator for UI.

The post is live and you can access it for free here: How to create a calculator application with Ionic framework by using Ionic Creator for UI.

The first tutorial, as you may remember, was all about how to get started with Ionic framework on Mac andWindows. This will be a series of posts which will teach you how to take advantage of your web development knowledge in building hybrid applications for iOS and Android.

If you have any questions please don’t hesitate to ask, and please share if you like it.

How to create a #calculator application with #Ionic #framework by using Ionic #Creator for UI https://t.co/A7wCaKOunX

— Nikola Brežnjak (@HitmanHR) December 1, 2015

Ionic, Stack Overflow

ionic plugin add phonegap-plugin-push results in a 404 Not Found Error

profile for Nikola at Stack Overflow, Q&A for professional and enthusiast programmers
I’m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%). In this category (stackoverflow) of posts, I will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread here.

As you may know, I’m really into Ionic framework lately and am helping out on StackOverflow with the knowledge I gained so far with the framework. I’m in the top All time answerers list.

I actually asked this question myself:

I was following the official (and rather great) docs over at Ionic for how to get started with push notifications.

However, once the instructions said to install the phonegap-plugin-push plugin, I received the following error:

nikola@Nikolas-Mini ~/Desktop/ionicTesting/ionicPush
> ionic plugin add phonegap-plugin-push
Error: 404 Not Found: phonegap-plugin-push
at RegClient.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:304:14)
at Request._callback (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:246:65)
at Request.self.callback (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/request.js:236:22)
at Request.emit (events.js:110:17)
at Request.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/request.js:1142:14)
at Request.emit (events.js:129:20)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/request.js:1096:12)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)

Anyone has an idea of why? I tried with cordova instead ionic but I get the same error.

Also, I managed to find the answer myself:

After quite some searching I stumbled upon an official blog post, Cordova is moving their plugins to npm.

So, finally, I installed it easily now with npm:

npm install phonegap-plugin-push

https://twitter.com/HitmanHR/status/671596248764428289

Books

The art of being unmistakable – Srinivas Rao

My notes from (currently) free book The Art of Being Unmistakable: A Collection of Essays About Making a Dent in The Universe by Srinivas Rao, which I rated  4/5 on my Shelfari account.

What if you decided to be the one who creates for the joy of creating, nothing more?!

To experience something new, we have to let go of what’s old. We have to remain calm in the face of setbacks.

My greatest sin was to waste my life believing that I wasn’t capable of something more.

How long are you willing to act like a pro without any of the external rewards that come with it?

If you try to miomic, copy er emulate anybody else, at best you will be a pale imitation.

The only way to really stand out online is to be honest.

None of these things define you as a person: Your education The size of your bank account Your job title Your failures Your successes And sadly, we let so many of these things rule our lives. Obsession with crossing off the checkboxes of society’s life plan leads to little other than therapy, midlife crises, and depression.

Worrying about what other people think is a jail of our own creation, and the irony of it is those people are in the same jail with us.

The “No bullshit” version of who you are can work with a compass. Your ego needs a map because it does not quite understand the wise words of Paul Jarvis, “Nobody is successful because they took somebody else’s roadmap and copied it.

To become truly unmistakable I have to be willing to ditch the map, travel without a guidebook, and see where it leads me.

https://twitter.com/HitmanHR/status/671227308649353216

Ionic, Stack Overflow

Firebase $authWithOAuthRedirect doesn’t call $onAuth without page refresh

profile for Nikola at Stack Overflow, Q&A for professional and enthusiast programmers
I’m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%). In this category (stackoverflow) of posts, I will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread here.

As you may know, I’m really into Ionic framework lately and am helping out on StackOverflow with the knowledge I gained so far with the framework. I’m in the top All time answerers list.

I actually asked this question myself:

I have a simple Firebase Facebook OAuth login set like below by following the official tutorial for the Ionic Firebase Facebook login.

The problem is that once I click on the login with Facebook button, I get redirected to Facebook, I log in, and I get redirected back to my app. However, the problem is that I stay in the login page. Strange thing is that if I physically refresh my browser (testing with ionic serve) by pressing F5 the onAuth triggers and I get redirected to the Items page. If I don’t refresh the browser, onAuthdoesn’t get called.

Did someone have this issue? How did you solve it?

Please note that yes, I did my research (and am slightly starting to lose it), but can’t get it to work. I searched SO, tried with $timeout from google groups, tried to call $scope.$apply(), but all to no avail – so please help me figure out where I’m doing it wrong?

.controller('AppCtrl', function($scope, Items, Auth, $state, $ionicHistory) {
    $scope.login = function(provider) {
        Auth.$authWithOAuthRedirect(provider).then(function(authData) {

        }).catch(function(error) {
            if (error.code === "TRANSPORT_UNAVAILABLE") {
                Auth.$authWithOAuthPopup(provider).then(function(authData) {
                    
                });
            } else {
                console.log(error);
            }
        });
    };

    $scope.logout = function() {
        Auth.$unauth();
        $scope.authData = null;

        $window.location.reload(true);
    };

    Auth.$onAuth(function(authData) {
        if (authData === null) {
            console.log("Not logged in yet");
            $state.go('app.login');
        } else {
            console.log("Logged in as", authData.uid);
            
            $ionicHistory.nextViewOptions({
                disableBack: true
              });
            $state.go('app.items');
        }
        $scope.authData = authData; // This will display the user's name in our view
    });
})
<ion-view view-title="Members area">
    <ion-content padding="true">
        <div ng-if="!authData">
            <button class="button button-positive button-block" ng-click="login('facebook')">Log In with Facebook</button>  
        </div>       
        
        <div ng-if="authData.facebook">
            <div class="card">
                <div class="item item-text-wrap">Hello {{authData.facebook.displayName}}!</div>                
            </div>

            <button class="button button-assertive button-block" ng-click="logout()">Log out</button>
        </div>        

    </ion-content>
</ion-view>

edit: I sort of solved it by using $timeout:

$timeout(function(){
    Auth.$onAuth(function(authData) {
        if (authData === null) {
            console.log("Not logged in yet");
            $state.go('app.login');
        } else {
            console.log("Logged in as", authData.uid);

            $ionicHistory.nextViewOptions({
                disableBack: true
              });
            $state.go('app.items');
        }
        $scope.authData = authData; // This will display the user's name in our view
    });
}, 3000);

However, this just feels wrong (mildly put), and there has to be a better way, so please suggest one. Also, I noticed that the whopping 3second delay is barely enough (few of the resources I found suggested 500ms would be enough, but in my case, that’s not the case).

Answer, from user mhartington, was:

Posted on the github issues, but will reply here as well.

This only happens in the browser using $authWithOAuthRedirect. The example was intended for cordova apps, so this really shouldn’t be an issue.

But if you really need it, you could just skip the redirect and use a popup.

Auth.$authWithOAuthPopup(authMethod).then(function(authData) {
      console.dir(authData);
    });

https://twitter.com/HitmanHR/status/671222279121076224

Books

Free ebook: The Universe doesn’t give a flying fuck about you – Johnny Truant

My notes from (currently) free book The Universe Doesn’t Give a Flying Fuck About You (Epic series Book 1) by Johnny Truant, which I rated  4/5 on my Shelfari account. Actually, the whole series (4 books) is free currently, so you may wanna rush your download 😉

If you knew how small you are and how short a time you have to do what you can, you wouldn’t waste time watching five fucking hours of TV a day.

Stop being a pussy and go do something amazing!

It doesn’t matter what you’ve done. What matters is what you do.

It means that even though the universe doesn’t care enough to give you what you want, it doesn’t care enough to stop you from having it, either. So embrace that anarchy, and take those things for yourself.

Just do it. Claim it. Stop waiting for permission.

Fucking hell. Stop whining and just be it already. Be fucking awesome.

Your life is a one-way train, and any second you waste is a second lost forever.

There’s a drinking game in Heaven, where angels do a shot every time humans invest ‘for the long term.

I heard that God watches jewelry commercials and LOL’s when they say that diamonds are forever.

https://twitter.com/HitmanHR/status/671216342465437696

Ionic, Stack Overflow

Use navigator.geolocation or $cordovaGeolocation in Ionic

profile for Nikola at Stack Overflow, Q&A for professional and enthusiast programmers
I’m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%). In this category (stackoverflow) of posts, I will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread here.

As you may know, I’m really into Ionic framework lately and am helping out on StackOverflow with the knowledge I gained so far with the framework. I’m in the top All time answerers list.

I actually asked this question myself:

Since I basically can get the same info with both approaches, I’m wondering which is the preferred one and what are the advantages using one over the other?

Answer, from user Mudasser Ajaz, was:

$cordovaGeolocation is angular wrapper over plain javascript plugin, developed by ionic. Now question is why ngCordova was introduced,in simple words to deal it as plugin service as module and inject plugin wrapper as dependency to only particular controller or service.
On Pratical level, cordova developers were having issues with plugins on angular project. One simple issue was that $scope does not get updated sometimes in simple plugins callback.
Quoting from ionic blog post :

The services support promises to make it easier to deal with their asynchronous nature and ensure scope data is properly updated

https://twitter.com/HitmanHR/status/671057737669832705

Page 27 of 51« First...1020«26272829»304050...Last »

Recent posts

  • Discipline is also a talent
  • Play for the fun of it
  • The importance of failing
  • A fresh start
  • Perseverance

Categories

  • Android (3)
  • Books (114)
    • Programming (22)
  • CodeProject (35)
  • Daily Thoughts (77)
  • Go (3)
  • iOS (5)
  • JavaScript (127)
    • Angular (4)
    • Angular 2 (3)
    • Ionic (61)
    • Ionic2 (2)
    • Ionic3 (8)
    • MEAN (3)
    • NodeJS (27)
    • Phaser (1)
    • React (1)
    • Three.js (1)
    • Vue.js (2)
  • Leadership (1)
  • Meetups (8)
  • Miscellaneou$ (77)
    • Breaking News (8)
    • CodeSchool (2)
    • Hacker Games (3)
    • Pluralsight (7)
    • Projects (2)
    • Sublime Text (2)
  • PHP (6)
  • Quick tips (40)
  • Servers (8)
    • Heroku (1)
    • Linux (3)
  • Stack Overflow (81)
  • Unity3D (9)
  • Windows (8)
    • C# (2)
    • WPF (3)
  • Wordpress (2)

"There's no short-term solution for a long-term result." ~ Greg Plitt

"Everything around you that you call life was made up by people that were no smarter than you." ~ S. Jobs

"Hard work beats talent when talent doesn't work hard." ~ Tim Notke

© since 2016 - Nikola Brežnjak