aws / aws-sdk-mobile-analytics-js

Amazon Mobile Analytics JavaScript SDK
Apache License 2.0
82 stars 38 forks source link

Documentation inconsistency: platform parameter in AMA.Client.Options #27

Open lmichelbacher opened 6 years ago

lmichelbacher commented 6 years ago

The documentation for this parameter is inconsistent with the code.

The documentation says the parameter is optional.

The code says

        if (options.platform === undefined) {
            this.logger.error('AMA.Client must be initialized with a platform');
        }

In addition, judging by data shown in the the AMA dashboard, it seems that some platform information is set automatically. For example, the total lifetime users widget is broken down by platform even when the client is initialized without an explicit platform value.

grahemAWS commented 6 years ago

Thank you for bringing this to our attention. You are correct in that Platform is required. Work is being done to resolve this.

lmichelbacher commented 6 years ago

The parameter is in fact optional but logging at error level suggests it isn't. A quick fix would be to reduce the level to info or warn and change the message so that it indicates that default platform detection is used.