Skip to content

Commit

Permalink
6.14.2
Browse files Browse the repository at this point in the history
  • Loading branch information
piano-analytics committed Jun 20, 2024
1 parent 098d4ed commit 221bcb5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## 6.14.2
### Fixes
- [react-native] Fixed android user-agent value to prevent default processing exclusion

## 6.14.1
### Fixes
- [browser] Fixed a bug when several `setProperty(ies)` and `sendEvent(s)` methods were chained without delays
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "piano-analytics-js",
"description": "JavaScript library for Piano Analytics",
"version": "6.14.1",
"version": "6.14.2",
"main": "dist/browserless/piano-analytics.cjs.js",
"module": "dist/browserless/piano-analytics.esm.js",
"browser": "dist/browser/piano-analytics.umd.js",
Expand Down Expand Up @@ -37,25 +37,25 @@
"test:node": "npm run rollup:node && node test/node.run.js"
},
"devDependencies": {
"@babel/core": "7.23.7",
"@babel/preset-env": "7.23.8",
"@babel/core": "7.24.7",
"@babel/preset-env": "7.24.7",
"@rollup/plugin-babel": "6.0.4",
"chai": "4.3.8",
"eslint": "8.56.0",
"eslint": "9.5.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-promise": "6.2.0",
"grunt": "1.6.1",
"grunt-contrib-concat": "^2.1.0",
"grunt-contrib-copy": "^1.0.0",
"karma": "6.4.2",
"karma": "6.4.3",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.2.0",
"karma-mocha": "2.0.1",
"load-grunt-tasks": "5.1.0",
"mocha": "10.2.0",
"puppeteer": "21.9.0",
"mocha": "10.4.0",
"puppeteer": "22.11.2",
"rollup": "2.79.1",
"rollup-plugin-eslint": "7.0.0",
"rollup-plugin-replace": "2.2.0",
Expand Down
6 changes: 5 additions & 1 deletion rollup.config-react-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ export default {
babel({babelHelpers: 'bundled'}),
process.env.NODE_ENV === 'production' && uglify()
],
external: ['react-native'],
output: [
{
file: 'dist/browserless/piano-analytics.react-native.umd.js',
format: 'umd',
name: 'pianoAnalytics'
name: 'pianoAnalytics',
globals: {
'react-native': 'reactNative',
}
}
]
};
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
],
'storageVisitor': 'pa_vid',
'storageUser': 'pa_user',
'version': '6.14.1',
'version': '6.14.2',
'minHeartbeat': 5,
'minBufferingHeartbeat': 1,
'queueVarName': '_paq',
Expand Down
13 changes: 10 additions & 3 deletions src/utils/request/http-react-native.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import {Platform} from 'react-native';
import Config from '../../config.js';

const http = {
post: function (url, data, callback) {
return fetch(url, {
const params = {
method: 'POST',
headers: {
'Content-Type': 'text/plain;charset=UTF-8'
'Content-Type': 'text/plain;charset=UTF-8',
},
body: data
})
};
if (Platform.OS === 'android') {
params.headers['User-Agent'] = `PA SDK React Native Android/${Config.version}`;
}
return fetch(url, params)
.then((data) => {
callback && callback(url, data);
})
Expand Down

0 comments on commit 221bcb5

Please sign in to comment.