react-native-mparticle 2.6.2 → 2.7.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.
- package/README.md +26 -23
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/mparticle/react/MParticleModule.java +15 -1
- package/package.json +1 -1
- package/android/.classpath +0 -6
- package/android/.gradle/5.4.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/5.4.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/5.4.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/5.4.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/5.4.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.project +0 -34
- package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
- package/ios/RNMParticle.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/RNMParticle.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/RNMParticle.xcodeproj/project.xcworkspace/xcuserdata/bstalnaker.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNMParticle.xcodeproj/xcuserdata/bstalnaker.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
- package/ios/RNMParticle.xcodeproj/xcuserdata/bstalnaker.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
package/README.md
CHANGED
|
@@ -61,24 +61,23 @@ import mParticle_Apple_SDK
|
|
|
61
61
|
|
|
62
62
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
//override point for customization after application launch.
|
|
65
65
|
let mParticleOptions = MParticleOptions(key: "<<<App Key Here>>>", secret: "<<<App Secret Here>>>")
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
//optional- Please see the Identity page for more information on building this object
|
|
68
68
|
let request = MPIdentityApiRequest()
|
|
69
69
|
request.email = "email@example.com"
|
|
70
70
|
mParticleOptions.identifyRequest = request
|
|
71
|
+
//optional
|
|
71
72
|
mParticleOptions.onIdentifyComplete = { (apiResult, error) in
|
|
72
73
|
NSLog("Identify complete. userId = %@ error = %@", apiResult?.user.userId.stringValue ?? "Null User ID", error?.localizedDescription ?? "No Error Available")
|
|
73
74
|
}
|
|
75
|
+
//optional
|
|
74
76
|
mParticleOptions.onAttributionComplete = { (attributionResult, error) in
|
|
75
77
|
NSLog(@"Attribution Complete. attributionResults = %@", attributionResult.linkInfo)
|
|
76
78
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
MParticle.sharedInstance().start(with: mParticleOptions)
|
|
80
|
-
|
|
81
|
-
return true
|
|
79
|
+
MParticle.sharedInstance().start(with: mParticleOptions)
|
|
80
|
+
return true
|
|
82
81
|
}
|
|
83
82
|
```
|
|
84
83
|
|
|
@@ -110,13 +109,15 @@ Next, you'll need to start the SDK:
|
|
|
110
109
|
MParticleOptions *mParticleOptions = [MParticleOptions optionsWithKey:@"REPLACE ME"
|
|
111
110
|
secret:@"REPLACE ME"];
|
|
112
111
|
|
|
113
|
-
//Please see the Identity page for more information on building this object
|
|
112
|
+
//optional - Please see the Identity page for more information on building this object
|
|
114
113
|
MPIdentityApiRequest *request = [MPIdentityApiRequest requestWithEmptyUser];
|
|
115
114
|
request.email = @"email@example.com";
|
|
116
115
|
mParticleOptions.identifyRequest = request;
|
|
116
|
+
//optional
|
|
117
117
|
mParticleOptions.onIdentifyComplete = ^(MPIdentityApiResult * _Nullable apiResult, NSError * _Nullable error) {
|
|
118
118
|
NSLog(@"Identify complete. userId = %@ error = %@", apiResult.user.userId, error);
|
|
119
119
|
};
|
|
120
|
+
//optional
|
|
120
121
|
mParticleOptions.onAttributionComplete(MPAttributionResult * _Nullable attributionResult, NSError * _Nullable error) {
|
|
121
122
|
NSLog(@"Attribution Complete. attributionResults = %@", attributionResult.linkInfo)
|
|
122
123
|
}
|
|
@@ -138,29 +139,31 @@ See [Identity](http://docs.mparticle.com/developers/sdk/ios/identity/) for more
|
|
|
138
139
|
|
|
139
140
|
For more help, see [the Android set up docs](https://docs.mparticle.com/developers/sdk/android/getting-started/#create-an-input).
|
|
140
141
|
|
|
141
|
-
```
|
|
142
|
+
```kotlin
|
|
142
143
|
package com.example.myapp;
|
|
143
144
|
|
|
144
145
|
import android.app.Application;
|
|
145
146
|
import com.mparticle.MParticle;
|
|
146
147
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
.
|
|
148
|
+
class MyApplication : Application() {
|
|
149
|
+
fun onCreate() {
|
|
150
|
+
super.onCreate()
|
|
151
|
+
val options: MParticleOptions = MParticleOptions.builder(this)
|
|
152
|
+
.credentials("REPLACE ME WITH KEY", "REPLACE ME WITH SECRET")
|
|
153
|
+
//optional
|
|
154
|
+
.logLevel(MParticle.LogLevel.VERBOSE)
|
|
155
|
+
//optional
|
|
154
156
|
.identify(identifyRequest)
|
|
157
|
+
//optional
|
|
155
158
|
.identifyTask(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
BaseIdentityTask()
|
|
160
|
+
.addFailureListener { errorResponse -> }
|
|
161
|
+
.addSuccessListener{ result -> }
|
|
162
|
+
)
|
|
163
|
+
//optional
|
|
160
164
|
.attributionListener(this)
|
|
161
|
-
.build()
|
|
162
|
-
|
|
163
|
-
MParticle.start(options);
|
|
165
|
+
.build()
|
|
166
|
+
MParticle.start(options)
|
|
164
167
|
}
|
|
165
168
|
}
|
|
166
169
|
```
|
package/android/build.gradle
CHANGED
|
@@ -47,7 +47,7 @@ dependencies {
|
|
|
47
47
|
//
|
|
48
48
|
// (See https://github.com/mparticle/mparticle-android-sdk for the latest version)
|
|
49
49
|
//
|
|
50
|
-
compileOnly 'com.mparticle:android-core:[5.9.3,
|
|
50
|
+
compileOnly 'com.mparticle:android-core:[5.9.3, 5.38.2]'
|
|
51
51
|
|
|
52
52
|
//
|
|
53
53
|
// And, if you want to include kits, you can do so as follows:
|
|
@@ -13,6 +13,8 @@ import com.facebook.react.bridge.Callback;
|
|
|
13
13
|
import com.facebook.react.bridge.ReadableType;
|
|
14
14
|
import com.facebook.react.bridge.WritableMap;
|
|
15
15
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
16
|
+
import com.facebook.react.bridge.WritableArray;
|
|
17
|
+
import com.facebook.react.bridge.WritableNativeArray;
|
|
16
18
|
import com.mparticle.AttributionResult;
|
|
17
19
|
import com.mparticle.MParticle;
|
|
18
20
|
import com.mparticle.MPEvent;
|
|
@@ -121,7 +123,19 @@ public class MParticleModule extends ReactContextBaseJavaModule {
|
|
|
121
123
|
selectedUser.getUserAttributes(new UserAttributeListener() {
|
|
122
124
|
@Override
|
|
123
125
|
public void onUserAttributesReceived(Map<String, String> userAttributes, Map<String, List<String>> userAttributeLists, Long mpid) {
|
|
124
|
-
|
|
126
|
+
WritableMap resultMap = new WritableNativeMap();
|
|
127
|
+
for (Map.Entry<String, String> entry : userAttributes.entrySet()) {
|
|
128
|
+
resultMap.putString(entry.getKey(), entry.getValue());
|
|
129
|
+
}
|
|
130
|
+
for (Map.Entry<String, List<String>> entry : userAttributeLists.entrySet()) {
|
|
131
|
+
WritableArray resultArray = new WritableNativeArray();
|
|
132
|
+
List<String> valueList = entry.getValue();
|
|
133
|
+
for (String arrayVal : valueList) {
|
|
134
|
+
resultArray.pushString(arrayVal);
|
|
135
|
+
}
|
|
136
|
+
resultMap.putArray(entry.getKey(), resultArray);
|
|
137
|
+
}
|
|
138
|
+
completion.invoke(null, resultMap);
|
|
125
139
|
}
|
|
126
140
|
});
|
|
127
141
|
} else {
|
package/package.json
CHANGED
package/android/.classpath
DELETED
|
@@ -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>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
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
|
|
Binary file
|
|
@@ -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>
|