Okgrow:analytics not working in Android build but everywhere else

Hi there,

I’m using okgrow:analytics with Segment and Intercom and it’s working fine in the browser, on iOS and even when I run my app during development on Android but when I build the app and install it on my phone neither Segment nor Intercom are working.

Some people seem to have the same issue here but but the suggested solution of adding access rules does not work for me (or the others with the same problem in that thread).

These are the access rules in my mobile-config.js

App.accessRule('http://js.intercomcdn.com');
App.accessRule('https://js.intercomcdn.com');
App.accessRule('https://api.segment.io/*');

This is my (reduced) settings.json

{
    "galaxy.meteor.com": {
        ...
    },
    "localhost": {
        ...
    },
    "public": {
        "analyticsSettings": {
            "Segment.io": {
                "apiKey": "<key>"
            },
            "Intercom": {
                "appId": "<id>",
                "activator": "#intercom-launcher"
            }
        }
    }
}

Did anyone else have a similar issue or does anyone have an idea what I could be missing?

Figured it out. I had to add the cordova-plugin-whitelist package and set the correct access rules. Using Android Studio >> Tools >> Android Device Monitor >> LogCat and filtering for “whitelist” I found all the urls that were still blocked. This is the relevant part of my mobile-config.js

App.accessRule('https://js.intercomcdn.com/*');
App.accessRule('https://static.intercomcdn.com/*');
App.accessRule('https://api-iam.intercom.io/*');
App.accessRule('https://widget.intercom.io/*');
App.accessRule('https://nexus-websocket-a.intercom.io/*');
App.accessRule('https://nexus-websocket-b.intercom.io/*');
App.accessRule('https://api.segment.io/*');
1 Like