How to Use ionic service with firebase

Hello all,

Please i need your help, am creating an ionic chat application with firebase. the problem is when ever i use this code to save data to ionic service

     Ionic.io();
             var user    = Ionic.User.current();
                if(user.id){
                    user.set('name', username);
                    //user.set('image',image_name);
                }
             user.save();

ALL I GET IS THIS ERROR

OPTIONS https://api.ionic.io/auth/users/null

XMLHttpRequest cannot load https://api.ionic.io/auth/users/null. Response for preflight has invalid HTTP status code 404

Ionic User: Error: CORS request rejected: https://api.ionic.io/auth/users/null(…)

and also i noticed this > https://api.ionic.io/auth/users/null please why is it null…

Please help me

hi, i want code for chat application if u have no problem please share with me