[SalesForce] Can lightning:navigation be used in Communities

I am trying to implement a navigation mechanism for my community

So I am trying to implement the new lightning:navigation component.

This is my component – main:

MARKUP

<aura:component implements="forceCommunity:availableForAllPageTypes,flexipage:availableForAllPageTypes,force:appHostable,lightning:isUrlAddressable">
    <lightning:navigation aura:id="navService"/>
    <lightning:button variant="base" label="Open page" title="Click to open page with queryString attributes" onclick="{!c.handleClick}"/>
</aura:component>

CONTROLLER

({
    openPage: function(component, event, helper) {
        var pageReference = {
            type: 'standard__component',
            attributes: {
                'componentName': 'c__main'
            },
            state: {
                type: 'open',
                id: 'a1ZW0000001Pc95MAC'
            }
        };
        var navService = component.find("navService");
        navService.navigate(pageReference);
    }
})

When I add this component to lightning experience from the app builder, the navigation happens good and I get the url of the component + the 2 attributes of the queryString.

But when I add this component in my community – a click on the button does not do anything.

QUESTION

Is lightning:navigation supported in Salesforce Communities?

If it is – what am I doing wrong?

Best Answer

lightning:navigation is not supported in communities .Take a look at Summer18 release notes here that clearly mentions below

These resources aren’t supported in other containers, such as Lightning Components for Visualforce, Lightning Out, or Communities. This is true even if you access these containers inside Lightning Experience or the Salesforce mobile app.

Update:

With Recent releases it is now supported in lightning communities as well .