react-native-mparticle 2.4.13 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,73 @@
1
+ name: Release SDK
2
+
3
+ on:
4
+ workflow_dispatch
5
+ jobs:
6
+ # SDK release is done from public/master branch.
7
+ confirm-master-branch:
8
+ name: Confirm release is run on public/master branch
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Git checkout
12
+ uses: actions/checkout@v1
13
+ - name: Branch name
14
+ run: |
15
+ BRANCHNAME=${GITHUB_REF##*/}
16
+ echo "pulling branch name, branch name is:"
17
+ echo $BRANCHNAME
18
+ if [ $BRANCHNAME != "master" ]
19
+ then
20
+ echo "You can only run a release from the master branch, you are trying to run it from ${BRANCHNAME}"
21
+ exit 1
22
+ fi
23
+
24
+ # All new code is stored in internal/development. Release from public/master will merge changes from internal/development into
25
+ # public/master, then run semantic-release on public/master to update changelog and release notes. Before semantic-release publishes
26
+ # to npm, it builds the dist/ folder. Finally, commits from public/master are synced back to internal/master and internal/development.
27
+
28
+ react-tests:
29
+ name: Run React Native Unit Tests
30
+ runs-on: ubuntu-18.04
31
+ needs: ['confirm-master-branch']
32
+ steps:
33
+ - name: Checkout
34
+ uses: actions/checkout@v2
35
+ - uses: actions/setup-node@master
36
+ - uses: c-hive/gha-yarn-cache@v1
37
+
38
+ - name: Install node modules
39
+ run: yarn install
40
+
41
+ - name: Run test
42
+ run: yarn test
43
+
44
+ android-unit-tests:
45
+ name: Run Android Unit Tests
46
+ runs-on: ubuntu-18.04
47
+ needs: ['confirm-master-branch']
48
+ steps:
49
+ - name: Checkout
50
+ uses: actions/checkout@v2
51
+
52
+ - name: Run Android Unit Tests
53
+ run: echo "pwd"; pwd; echo "ls:"; ls; cd android; ./gradlew test
54
+
55
+
56
+ release-and-sync-repos:
57
+ name: Release and Sync Repos
58
+ runs-on: ubuntu-18.04
59
+ needs: ['android-unit-tests', 'react-tests']
60
+ steps:
61
+ - name: Checkout internal/development
62
+ uses: actions/checkout@v2
63
+
64
+ - name: Setup Node.js
65
+ uses: actions/setup-node@v1
66
+ with:
67
+ node-version: 12.x
68
+
69
+ - name: Install node modules
70
+ run: yarn install
71
+
72
+ - name: Release
73
+ run: ./release.sh ${{ secrets.NPM_TOKEN}}
@@ -716,7 +716,34 @@ public class MParticleModule extends ReactContextBaseJavaModule {
716
716
  ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
717
717
  while (iterator.hasNextKey()) {
718
718
  String key = iterator.nextKey();
719
- map.put(key, readableMap.getString(key));
719
+ switch (readableMap.getType(key)) {
720
+ case Null:
721
+ map.put(key, null);
722
+ break;
723
+ case Boolean:
724
+ map.put(key, Boolean.valueOf(readableMap.getBoolean(key)).toString());
725
+ break;
726
+ case Number:
727
+ try {
728
+ map.put(key, Integer.toString(readableMap.getInt(key)));
729
+ } catch (Exception e) {
730
+ try {
731
+ map.put(key, Double.toString(readableMap.getDouble(key)));
732
+ } catch (Exception ex) {
733
+ Logger.warning("Unable to parse value for \"" + key + "\"");
734
+ }
735
+ }
736
+ break;
737
+ case String:
738
+ map.put(key, readableMap.getString(key));
739
+ break;
740
+ case Map:
741
+ Logger.warning("Maps are not supported Attribute value types");
742
+ break;
743
+ case Array:
744
+ Logger.warning("Lists are not supported Attribute value types");
745
+ break;
746
+ }
720
747
  }
721
748
  }
722
749
 
@@ -416,7 +416,7 @@ typedef NS_ENUM(NSUInteger, MPReactCommerceEventAction) {
416
416
  commerceEvent.action = [RCTConvert MPCommerceEventAction:json[@"productActionType"]];
417
417
  commerceEvent.checkoutStep = [json[@"checkoutStep"] intValue];
418
418
  commerceEvent.nonInteractive = [json[@"nonInteractive"] boolValue];
419
- if json[@"shouldUploadEvent"] != nil {
419
+ if (json[@"shouldUploadEvent"] != nil) {
420
420
  event.shouldUploadEvent = [json[@"shouldUploadEvent"] boolValue]
421
421
  }
422
422
 
@@ -605,7 +605,7 @@ typedef NS_ENUM(NSUInteger, MPReactCommerceEventAction) {
605
605
  event.name = json[@"name"];
606
606
  event.startTime = json[@"startTime"];
607
607
  event.type = [json[@"type"] intValue];
608
- if json[@"shouldUploadEvent"] != nil {
608
+ if (json[@"shouldUploadEvent"] != nil) {
609
609
  event.shouldUploadEvent = [json[@"shouldUploadEvent"] boolValue]
610
610
  }
611
611
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "homepage": "https://www.mparticle.com",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "mParticle/react-native-mparticle",
7
- "version": "2.4.13",
7
+ "version": "2.5.0",
8
8
  "main": "js/index.js",
9
9
  "scripts": {
10
10
  "test": "./node_modules/standard/bin/cmd.js",
package/release.sh ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ : ${1?"NPM Token missing- usage: $0 {MY_NPM_TOKEN}"}
3
+
4
+ touch .npmrc;
5
+ echo "//registry.npmjs.org/:_authToken=$1" > .npmrc;
6
+ npm publish;
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <classpath>
3
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
4
- <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5
- <classpathentry kind="output" path="bin/default"/>
6
- </classpath>
File without changes
@@ -1,2 +0,0 @@
1
- #Wed Mar 17 12:51:17 EDT 2021
2
- gradle.version=5.4.1
File without changes
package/android/.project DELETED
@@ -1,34 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <projectDescription>
3
- <name>android</name>
4
- <comment>Project android created by Buildship.</comment>
5
- <projects>
6
- </projects>
7
- <buildSpec>
8
- <buildCommand>
9
- <name>org.eclipse.jdt.core.javabuilder</name>
10
- <arguments>
11
- </arguments>
12
- </buildCommand>
13
- <buildCommand>
14
- <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15
- <arguments>
16
- </arguments>
17
- </buildCommand>
18
- </buildSpec>
19
- <natures>
20
- <nature>org.eclipse.jdt.core.javanature</nature>
21
- <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22
- </natures>
23
- <filteredResources>
24
- <filter>
25
- <id>1630678802180</id>
26
- <name></name>
27
- <type>30</type>
28
- <matcher>
29
- <id>org.eclipse.core.resources.regexFilterMatcher</id>
30
- <arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
31
- </matcher>
32
- </filter>
33
- </filteredResources>
34
- </projectDescription>
@@ -1,13 +0,0 @@
1
- arguments=
2
- auto.sync=false
3
- build.scans.enabled=false
4
- connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5
- connection.project.dir=
6
- eclipse.preferences.version=1
7
- gradle.user.home=
8
- java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
9
- jvm.arguments=
10
- offline.mode=false
11
- override.workspace.settings=true
12
- show.console.view=true
13
- show.executions.view=true
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Workspace
3
- version = "1.0">
4
- <FileRef
5
- location = "self:">
6
- </FileRef>
7
- </Workspace>
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>IDEDidComputeMac32BitWarning</key>
6
- <true/>
7
- </dict>
8
- </plist>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Bucket
3
- uuid = "39402CF6-7BAB-4033-9C4A-41AE5477C134"
4
- type = "1"
5
- version = "2.0">
6
- </Bucket>
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>SchemeUserState</key>
6
- <dict>
7
- <key>RNMParticle.xcscheme_^#shared#^_</key>
8
- <dict>
9
- <key>orderHint</key>
10
- <integer>0</integer>
11
- </dict>
12
- </dict>
13
- </dict>
14
- </plist>