Q: dApp : Web3.eth.getCoinbase(function(err, account) not displaying my connected rinkeby account from metamask I have a dApp that works on my local Ganache network but not on Rinkeby deployed on Heroku
I have this code in App.js :
// Load account data
    web3.eth.getCoinbase(function(err, account) {
      if (err === null) {
        App.account = account;
        $("#accountAddress").html("Your Account: " + account);
      }
    });

But it this is what i get : 
Your Account: null
here is the file : https://github.com/Louvivien/filmproductiondapp/blob/master/src/js/app.js
Do you know what i can do ? 

A: Metamask might not enable connection by default. 
Try this:
if(web3.currentProvider.enable){
    //For metamask
    web3.currentProvider.enable().then(function(acc){
        App.account = acc[0];
        $("#accountAddress").html("Your Account: " + App.account);
    });
} else{
    App.account = web3.eth.accounts[0];
    $("#accountAddress").html("Your Account: " + App.account);
}

Metamask will deprecate support for web3js in favour of ethereumProvider.
An alternative to the above using ethereumProvider:
if(window.ethereum){
    ethereum.enable().then(function(acc){
        App.account = acc[0];
        $("#accountAddress").html("Your Account: " + App.account);
    });
}

According to the MetaMask documentation, account object returned has been kept as a list for future extensions, although it only serves one account.
Another short way to get the selected address with MetaMask:
web3.currentProvider.selectedAddress


A: check the Settings of metamask extension.
Settings->Connections-> add 'Localhost'
Thats it. It worked for me
Hope this works.

A: I got hour to figure this out, and finally I got:
just add connection http://localhost:3000 in setting of metamsk


A: Metamask doesnt support web3.eth.getCoinbase() as it is a light client
https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#dizzy-all-async---think-of-metamask-as-a-light-client
web3.eth.getCoinbase() returns the account that your mining rewards go to.
web3.eth.getAccounts()[0] returns the first account you created (index 0)
Try:
var account = web3.eth.getAccounts()[0];

A: It seems like everything has been changed again. Now location of the menu, where you can connect MetaMask to your sale website is here:

