mixpanel-react-native 3.0.2 → 3.0.4
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/.github/workflows/node.js.yml +10 -3
- package/CHANGELOG.md +30 -0
- package/MixpanelReactNative.podspec +1 -1
- package/README.md +28 -3
- package/Samples/MixpanelExpo/package.json +1 -1
- package/Samples/MixpanelExpo/yarn.lock +7052 -0
- package/Samples/SimpleMixpanel/{App.js → App.tsx} +8 -8
- package/Samples/SimpleMixpanel/Gemfile +9 -0
- package/Samples/SimpleMixpanel/README.md +79 -0
- package/Samples/SimpleMixpanel/__tests__/{App-test.js → App.test.tsx} +3 -0
- package/Samples/SimpleMixpanel/android/app/build.gradle +58 -162
- package/Samples/SimpleMixpanel/android/app/src/debug/AndroidManifest.xml +1 -5
- package/Samples/SimpleMixpanel/android/app/src/main/AndroidManifest.xml +4 -4
- package/Samples/SimpleMixpanel/android/app/src/main/java/com/simplemixpanel/MainActivity.kt +22 -0
- package/Samples/SimpleMixpanel/android/app/src/main/java/com/simplemixpanel/MainApplication.kt +43 -0
- package/Samples/SimpleMixpanel/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/Samples/SimpleMixpanel/android/app/src/main/res/values/styles.xml +1 -1
- package/Samples/SimpleMixpanel/android/build.gradle +11 -28
- package/Samples/SimpleMixpanel/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/Samples/SimpleMixpanel/android/gradle/wrapper/gradle-wrapper.properties +3 -1
- package/Samples/SimpleMixpanel/android/gradle.properties +17 -4
- package/Samples/SimpleMixpanel/android/gradlew +173 -109
- package/Samples/SimpleMixpanel/android/gradlew.bat +92 -89
- package/Samples/SimpleMixpanel/android/settings.gradle +1 -0
- package/Samples/SimpleMixpanel/app.json +1 -1
- package/Samples/SimpleMixpanel/babel.config.js +1 -1
- package/Samples/SimpleMixpanel/ios/.xcode.env +11 -0
- package/Samples/SimpleMixpanel/ios/Podfile +24 -13
- package/Samples/SimpleMixpanel/ios/Podfile.lock +1414 -0
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel/AppDelegate.h +2 -4
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel/AppDelegate.mm +31 -0
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel/Images.xcassets/AppIcon.appiconset/Contents.json +30 -15
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel/Info.plist +8 -11
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel/PrivacyInfo.xcprivacy +38 -0
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel/main.m +2 -1
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel.xcodeproj/project.pbxproj +130 -114
- package/Samples/SimpleMixpanel/ios/SimpleMixpanelTests/SimpleMixpanelTests.m +14 -13
- package/Samples/SimpleMixpanel/jest.config.js +3 -0
- package/Samples/SimpleMixpanel/metro.config.js +7 -13
- package/Samples/SimpleMixpanel/package.json +23 -15
- package/Samples/SimpleMixpanel/tsconfig.json +3 -0
- package/Samples/SimpleMixpanel/yarn.lock +6814 -0
- package/__tests__/jest_setup.js +3 -3
- package/android/build.gradle +1 -1
- package/docs/Mixpanel.html +33 -33
- package/docs/MixpanelGroup.html +7 -7
- package/docs/People.html +12 -12
- package/docs/index.html +26 -3
- package/docs/index.js.html +8 -18
- package/index.d.ts +10 -2
- package/index.js +7 -17
- package/javascript/mixpanel-main.js +1 -1
- package/javascript/mixpanel-network.js +2 -2
- package/javascript/mixpanel-persistent.js +0 -2
- package/package.json +1 -1
- package/Samples/ContextAPIMixpanel/android/.project +0 -28
- package/Samples/MixpanelDemo/android/.project +0 -28
- package/Samples/SimpleMixpanel/.buckconfig +0 -6
- package/Samples/SimpleMixpanel/.editorconfig +0 -3
- package/Samples/SimpleMixpanel/.eslintrc.js +0 -4
- package/Samples/SimpleMixpanel/.flowconfig +0 -66
- package/Samples/SimpleMixpanel/.gitattributes +0 -3
- package/Samples/SimpleMixpanel/.prettierrc.js +0 -7
- package/Samples/SimpleMixpanel/.watchmanconfig +0 -1
- package/Samples/SimpleMixpanel/android/.project +0 -28
- package/Samples/SimpleMixpanel/android/app/BUCK +0 -55
- package/Samples/SimpleMixpanel/android/app/build_defs.bzl +0 -19
- package/Samples/SimpleMixpanel/android/app/src/debug/java/com/simplemixpanel/ReactNativeFlipper.java +0 -72
- package/Samples/SimpleMixpanel/android/app/src/main/java/com/simplemixpanel/MainActivity.java +0 -15
- package/Samples/SimpleMixpanel/android/app/src/main/java/com/simplemixpanel/MainApplication.java +0 -80
- package/Samples/SimpleMixpanel/ios/File.swift +0 -8
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel/AppDelegate.m +0 -62
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel-Bridging-Header.h +0 -4
- package/Samples/SimpleMixpanel/ios/SimpleMixpanel.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/android/bin/.gradle/5.5/executionHistory/executionHistory.lock +0 -0
- package/android/bin/.gradle/5.5/fileChanges/last-build.bin +0 -0
- package/android/bin/.gradle/5.5/fileHashes/fileHashes.bin +0 -0
- package/android/bin/.gradle/5.5/fileHashes/fileHashes.lock +0 -0
- package/android/bin/.gradle/5.5/gc.properties +0 -0
- package/android/bin/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/bin/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/bin/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/bin/.gradle/vcs-1/gc.properties +0 -0
- package/android/bin/.idea/caches/build_file_checksums.ser +0 -0
- package/android/bin/.idea/compiler.xml +0 -6
- package/android/bin/.idea/gradle.xml +0 -21
- package/android/bin/.idea/jarRepositories.xml +0 -30
- package/android/bin/.idea/libraries/Gradle__com_android_support_appcompat_v7_23_0_1_aar.xml +0 -16
- package/android/bin/.idea/libraries/Gradle__com_android_support_recyclerview_v7_23_0_1_aar.xml +0 -13
- package/android/bin/.idea/libraries/Gradle__com_android_support_support_annotations_23_0_1.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__com_android_support_support_v4_23_0_1_aar.xml +0 -17
- package/android/bin/.idea/libraries/Gradle__com_facebook_fresco_drawee_0_8_1_aar.xml +0 -13
- package/android/bin/.idea/libraries/Gradle__com_facebook_fresco_fbcore_0_8_1_aar.xml +0 -13
- package/android/bin/.idea/libraries/Gradle__com_facebook_fresco_fresco_0_8_1_aar.xml +0 -13
- package/android/bin/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_0_8_1_aar.xml +0 -13
- package/android/bin/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp_0_8_1_aar.xml +0 -13
- package/android/bin/.idea/libraries/Gradle__com_facebook_react_react_native_0_20_1_aar.xml +0 -17
- package/android/bin/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_2_0.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__com_facebook_stetho_stetho_okhttp_1_2_0.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_2_3.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_0.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__com_mixpanel_android_mixpanel_android_6_0_0_beta1_aar.xml +0 -16
- package/android/bin/.idea/libraries/Gradle__com_nineoldandroids_library_2_4_0.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__com_parse_bolts_bolts_android_1_1_4.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_2_5_0.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_ws_2_5_0.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__com_squareup_okio_okio_1_6_0.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__commons_cli_commons_cli_1_2.xml +0 -11
- package/android/bin/.idea/libraries/Gradle__org_webkit_android_jsc_r174650_aar.xml +0 -11
- package/android/bin/.idea/misc.xml +0 -9
- package/android/bin/.idea/modules.xml +0 -8
- package/android/bin/.idea/vcs.xml +0 -6
- package/android/bin/.idea/workspace.xml +0 -57
- package/android/bin/.project +0 -34
- package/android/bin/.settings/org.eclipse.buildship.core.prefs +0 -13
- package/android/bin/build.gradle +0 -45
- package/android/bin/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/bin/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/bin/gradlew +0 -172
- package/android/bin/gradlew.bat +0 -84
- package/android/bin/local.properties +0 -8
- package/android/bin/src/main/AndroidManifest.xml +0 -2
- package/logs/.b11bf985d66a037ca5688a574653f3bf76a28dfa-audit.json +0 -29
- package/logs/.c366df74eeb671df60a57a2075ae40a3dae2af25-audit.json +0 -29
|
@@ -24,9 +24,9 @@ export const MixpanelNetwork = (() => {
|
|
|
24
24
|
const response = await fetch(url, {
|
|
25
25
|
method: "POST",
|
|
26
26
|
headers: {
|
|
27
|
-
"Content-Type": "application/
|
|
27
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
28
28
|
},
|
|
29
|
-
body: JSON.stringify(data)
|
|
29
|
+
body: `data=${JSON.stringify(data)}`,
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const responseBody = await response.json();
|
|
@@ -50,8 +50,6 @@ export class MixpanelPersistent {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
async loadDeviceId(token) {
|
|
53
|
-
console.info("storageAdapter", this.storageAdapter);
|
|
54
|
-
console.info("storageAdapter get item", this.storageAdapter.getItem());
|
|
55
53
|
await this.storageAdapter
|
|
56
54
|
.getItem(getDeviceIdKey(token))
|
|
57
55
|
.then((deviceId) => {
|
package/package.json
CHANGED
|
@@ -1,28 +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.buildship.core.gradleprojectbuilder</name>
|
|
10
|
-
<arguments>
|
|
11
|
-
</arguments>
|
|
12
|
-
</buildCommand>
|
|
13
|
-
</buildSpec>
|
|
14
|
-
<natures>
|
|
15
|
-
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
16
|
-
</natures>
|
|
17
|
-
<filteredResources>
|
|
18
|
-
<filter>
|
|
19
|
-
<id>1686200212448</id>
|
|
20
|
-
<name></name>
|
|
21
|
-
<type>30</type>
|
|
22
|
-
<matcher>
|
|
23
|
-
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
24
|
-
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
25
|
-
</matcher>
|
|
26
|
-
</filter>
|
|
27
|
-
</filteredResources>
|
|
28
|
-
</projectDescription>
|
|
@@ -1,28 +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.buildship.core.gradleprojectbuilder</name>
|
|
10
|
-
<arguments>
|
|
11
|
-
</arguments>
|
|
12
|
-
</buildCommand>
|
|
13
|
-
</buildSpec>
|
|
14
|
-
<natures>
|
|
15
|
-
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
16
|
-
</natures>
|
|
17
|
-
<filteredResources>
|
|
18
|
-
<filter>
|
|
19
|
-
<id>1686200212452</id>
|
|
20
|
-
<name></name>
|
|
21
|
-
<type>30</type>
|
|
22
|
-
<matcher>
|
|
23
|
-
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
24
|
-
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
25
|
-
</matcher>
|
|
26
|
-
</filter>
|
|
27
|
-
</filteredResources>
|
|
28
|
-
</projectDescription>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
[ignore]
|
|
2
|
-
; We fork some components by platform
|
|
3
|
-
.*/*[.]android.js
|
|
4
|
-
|
|
5
|
-
; Ignore "BUCK" generated dirs
|
|
6
|
-
<PROJECT_ROOT>/\.buckd/
|
|
7
|
-
|
|
8
|
-
; Ignore polyfills
|
|
9
|
-
node_modules/react-native/Libraries/polyfills/.*
|
|
10
|
-
|
|
11
|
-
; Flow doesn't support platforms
|
|
12
|
-
.*/Libraries/Utilities/LoadingView.js
|
|
13
|
-
|
|
14
|
-
[untyped]
|
|
15
|
-
.*/node_modules/@react-native-community/cli/.*/.*
|
|
16
|
-
|
|
17
|
-
[include]
|
|
18
|
-
|
|
19
|
-
[libs]
|
|
20
|
-
node_modules/react-native/interface.js
|
|
21
|
-
node_modules/react-native/flow/
|
|
22
|
-
|
|
23
|
-
[options]
|
|
24
|
-
emoji=true
|
|
25
|
-
|
|
26
|
-
esproposal.optional_chaining=enable
|
|
27
|
-
esproposal.nullish_coalescing=enable
|
|
28
|
-
|
|
29
|
-
exact_by_default=true
|
|
30
|
-
|
|
31
|
-
module.file_ext=.js
|
|
32
|
-
module.file_ext=.json
|
|
33
|
-
module.file_ext=.ios.js
|
|
34
|
-
|
|
35
|
-
munge_underscores=true
|
|
36
|
-
|
|
37
|
-
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
|
|
38
|
-
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
|
|
39
|
-
|
|
40
|
-
suppress_type=$FlowIssue
|
|
41
|
-
suppress_type=$FlowFixMe
|
|
42
|
-
suppress_type=$FlowFixMeProps
|
|
43
|
-
suppress_type=$FlowFixMeState
|
|
44
|
-
|
|
45
|
-
[lints]
|
|
46
|
-
sketchy-null-number=warn
|
|
47
|
-
sketchy-null-mixed=warn
|
|
48
|
-
sketchy-number=warn
|
|
49
|
-
untyped-type-import=warn
|
|
50
|
-
nonstrict-import=warn
|
|
51
|
-
deprecated-type=warn
|
|
52
|
-
unsafe-getters-setters=warn
|
|
53
|
-
unnecessary-invariant=warn
|
|
54
|
-
signature-verification-failure=warn
|
|
55
|
-
|
|
56
|
-
[strict]
|
|
57
|
-
deprecated-type
|
|
58
|
-
nonstrict-import
|
|
59
|
-
sketchy-null
|
|
60
|
-
unclear-type
|
|
61
|
-
unsafe-getters-setters
|
|
62
|
-
untyped-import
|
|
63
|
-
untyped-type-import
|
|
64
|
-
|
|
65
|
-
[version]
|
|
66
|
-
^0.137.0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<projectDescription>
|
|
3
|
-
<name>SimpleMixpanel</name>
|
|
4
|
-
<comment>Project android created by Buildship.</comment>
|
|
5
|
-
<projects>
|
|
6
|
-
</projects>
|
|
7
|
-
<buildSpec>
|
|
8
|
-
<buildCommand>
|
|
9
|
-
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
10
|
-
<arguments>
|
|
11
|
-
</arguments>
|
|
12
|
-
</buildCommand>
|
|
13
|
-
</buildSpec>
|
|
14
|
-
<natures>
|
|
15
|
-
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
16
|
-
</natures>
|
|
17
|
-
<filteredResources>
|
|
18
|
-
<filter>
|
|
19
|
-
<id>1686200212442</id>
|
|
20
|
-
<name></name>
|
|
21
|
-
<type>30</type>
|
|
22
|
-
<matcher>
|
|
23
|
-
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
24
|
-
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
25
|
-
</matcher>
|
|
26
|
-
</filter>
|
|
27
|
-
</filteredResources>
|
|
28
|
-
</projectDescription>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# To learn about Buck see [Docs](https://buckbuild.com/).
|
|
2
|
-
# To run your application with Buck:
|
|
3
|
-
# - install Buck
|
|
4
|
-
# - `npm start` - to start the packager
|
|
5
|
-
# - `cd android`
|
|
6
|
-
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
|
|
7
|
-
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
|
|
8
|
-
# - `buck install -r android/app` - compile, install and run application
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
|
|
12
|
-
|
|
13
|
-
lib_deps = []
|
|
14
|
-
|
|
15
|
-
create_aar_targets(glob(["libs/*.aar"]))
|
|
16
|
-
|
|
17
|
-
create_jar_targets(glob(["libs/*.jar"]))
|
|
18
|
-
|
|
19
|
-
android_library(
|
|
20
|
-
name = "all-libs",
|
|
21
|
-
exported_deps = lib_deps,
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
android_library(
|
|
25
|
-
name = "app-code",
|
|
26
|
-
srcs = glob([
|
|
27
|
-
"src/main/java/**/*.java",
|
|
28
|
-
]),
|
|
29
|
-
deps = [
|
|
30
|
-
":all-libs",
|
|
31
|
-
":build_config",
|
|
32
|
-
":res",
|
|
33
|
-
],
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
android_build_config(
|
|
37
|
-
name = "build_config",
|
|
38
|
-
package = "com.simplemixpanel",
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
android_resource(
|
|
42
|
-
name = "res",
|
|
43
|
-
package = "com.simplemixpanel",
|
|
44
|
-
res = "src/main/res",
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
android_binary(
|
|
48
|
-
name = "app",
|
|
49
|
-
keystore = "//android/keystores:debug",
|
|
50
|
-
manifest = "src/main/AndroidManifest.xml",
|
|
51
|
-
package_type = "debug",
|
|
52
|
-
deps = [
|
|
53
|
-
":app-code",
|
|
54
|
-
],
|
|
55
|
-
)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"""Helper definitions to glob .aar and .jar targets"""
|
|
2
|
-
|
|
3
|
-
def create_aar_targets(aarfiles):
|
|
4
|
-
for aarfile in aarfiles:
|
|
5
|
-
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
|
|
6
|
-
lib_deps.append(":" + name)
|
|
7
|
-
android_prebuilt_aar(
|
|
8
|
-
name = name,
|
|
9
|
-
aar = aarfile,
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
def create_jar_targets(jarfiles):
|
|
13
|
-
for jarfile in jarfiles:
|
|
14
|
-
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
|
|
15
|
-
lib_deps.append(":" + name)
|
|
16
|
-
prebuilt_jar(
|
|
17
|
-
name = name,
|
|
18
|
-
binary_jar = jarfile,
|
|
19
|
-
)
|
package/Samples/SimpleMixpanel/android/app/src/debug/java/com/simplemixpanel/ReactNativeFlipper.java
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
-
* directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
package com.simplemixpanel;
|
|
8
|
-
|
|
9
|
-
import android.content.Context;
|
|
10
|
-
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
11
|
-
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
12
|
-
import com.facebook.flipper.core.FlipperClient;
|
|
13
|
-
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
14
|
-
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
15
|
-
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
|
16
|
-
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
17
|
-
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
18
|
-
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
|
19
|
-
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
|
20
|
-
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
|
|
21
|
-
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
22
|
-
import com.facebook.react.ReactInstanceManager;
|
|
23
|
-
import com.facebook.react.bridge.ReactContext;
|
|
24
|
-
import com.facebook.react.modules.network.NetworkingModule;
|
|
25
|
-
import okhttp3.OkHttpClient;
|
|
26
|
-
|
|
27
|
-
public class ReactNativeFlipper {
|
|
28
|
-
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
29
|
-
if (FlipperUtils.shouldEnableFlipper(context)) {
|
|
30
|
-
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
31
|
-
|
|
32
|
-
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
33
|
-
client.addPlugin(new ReactFlipperPlugin());
|
|
34
|
-
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
35
|
-
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
36
|
-
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
37
|
-
|
|
38
|
-
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
|
39
|
-
NetworkingModule.setCustomClientBuilder(
|
|
40
|
-
new NetworkingModule.CustomClientBuilder() {
|
|
41
|
-
@Override
|
|
42
|
-
public void apply(OkHttpClient.Builder builder) {
|
|
43
|
-
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
client.addPlugin(networkFlipperPlugin);
|
|
47
|
-
client.start();
|
|
48
|
-
|
|
49
|
-
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
|
50
|
-
// Hence we run if after all native modules have been initialized
|
|
51
|
-
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
|
52
|
-
if (reactContext == null) {
|
|
53
|
-
reactInstanceManager.addReactInstanceEventListener(
|
|
54
|
-
new ReactInstanceManager.ReactInstanceEventListener() {
|
|
55
|
-
@Override
|
|
56
|
-
public void onReactContextInitialized(ReactContext reactContext) {
|
|
57
|
-
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
58
|
-
reactContext.runOnNativeModulesQueueThread(
|
|
59
|
-
new Runnable() {
|
|
60
|
-
@Override
|
|
61
|
-
public void run() {
|
|
62
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
package/Samples/SimpleMixpanel/android/app/src/main/java/com/simplemixpanel/MainActivity.java
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
package com.simplemixpanel;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.ReactActivity;
|
|
4
|
-
|
|
5
|
-
public class MainActivity extends ReactActivity {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
9
|
-
* rendering of the component.
|
|
10
|
-
*/
|
|
11
|
-
@Override
|
|
12
|
-
protected String getMainComponentName() {
|
|
13
|
-
return "SimpleMixpanel";
|
|
14
|
-
}
|
|
15
|
-
}
|
package/Samples/SimpleMixpanel/android/app/src/main/java/com/simplemixpanel/MainApplication.java
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
package com.simplemixpanel;
|
|
2
|
-
|
|
3
|
-
import android.app.Application;
|
|
4
|
-
import android.content.Context;
|
|
5
|
-
import com.facebook.react.PackageList;
|
|
6
|
-
import com.facebook.react.ReactApplication;
|
|
7
|
-
import com.facebook.react.ReactInstanceManager;
|
|
8
|
-
import com.facebook.react.ReactNativeHost;
|
|
9
|
-
import com.facebook.react.ReactPackage;
|
|
10
|
-
import com.facebook.soloader.SoLoader;
|
|
11
|
-
import java.lang.reflect.InvocationTargetException;
|
|
12
|
-
import java.util.List;
|
|
13
|
-
|
|
14
|
-
public class MainApplication extends Application implements ReactApplication {
|
|
15
|
-
|
|
16
|
-
private final ReactNativeHost mReactNativeHost =
|
|
17
|
-
new ReactNativeHost(this) {
|
|
18
|
-
@Override
|
|
19
|
-
public boolean getUseDeveloperSupport() {
|
|
20
|
-
return BuildConfig.DEBUG;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@Override
|
|
24
|
-
protected List<ReactPackage> getPackages() {
|
|
25
|
-
@SuppressWarnings("UnnecessaryLocalVariable")
|
|
26
|
-
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
27
|
-
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
28
|
-
// packages.add(new MyReactNativePackage());
|
|
29
|
-
return packages;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@Override
|
|
33
|
-
protected String getJSMainModuleName() {
|
|
34
|
-
return "index";
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
@Override
|
|
39
|
-
public ReactNativeHost getReactNativeHost() {
|
|
40
|
-
return mReactNativeHost;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@Override
|
|
44
|
-
public void onCreate() {
|
|
45
|
-
super.onCreate();
|
|
46
|
-
SoLoader.init(this, /* native exopackage */ false);
|
|
47
|
-
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
|
52
|
-
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
53
|
-
*
|
|
54
|
-
* @param context
|
|
55
|
-
* @param reactInstanceManager
|
|
56
|
-
*/
|
|
57
|
-
private static void initializeFlipper(
|
|
58
|
-
Context context, ReactInstanceManager reactInstanceManager) {
|
|
59
|
-
if (BuildConfig.DEBUG) {
|
|
60
|
-
try {
|
|
61
|
-
/*
|
|
62
|
-
We use reflection here to pick up the class that initializes Flipper,
|
|
63
|
-
since Flipper library is not available in release mode
|
|
64
|
-
*/
|
|
65
|
-
Class<?> aClass = Class.forName("com.simplemixpanel.ReactNativeFlipper");
|
|
66
|
-
aClass
|
|
67
|
-
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
|
68
|
-
.invoke(null, context, reactInstanceManager);
|
|
69
|
-
} catch (ClassNotFoundException e) {
|
|
70
|
-
e.printStackTrace();
|
|
71
|
-
} catch (NoSuchMethodException e) {
|
|
72
|
-
e.printStackTrace();
|
|
73
|
-
} catch (IllegalAccessException e) {
|
|
74
|
-
e.printStackTrace();
|
|
75
|
-
} catch (InvocationTargetException e) {
|
|
76
|
-
e.printStackTrace();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#import "AppDelegate.h"
|
|
2
|
-
|
|
3
|
-
#import <React/RCTBridge.h>
|
|
4
|
-
#import <React/RCTBundleURLProvider.h>
|
|
5
|
-
#import <React/RCTRootView.h>
|
|
6
|
-
|
|
7
|
-
#ifdef FB_SONARKIT_ENABLED
|
|
8
|
-
#import <FlipperKit/FlipperClient.h>
|
|
9
|
-
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
|
|
10
|
-
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
|
|
11
|
-
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
|
|
12
|
-
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
|
|
13
|
-
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
|
|
14
|
-
|
|
15
|
-
static void InitializeFlipper(UIApplication *application) {
|
|
16
|
-
FlipperClient *client = [FlipperClient sharedClient];
|
|
17
|
-
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
|
|
18
|
-
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
|
|
19
|
-
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
|
|
20
|
-
[client addPlugin:[FlipperKitReactPlugin new]];
|
|
21
|
-
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
|
|
22
|
-
[client start];
|
|
23
|
-
}
|
|
24
|
-
#endif
|
|
25
|
-
|
|
26
|
-
@implementation AppDelegate
|
|
27
|
-
|
|
28
|
-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
29
|
-
{
|
|
30
|
-
#ifdef FB_SONARKIT_ENABLED
|
|
31
|
-
InitializeFlipper(application);
|
|
32
|
-
#endif
|
|
33
|
-
|
|
34
|
-
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
|
|
35
|
-
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
|
|
36
|
-
moduleName:@"SimpleMixpanel"
|
|
37
|
-
initialProperties:nil];
|
|
38
|
-
|
|
39
|
-
if (@available(iOS 13.0, *)) {
|
|
40
|
-
rootView.backgroundColor = [UIColor systemBackgroundColor];
|
|
41
|
-
} else {
|
|
42
|
-
rootView.backgroundColor = [UIColor whiteColor];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
46
|
-
UIViewController *rootViewController = [UIViewController new];
|
|
47
|
-
rootViewController.view = rootView;
|
|
48
|
-
self.window.rootViewController = rootViewController;
|
|
49
|
-
[self.window makeKeyAndVisible];
|
|
50
|
-
return YES;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
54
|
-
{
|
|
55
|
-
#if DEBUG
|
|
56
|
-
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
|
|
57
|
-
#else
|
|
58
|
-
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
59
|
-
#endif
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="GradleMigrationSettings" migrationVersion="1" />
|
|
4
|
-
<component name="GradleSettings">
|
|
5
|
-
<option name="linkedExternalProjectsSettings">
|
|
6
|
-
<GradleProjectSettings>
|
|
7
|
-
<option name="testRunner" value="PLATFORM" />
|
|
8
|
-
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
9
|
-
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
10
|
-
<option name="gradleJvm" value="1.8" />
|
|
11
|
-
<option name="modules">
|
|
12
|
-
<set>
|
|
13
|
-
<option value="$PROJECT_DIR$" />
|
|
14
|
-
</set>
|
|
15
|
-
</option>
|
|
16
|
-
<option name="resolveModulePerSourceSet" value="false" />
|
|
17
|
-
<option name="useQualifiedModuleNames" value="true" />
|
|
18
|
-
</GradleProjectSettings>
|
|
19
|
-
</option>
|
|
20
|
-
</component>
|
|
21
|
-
</project>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="RemoteRepositoriesConfiguration">
|
|
4
|
-
<remote-repository>
|
|
5
|
-
<option name="id" value="central" />
|
|
6
|
-
<option name="name" value="Maven Central repository" />
|
|
7
|
-
<option name="url" value="https://repo1.maven.org/maven2" />
|
|
8
|
-
</remote-repository>
|
|
9
|
-
<remote-repository>
|
|
10
|
-
<option name="id" value="jboss.community" />
|
|
11
|
-
<option name="name" value="JBoss Community repository" />
|
|
12
|
-
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
|
13
|
-
</remote-repository>
|
|
14
|
-
<remote-repository>
|
|
15
|
-
<option name="id" value="Google" />
|
|
16
|
-
<option name="name" value="Google" />
|
|
17
|
-
<option name="url" value="https://maven.google.com/" />
|
|
18
|
-
</remote-repository>
|
|
19
|
-
<remote-repository>
|
|
20
|
-
<option name="id" value="BintrayJCenter" />
|
|
21
|
-
<option name="name" value="BintrayJCenter" />
|
|
22
|
-
<option name="url" value="https://jcenter.bintray.com/" />
|
|
23
|
-
</remote-repository>
|
|
24
|
-
<remote-repository>
|
|
25
|
-
<option name="id" value="MavenRepo" />
|
|
26
|
-
<option name="name" value="MavenRepo" />
|
|
27
|
-
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
|
28
|
-
</remote-repository>
|
|
29
|
-
</component>
|
|
30
|
-
</project>
|