intercom-rails: Intercom not working on localhost for logged-in users

I am not seeing the messenger icon appear and also see the following errors:

intercom.ce2651f4.js:7 POST https://api-ping.intercom.io/vjs/users/ping 403 (Forbidden)send @
intercom.ce2651f4.js:7le.extend.ajax @ 
intercom.ce2651f4.js:7e.exports @
 intercom.ce2651f4.js:15m.post @
 intercom.ce2651f4.js:15o.extend._post @
 intercom.ce2651f4.js:15o.extend.createOrUpdateUser @ 
intercom.ce2651f4.js:15i.createOrUpdateUser @ 
intercom.ce2651f4.js:15i.throttledCreateOrUpdateUser @ 
intercom.ce2651f4.js:15c.extend.createOrUpdateUser @
 intercom.ce2651f4.js:8c.extend.initialize @ 
intercom.ce2651f4.js:8(anonymous function) @ 
intercom.ce2651f4.js:4t @ 
intercom.ce2651f4.js:1i @ 
intercom.ce2651f4.js:4(anonymous function) @ 
intercom.ce2651f4.js:4t @ 
intercom.ce2651f4.js:1(anonymous function) @
 intercom.ce2651f4.js:1t @ 
intercom.ce2651f4.js:1(anonymous function) @ 
intercom.ce2651f4.js:1(anonymous function) @ 
intercom.ce2651f4.js:1

The messenger icon is appearing for visitors only.

Seems the issue is here:

rn && le.ajaxTransport(function(e) {
    if (!e.crossDomain || se.cors) {
        var t;
        return {
            send: function(n, i) {
                var o, r = e.xhr(), a = ++nn;
                if (r.open(e.type, e.url, e.async, e.username, e.password),
                e.xhrFields)
                    for (o in e.xhrFields)
                        r[o] = e.xhrFields[o];
                e.mimeType && r.overrideMimeType && r.overrideMimeType(e.mimeType),
                e.crossDomain || n["X-Requested-With"] || (n["X-Requested-With"] = "XMLHttpRequest");
                for (o in n)
                    void 0 !== n[o] && r.setRequestHeader(o, n[o] + "");
                >>>>>>>>>>>>>> r.send(e.hasContent && e.data || null ), <<<<<<<<<<<<<<<<
                t = function(n, o) {
                    var s, c, l;
                    if (t && (o || 4 === r.readyState))
                        if (delete on[a],
                        t = void 0,
                        r.onreadystatechange = le.noop,
                        o)
                            4 !== r.readyState && r.abort();
                        else {
                            l = {},
                            s = r.status,
                            "string" == typeof r.responseText && (l.text = r.responseText);
                            try {
                                c = r.statusText
                            } catch (m) {
                                c = ""
                            }
                            s || !e.isLocal || e.crossDomain ? 1223 === s && (s = 204) : s = l.text ? 200 : 404
                        }
                    l && i(s, c, l, r.getAllResponseHeaders())
                }
                ,
                e.async ? 4 === r.readyState ? setTimeout(t) : r.onreadystatechange = on[a] = t : t()
            },
            abort: function() {
                t && t(void 0, !0)
            }
        }
    }
})

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Hey. If you whitelisted some domains in the platform settings the widget won’t show up on localhost and on every other websites. To add some domains to the whitelisted apps you can just go in App Settings > Intercom Messenger section and add localhost:3000 in your whitelisted domains while you are testing Intercom locally.

image

It would be wise to delete it after as everybody using localhost:3000 will be able to load your intercom widget on their dev env. You can also use ngrok to prevent from this problem.

found this

Note that even after you’ve installed the code for logged-in users, the Intercom Messenger won’t appear for them until you’ve started a trial of Intercom Engage or Resolve.

here : https://app.intercom.io/a/apps/lea56gnc/guide/web_integration/web_integration_users#

I started a trial of Engage, and now it works fine even for logged in users.

I also encounter this: the widget disappear when logged in. My app is SPA with React. I didn’t (and haven’t) set up secure mode