reactnative-plugin-appice 1.3.0 → 1.4.2

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.
Files changed (197) hide show
  1. package/README.md +1 -59
  2. package/android/build.gradle +14 -54
  3. package/android/libs/logutility.jar +0 -0
  4. package/android/local.properties +2 -2
  5. package/android/src/main/AndroidManifest.xml +21 -124
  6. package/android/src/main/java/com/reactlibrary/AppICEUtils.java +38 -0
  7. package/android/src/main/java/com/reactlibrary/AppIceReactPluginModule.java +330 -78
  8. package/android/src/main/java/com/reactlibrary/CampaignCampsReceiver.java +20 -3
  9. package/android/src/main/java/com/reactlibrary/InAppWebView.java +68 -0
  10. package/android/src/main/java/com/reactlibrary/NotificationEventService.java +0 -0
  11. package/android/src/main/java/com/reactlibrary/React-Native workspace.code-workspace +29 -0
  12. package/example/App.js +130 -0
  13. package/example/Gemfile +6 -0
  14. package/example/__tests__/App-test.js +14 -0
  15. package/example/android/app/_BUCK +55 -0
  16. package/example/android/app/build.gradle +320 -0
  17. package/example/android/app/build_defs.bzl +19 -0
  18. package/example/android/app/debug.keystore +0 -0
  19. package/example/android/app/proguard-rules.pro +10 -0
  20. package/example/android/app/src/debug/AndroidManifest.xml +13 -0
  21. package/example/android/app/src/debug/java/com/example/ReactNativeFlipper.java +73 -0
  22. package/example/android/app/src/main/AndroidManifest.xml +72 -0
  23. package/example/android/app/src/main/java/com/example/MainActivity.java +48 -0
  24. package/example/android/app/src/main/java/com/example/MainApplication.java +91 -0
  25. package/example/android/app/src/main/java/com/example/newarchitecture/MainApplicationReactNativeHost.java +116 -0
  26. package/example/android/app/src/main/java/com/example/newarchitecture/components/MainComponentsRegistry.java +36 -0
  27. package/example/android/app/src/main/java/com/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -0
  28. package/example/android/app/src/main/jni/Android.mk +48 -0
  29. package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +24 -0
  30. package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
  31. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
  32. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -0
  33. package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +61 -0
  34. package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -0
  35. package/example/android/app/src/main/jni/OnLoad.cpp +11 -0
  36. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  37. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  38. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  39. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  40. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  41. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  42. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  43. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  44. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  45. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  46. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  47. package/example/android/app/src/main/res/values/strings.xml +3 -0
  48. package/example/android/app/src/main/res/values/styles.xml +9 -0
  49. package/example/android/build.gradle +53 -0
  50. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  51. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  52. package/example/android/gradle.properties +40 -0
  53. package/example/android/gradlew +234 -0
  54. package/example/android/gradlew.bat +89 -0
  55. package/example/android/settings.gradle +11 -0
  56. package/example/app.json +4 -0
  57. package/example/babel.config.js +3 -0
  58. package/example/index.js +9 -0
  59. package/example/ios/Podfile +36 -0
  60. package/example/ios/Podfile.lock +561 -0
  61. package/example/ios/_xcode.env +11 -0
  62. package/example/ios/example/AppDelegate.h +8 -0
  63. package/example/ios/example/AppDelegate.mm +175 -0
  64. package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  65. package/example/ios/example/Images.xcassets/Contents.json +6 -0
  66. package/example/ios/example/Info.plist +62 -0
  67. package/example/ios/example/LaunchScreen.storyboard +47 -0
  68. package/example/ios/example/example.entitlements +8 -0
  69. package/example/ios/example/main.m +10 -0
  70. package/example/ios/example.xcodeproj/project.pbxproj +712 -0
  71. package/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +88 -0
  72. package/example/ios/example.xcworkspace/contents.xcworkspacedata +10 -0
  73. package/example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  74. package/example/ios/exampleTests/Info.plist +24 -0
  75. package/example/ios/exampleTests/exampleTests.m +66 -0
  76. package/example/metro.config.js +17 -0
  77. package/example/package-lock.json +21443 -0
  78. package/example/package.json +33 -0
  79. package/example/yarn.lock +7238 -0
  80. package/index.js +99 -3
  81. package/ios/AppICEReactEvent.h +22 -0
  82. package/ios/AppICEReactEvent.m +65 -0
  83. package/ios/AppICESDK/appICE.momd/VersionInfo.plist +0 -0
  84. package/ios/AppICESDK/appICE.momd/appICE 4.mom +0 -0
  85. package/ios/AppICESDK/appICE.momd/appICE 4.omo +0 -0
  86. package/ios/AppICESDK/appICEBundle.bundle/APPChildViewController.nib +0 -0
  87. package/ios/AppICESDK/appICEBundle.bundle/HAlfFooterNOTINAppViewController.nib +0 -0
  88. package/ios/AppICESDK/appICEBundle.bundle/HAlfHeaderINAppViewController.nib +0 -0
  89. package/ios/AppICESDK/appICEBundle.bundle/HAlfINAppViewController.nib +0 -0
  90. package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/objects-11.0+.nib +0 -0
  91. package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/runtime.nib +0 -0
  92. package/ios/AppICESDK/appICEBundle.bundle/Info.plist +0 -0
  93. package/ios/AppICESDK/appICEBundle.bundle/RatingViewController.nib +0 -0
  94. package/ios/AppICESDK/appICEBundle.bundle/SurveyViewController.nib +0 -0
  95. package/ios/AppICESDK/include/iosAppiceSDK/AppICEHelper.h +77 -0
  96. package/ios/AppICESDK/include/iosAppiceSDK/AppICEInboxMessage.h +1 -0
  97. package/ios/AppICESDK/include/iosAppiceSDK/AppICEJSInterface.h +21 -0
  98. package/ios/AppICESDK/include/iosAppiceSDK/appICE.h +68 -22
  99. package/ios/AppICESDK/include/iosAppiceSDK/appICEUserDetails.h +6 -0
  100. package/ios/AppICESDK/include/iosAppiceSDK/isrgrootx1.der +0 -0
  101. package/ios/AppICESDK/include/iosAppiceSDK/lets-encrypt-r3.der +0 -0
  102. package/ios/AppICESDK/{libiosAppiceSDK_v1.7.15.a → libiosAppiceSDK_v1.7.37.a} +0 -0
  103. package/ios/AppIceReactPlugin.h +15 -2
  104. package/ios/AppIceReactPlugin.m +91 -14
  105. package/ios/AppIceReactPlugin.xcodeproj/project.pbxproj +67 -55
  106. package/package.json +3 -2
  107. package/android/.gradle/5.4.1/executionHistory/executionHistory.bin +0 -0
  108. package/android/.gradle/5.4.1/executionHistory/executionHistory.lock +0 -0
  109. package/android/.gradle/5.4.1/fileChanges/last-build.bin +0 -0
  110. package/android/.gradle/5.4.1/fileHashes/fileHashes.bin +0 -0
  111. package/android/.gradle/5.4.1/fileHashes/fileHashes.lock +0 -0
  112. package/android/.gradle/5.4.1/gc.properties +0 -0
  113. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  114. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  115. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  116. package/android/.gradle/vcs-1/gc.properties +0 -0
  117. package/android/.idea/caches/build_file_checksums.ser +0 -0
  118. package/android/.idea/caches/gradle_models.ser +0 -0
  119. package/android/.idea/codeStyles/Project.xml +0 -116
  120. package/android/.idea/dictionaries/Adi.xml +0 -3
  121. package/android/.idea/gradle.xml +0 -16
  122. package/android/.idea/libraries/Gradle____local_aars____Users_Adi_ReactModule_AppICEReactLibrary_android_libs_AppICE_SDK_v2_4_18_jar_unspecified_jar.xml +0 -9
  123. package/android/.idea/libraries/Gradle____local_aars____Users_Adi_ReactModule_AppICEReactLibrary_android_libs_logutility_jar_unspecified_jar.xml +0 -9
  124. package/android/.idea/libraries/Gradle__android_arch_core_common_1_0_0_jar.xml +0 -11
  125. package/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_0_0_jar.xml +0 -11
  126. package/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml +0 -12
  127. package/android/.idea/libraries/Gradle__com_android_support_appcompat_v7_23_0_1_aar.xml +0 -15
  128. package/android/.idea/libraries/Gradle__com_android_support_customtabs_26_1_0_aar.xml +0 -12
  129. package/android/.idea/libraries/Gradle__com_android_support_recyclerview_v7_23_0_1_aar.xml +0 -12
  130. package/android/.idea/libraries/Gradle__com_android_support_support_annotations_23_0_1_jar.xml +0 -11
  131. package/android/.idea/libraries/Gradle__com_android_support_support_annotations_26_1_0_jar.xml +0 -11
  132. package/android/.idea/libraries/Gradle__com_android_support_support_compat_26_1_0_aar.xml +0 -12
  133. package/android/.idea/libraries/Gradle__com_android_support_support_core_ui_26_1_0_aar.xml +0 -12
  134. package/android/.idea/libraries/Gradle__com_android_support_support_core_utils_26_1_0_aar.xml +0 -12
  135. package/android/.idea/libraries/Gradle__com_android_support_support_fragment_26_1_0_aar.xml +0 -12
  136. package/android/.idea/libraries/Gradle__com_android_support_support_media_compat_26_1_0_aar.xml +0 -12
  137. package/android/.idea/libraries/Gradle__com_android_support_support_v4_23_0_1_aar.xml +0 -16
  138. package/android/.idea/libraries/Gradle__com_android_support_support_v4_26_1_0_aar.xml +0 -12
  139. package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_0_8_1_aar.xml +0 -12
  140. package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_0_8_1_aar.xml +0 -12
  141. package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_0_8_1_aar.xml +0 -12
  142. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_0_8_1_aar.xml +0 -12
  143. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp_0_8_1_aar.xml +0 -12
  144. package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_20_1_aar.xml +0 -16
  145. package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_2_0_jar.xml +0 -11
  146. package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_okhttp_1_2_0_jar.xml +0 -11
  147. package/android/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_2_3_jar.xml +0 -11
  148. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_16_0_0_aar.xml +0 -10
  149. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_base_16_0_0_aar.xml +0 -10
  150. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_identifier_16_0_0_aar.xml +0 -10
  151. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_lite_16_0_0_aar.xml +0 -10
  152. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_base_16_0_1_aar.xml +0 -10
  153. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_basement_16_2_0_aar.xml +0 -12
  154. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_gass_16_0_0_aar.xml +0 -10
  155. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_location_16_0_0_aar.xml +0 -10
  156. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_16_5_0_aar.xml +0 -12
  157. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_api_16_5_0_aar.xml +0 -12
  158. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_base_16_5_0_aar.xml +0 -12
  159. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_impl_16_5_0_aar.xml +0 -12
  160. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_sdk_16_5_0_aar.xml +0 -12
  161. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_measurement_sdk_api_16_5_0_aar.xml +0 -12
  162. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_places_placereport_16_0_0_aar.xml +0 -10
  163. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_stats_16_0_1_aar.xml +0 -10
  164. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_tasks_16_0_1_aar.xml +0 -10
  165. package/android/.idea/libraries/Gradle__com_google_auto_value_auto_value_annotations_1_6_3_jar.xml +0 -13
  166. package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_0_jar.xml +0 -11
  167. package/android/.idea/libraries/Gradle__com_google_firebase_firebase_analytics_16_5_0_aar.xml +0 -12
  168. package/android/.idea/libraries/Gradle__com_google_firebase_firebase_common_17_0_0_aar.xml +0 -12
  169. package/android/.idea/libraries/Gradle__com_google_firebase_firebase_core_16_0_9_aar.xml +0 -12
  170. package/android/.idea/libraries/Gradle__com_google_firebase_firebase_iid_18_0_0_aar.xml +0 -12
  171. package/android/.idea/libraries/Gradle__com_google_firebase_firebase_iid_interop_16_0_1_aar.xml +0 -10
  172. package/android/.idea/libraries/Gradle__com_google_firebase_firebase_measurement_connector_17_0_1_aar.xml +0 -10
  173. package/android/.idea/libraries/Gradle__com_google_firebase_firebase_messaging_18_0_0_aar.xml +0 -12
  174. package/android/.idea/libraries/Gradle__com_nineoldandroids_library_2_4_0_jar.xml +0 -11
  175. package/android/.idea/libraries/Gradle__com_parse_bolts_bolts_android_1_1_4_jar.xml +0 -11
  176. package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_2_5_0_jar.xml +0 -11
  177. package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_ws_2_5_0_jar.xml +0 -11
  178. package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_6_0_jar.xml +0 -11
  179. package/android/.idea/libraries/Gradle__commons_cli_commons_cli_1_2_jar.xml +0 -11
  180. package/android/.idea/libraries/Gradle__org_webkit_android_jsc_r174650_aar.xml +0 -10
  181. package/android/.idea/misc.xml +0 -23
  182. package/android/.idea/modules.xml +0 -8
  183. package/android/.idea/runConfigurations.xml +0 -12
  184. package/android/.idea/workspace.xml +0 -322
  185. package/android/build/generated/source/buildConfig/androidTest/debug/com/reactlibrary/test/BuildConfig.java +0 -13
  186. package/android/build/generated/source/buildConfig/debug/com/reactlibrary/BuildConfig.java +0 -13
  187. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -170
  188. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +0 -1
  189. package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -170
  190. package/android/build/intermediates/merged_manifests/debug/output.json +0 -1
  191. package/android/build/intermediates/merged_manifests/debugAndroidTest/AndroidManifest.xml +0 -250
  192. package/android/build/intermediates/merged_manifests/debugAndroidTest/output.json +0 -1
  193. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -307
  194. package/android/libs/AppICE_SDK_v2.4.18.jar +0 -0
  195. package/ios/.DS_Store +0 -0
  196. package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib +0 -0
  197. package/ios/AppICESDK/include/iosAppiceSDK/appICEDB.h +0 -52
@@ -0,0 +1,29 @@
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\plugin_codelab\\example"
5
+ },
6
+ {
7
+ "path": "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\plugin_appice"
8
+ },
9
+ {
10
+ "path": "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\Cordova samples\\Cordova samples\\cordova-plugin-appice"
11
+ },
12
+ {
13
+ "path": "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\Downloads\\inapp_image_picker-0.0.1"
14
+ },
15
+ {
16
+ "path": "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\Downloads\\firebase_storage-10.2.4"
17
+ },
18
+ {
19
+ "path": "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\clevertap-flutter"
20
+ },
21
+ {
22
+ "path": "..\\..\\..\\..\\..\\..\\..\\.."
23
+ },
24
+ {
25
+ "path": "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\Cordova samples\\Cordova samples"
26
+ }
27
+ ],
28
+ "settings": {}
29
+ }
package/example/App.js ADDED
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Sample React Native App
3
+ * https://github.com/facebook/react-native
4
+ *
5
+ * @format
6
+ * @flow strict-local
7
+ */
8
+
9
+ import React from 'react';
10
+ import { Alert,
11
+ Text,
12
+ Platform,
13
+ Image,
14
+ Linking,
15
+ Button,
16
+ View
17
+ } from 'react-native';
18
+
19
+ const AppICE = require('reactnative-plugin-appice');
20
+ const HelloWorldApp = () => {
21
+ const certs = [];
22
+ if (AppICE) {
23
+ console.log('AppICE is available');
24
+ AppICE.startContext(
25
+ // '5bebe93c25d705690ffbc758',
26
+ // '9e9ec60197c8373a11ac15ce4dae80e973608ab2',
27
+ // 'd985715d1bb48942d36d5d08de3b6a8c',
28
+ // '7a55ba2f-52c3-4d88-917d-0365e2f7c9cf',
29
+ // "US",
30
+ // "https://stagingapi.appice.io",
31
+ "5bebe93c25d705690ffbc758",
32
+ "9e9ec60197c8373a11ac15ce4dae80e973608ab2",
33
+ "844770e0edf3b795cd7508fa71789572",
34
+ "",
35
+ "US",
36
+ "https://a.appice.io",
37
+
38
+ certs);
39
+ }
40
+ addAppICEAPIListeners();
41
+ return (
42
+ <View
43
+ style={{
44
+ flex: 1,
45
+ justifyContent: "center",
46
+ alignItems: "center",
47
+ marginBottom: 10,
48
+
49
+ }}>
50
+ <Text>AppICE React Demo</Text>
51
+ <Button
52
+ onPress={sendEvent}
53
+ title="Send Event"
54
+ color="#841584"
55
+
56
+ />
57
+ <View
58
+ >
59
+
60
+ </View>
61
+ <Button
62
+ onPress={setUserProfile}
63
+ title="set User Profile"
64
+ color="#841584"
65
+
66
+ />
67
+
68
+ <Button
69
+ onPress={setSampleUserID}
70
+ title="set Sample User ID"
71
+ color="#841584"
72
+
73
+ />
74
+ <Button
75
+ onPress={setLanguage}
76
+ title="set Language"
77
+ color="#841584"
78
+
79
+ />
80
+ <Button
81
+ onPress={sendView}
82
+ title="Send View"
83
+ color="#841584"
84
+
85
+ />
86
+ </View>
87
+ )
88
+
89
+ }
90
+
91
+ function addAppICEAPIListeners() {
92
+ AppICE.addListener(AppICE.AppICEPushNotificationClicked, (event) => {
93
+ if (typeof event !== 'undefined'){
94
+ console.log('handleAppICETapEvent', AppICE.AppICEPushNotificationClicked, event.AppICEPushNotificationClicked);
95
+ AppICE.pushNotificationClicked( event.AppICEPushNotificationClicked);
96
+ }
97
+ });
98
+ }
99
+ const sendEvent = () => {
100
+ console.log("inside sendEvent");
101
+ var dataObj = {
102
+ "ClickedMenuBtn": "false",
103
+ "CLickedSubmitBtn": "false",
104
+ "AppName": "ReactSampleApp"
105
+ };
106
+ AppICE.tagEvent("ReactSampleApp", dataObj);
107
+ //Recording an Event
108
+ }
109
+
110
+
111
+ const setUserProfile = () => {
112
+ AppICE.setUser({
113
+ [AppICE.name]: 'testUserA1', [AppICE.phone]: '123456', [AppICE.email]: 'test@test.com', [AppICE.age]: 23
114
+ });
115
+ };
116
+
117
+ const setSampleUserID = () => {
118
+ AppICE.setUserId(['1232323','kuOEN8bCqdrROmJPVCeKSg==']);
119
+
120
+ };
121
+
122
+ const setLanguage = () => {
123
+ AppICE.setCustomVariable("_lang", "ar-AE");
124
+
125
+ };
126
+ const sendView = () => {
127
+ AppICE.tagEvent("HomeScreen", {});
128
+ }
129
+
130
+ export default HelloWorldApp;
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
+ ruby '2.7.5'
5
+
6
+ gem 'cocoapods', '~> 1.11', '>= 1.11.2'
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @format
3
+ */
4
+
5
+ import 'react-native';
6
+ import React from 'react';
7
+ import App from '../App';
8
+
9
+ // Note: test renderer must be required after react-native.
10
+ import renderer from 'react-test-renderer';
11
+
12
+ it('renders correctly', () => {
13
+ renderer.create(<App />);
14
+ });
@@ -0,0 +1,55 @@
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.example",
39
+ )
40
+
41
+ android_resource(
42
+ name = "res",
43
+ package = "com.example",
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
+ )
@@ -0,0 +1,320 @@
1
+ apply plugin: "com.android.application"
2
+
3
+ import com.android.build.OutputFile
4
+
5
+ /**
6
+ * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7
+ * and bundleReleaseJsAndAssets).
8
+ * These basically call `react-native bundle` with the correct arguments during the Android build
9
+ * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10
+ * bundle directly from the development server. Below you can see all the possible configurations
11
+ * and their defaults. If you decide to add a configuration block, make sure to add it before the
12
+ * `apply from: "../../node_modules/react-native/react.gradle"` line.
13
+ *
14
+ * project.ext.react = [
15
+ * // the name of the generated asset file containing your JS bundle
16
+ * bundleAssetName: "index.android.bundle",
17
+ *
18
+ * // the entry file for bundle generation. If none specified and
19
+ * // "index.android.js" exists, it will be used. Otherwise "index.js" is
20
+ * // default. Can be overridden with ENTRY_FILE environment variable.
21
+ * entryFile: "index.android.js",
22
+ *
23
+ * // https://reactnative.dev/docs/performance#enable-the-ram-format
24
+ * bundleCommand: "ram-bundle",
25
+ *
26
+ * // whether to bundle JS and assets in debug mode
27
+ * bundleInDebug: false,
28
+ *
29
+ * // whether to bundle JS and assets in release mode
30
+ * bundleInRelease: true,
31
+ *
32
+ * // whether to bundle JS and assets in another build variant (if configured).
33
+ * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
34
+ * // The configuration property can be in the following formats
35
+ * // 'bundleIn${productFlavor}${buildType}'
36
+ * // 'bundleIn${buildType}'
37
+ * // bundleInFreeDebug: true,
38
+ * // bundleInPaidRelease: true,
39
+ * // bundleInBeta: true,
40
+ *
41
+ * // whether to disable dev mode in custom build variants (by default only disabled in release)
42
+ * // for example: to disable dev mode in the staging build type (if configured)
43
+ * devDisabledInStaging: true,
44
+ * // The configuration property can be in the following formats
45
+ * // 'devDisabledIn${productFlavor}${buildType}'
46
+ * // 'devDisabledIn${buildType}'
47
+ *
48
+ * // the root of your project, i.e. where "package.json" lives
49
+ * root: "../../",
50
+ *
51
+ * // where to put the JS bundle asset in debug mode
52
+ * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
53
+ *
54
+ * // where to put the JS bundle asset in release mode
55
+ * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
56
+ *
57
+ * // where to put drawable resources / React Native assets, e.g. the ones you use via
58
+ * // require('./image.png')), in debug mode
59
+ * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
60
+ *
61
+ * // where to put drawable resources / React Native assets, e.g. the ones you use via
62
+ * // require('./image.png')), in release mode
63
+ * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
64
+ *
65
+ * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
66
+ * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
67
+ * // date; if you have any other folders that you want to ignore for performance reasons (gradle
68
+ * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
69
+ * // for example, you might want to remove it from here.
70
+ * inputExcludes: ["android/**", "ios/**"],
71
+ *
72
+ * // override which node gets called and with what additional arguments
73
+ * nodeExecutableAndArgs: ["node"],
74
+ *
75
+ * // supply additional arguments to the packager
76
+ * extraPackagerArgs: []
77
+ * ]
78
+ */
79
+
80
+ project.ext.react = [
81
+ enableHermes: false, // clean and rebuild if changing
82
+ ]
83
+
84
+ apply from: "../../node_modules/react-native/react.gradle"
85
+
86
+ /**
87
+ * Set this to true to create two separate APKs instead of one:
88
+ * - An APK that only works on ARM devices
89
+ * - An APK that only works on x86 devices
90
+ * The advantage is the size of the APK is reduced by about 4MB.
91
+ * Upload all the APKs to the Play Store and people will download
92
+ * the correct one based on the CPU architecture of their device.
93
+ */
94
+ def enableSeparateBuildPerCPUArchitecture = false
95
+
96
+ /**
97
+ * Run Proguard to shrink the Java bytecode in release builds.
98
+ */
99
+ def enableProguardInReleaseBuilds = false
100
+
101
+ /**
102
+ * The preferred build flavor of JavaScriptCore.
103
+ *
104
+ * For example, to use the international variant, you can use:
105
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
106
+ *
107
+ * The international variant includes ICU i18n library and necessary data
108
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
109
+ * give correct results when using with locales other than en-US. Note that
110
+ * this variant is about 6MiB larger per architecture than default.
111
+ */
112
+ def jscFlavor = 'org.webkit:android-jsc:+'
113
+
114
+ /**
115
+ * Whether to enable the Hermes VM.
116
+ *
117
+ * This should be set on project.ext.react and that value will be read here. If it is not set
118
+ * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
119
+ * and the benefits of using Hermes will therefore be sharply reduced.
120
+ */
121
+ def enableHermes = project.ext.react.get("enableHermes", false);
122
+
123
+ /**
124
+ * Architectures to build native code for.
125
+ */
126
+ def reactNativeArchitectures() {
127
+ def value = project.getProperties().get("reactNativeArchitectures")
128
+ return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
129
+ }
130
+
131
+ android {
132
+ ndkVersion rootProject.ext.ndkVersion
133
+
134
+ compileSdkVersion rootProject.ext.compileSdkVersion
135
+
136
+ defaultConfig {
137
+ applicationId "com.example"
138
+ minSdkVersion rootProject.ext.minSdkVersion
139
+ targetSdkVersion rootProject.ext.targetSdkVersion
140
+ versionCode 1
141
+ versionName "1.0"
142
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
143
+
144
+ if (isNewArchitectureEnabled()) {
145
+ // We configure the NDK build only if you decide to opt-in for the New Architecture.
146
+ externalNativeBuild {
147
+ ndkBuild {
148
+ arguments "APP_PLATFORM=android-21",
149
+ "APP_STL=c++_shared",
150
+ "NDK_TOOLCHAIN_VERSION=clang",
151
+ "GENERATED_SRC_DIR=$buildDir/generated/source",
152
+ "PROJECT_BUILD_DIR=$buildDir",
153
+ "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
154
+ "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
155
+ "NODE_MODULES_DIR=$rootDir/../node_modules"
156
+ cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
157
+ cppFlags "-std=c++17"
158
+ // Make sure this target name is the same you specify inside the
159
+ // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
160
+ targets "example_appmodules"
161
+ }
162
+ }
163
+ if (!enableSeparateBuildPerCPUArchitecture) {
164
+ ndk {
165
+ abiFilters (*reactNativeArchitectures())
166
+ }
167
+ }
168
+ }
169
+ }
170
+
171
+ if (isNewArchitectureEnabled()) {
172
+ // We configure the NDK build only if you decide to opt-in for the New Architecture.
173
+ externalNativeBuild {
174
+ ndkBuild {
175
+ path "$projectDir/src/main/jni/Android.mk"
176
+ }
177
+ }
178
+ def reactAndroidProjectDir = project(':ReactAndroid').projectDir
179
+ def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
180
+ dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
181
+ from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
182
+ into("$buildDir/react-ndk/exported")
183
+ }
184
+ def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
185
+ dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
186
+ from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
187
+ into("$buildDir/react-ndk/exported")
188
+ }
189
+ afterEvaluate {
190
+ // If you wish to add a custom TurboModule or component locally,
191
+ // you should uncomment this line.
192
+ // preBuild.dependsOn("generateCodegenArtifactsFromSchema")
193
+ preDebugBuild.dependsOn(packageReactNdkDebugLibs)
194
+ preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
195
+
196
+ // Due to a bug inside AGP, we have to explicitly set a dependency
197
+ // between configureNdkBuild* tasks and the preBuild tasks.
198
+ // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
199
+ configureNdkBuildRelease.dependsOn(preReleaseBuild)
200
+ configureNdkBuildDebug.dependsOn(preDebugBuild)
201
+ reactNativeArchitectures().each { architecture ->
202
+ tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
203
+ dependsOn("preDebugBuild")
204
+ }
205
+ tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
206
+ dependsOn("preReleaseBuild")
207
+ }
208
+ }
209
+ }
210
+ }
211
+
212
+ splits {
213
+ abi {
214
+ reset()
215
+ enable enableSeparateBuildPerCPUArchitecture
216
+ universalApk false // If true, also generate a universal APK
217
+ include (*reactNativeArchitectures())
218
+ }
219
+ }
220
+ signingConfigs {
221
+ debug {
222
+ storeFile file('debug.keystore')
223
+ storePassword 'android'
224
+ keyAlias 'androiddebugkey'
225
+ keyPassword 'android'
226
+ }
227
+ }
228
+ buildTypes {
229
+ debug {
230
+ signingConfig signingConfigs.debug
231
+ }
232
+ release {
233
+ // Caution! In production, you need to generate your own keystore file.
234
+ // see https://reactnative.dev/docs/signed-apk-android.
235
+ signingConfig signingConfigs.debug
236
+ minifyEnabled enableProguardInReleaseBuilds
237
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
238
+ }
239
+ }
240
+
241
+ // applicationVariants are e.g. debug, release
242
+ applicationVariants.all { variant ->
243
+ variant.outputs.each { output ->
244
+ // For each separate APK per architecture, set a unique version code as described here:
245
+ // https://developer.android.com/studio/build/configure-apk-splits.html
246
+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
247
+ def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
248
+ def abi = output.getFilter(OutputFile.ABI)
249
+ if (abi != null) { // null for the universal-debug, universal-release variants
250
+ output.versionCodeOverride =
251
+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)
252
+ }
253
+
254
+ }
255
+ }
256
+ }
257
+
258
+ dependencies {
259
+ implementation fileTree(dir: "libs", include: ["*.jar"])
260
+
261
+ //noinspection GradleDynamicVersion
262
+ implementation "com.facebook.react:react-native:+" // From node_modules
263
+
264
+ implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
265
+
266
+ debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
267
+ exclude group:'com.facebook.fbjni'
268
+ }
269
+
270
+ debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
271
+ exclude group:'com.facebook.flipper'
272
+ exclude group:'com.squareup.okhttp3', module:'okhttp'
273
+ }
274
+
275
+ debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
276
+ exclude group:'com.facebook.flipper'
277
+ }
278
+
279
+ if (enableHermes) {
280
+ //noinspection GradleDynamicVersion
281
+ implementation("com.facebook.react:hermes-engine:+") { // From node_modules
282
+ exclude group:'com.facebook.fbjni'
283
+ }
284
+ } else {
285
+ implementation jscFlavor
286
+ }
287
+ }
288
+
289
+ if (isNewArchitectureEnabled()) {
290
+ // If new architecture is enabled, we let you build RN from source
291
+ // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
292
+ // This will be applied to all the imported transtitive dependency.
293
+ configurations.all {
294
+ resolutionStrategy.dependencySubstitution {
295
+ substitute(module("com.facebook.react:react-native"))
296
+ .using(project(":ReactAndroid"))
297
+ .because("On New Architecture we're building React Native from source")
298
+ substitute(module("com.facebook.react:hermes-engine"))
299
+ .using(project(":ReactAndroid:hermes-engine"))
300
+ .because("On New Architecture we're building Hermes from source")
301
+ }
302
+ }
303
+ }
304
+
305
+ // Run this once to be able to run the application with BUCK
306
+ // puts all compile dependencies into folder libs for BUCK to use
307
+ task copyDownloadableDepsToLibs(type: Copy) {
308
+ from configurations.implementation
309
+ into 'libs'
310
+ }
311
+
312
+ apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
313
+
314
+ def isNewArchitectureEnabled() {
315
+ // To opt-in for the New Architecture, you can either:
316
+ // - Set `newArchEnabled` to true inside the `gradle.properties` file
317
+ // - Invoke gradle with `-newArchEnabled=true`
318
+ // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
319
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
320
+ }
@@ -0,0 +1,19 @@
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
+ )
@@ -0,0 +1,10 @@
1
+ # Add project specific ProGuard rules here.
2
+ # By default, the flags in this file are appended to flags specified
3
+ # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4
+ # You can edit the include path and order by changing the proguardFiles
5
+ # directive in build.gradle.
6
+ #
7
+ # For more details, see
8
+ # http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+ # Add any project specific keep options here:
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ xmlns:tools="http://schemas.android.com/tools">
4
+
5
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6
+
7
+ <application
8
+ android:usesCleartextTraffic="true"
9
+ tools:targetApi="28"
10
+ tools:ignore="GoogleAppIndexingWarning">
11
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12
+ </application>
13
+ </manifest>
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and 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.example;
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.ReactInstanceEventListener;
23
+ import com.facebook.react.ReactInstanceManager;
24
+ import com.facebook.react.bridge.ReactContext;
25
+ import com.facebook.react.modules.network.NetworkingModule;
26
+ import okhttp3.OkHttpClient;
27
+
28
+ public class ReactNativeFlipper {
29
+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
30
+ if (FlipperUtils.shouldEnableFlipper(context)) {
31
+ final FlipperClient client = AndroidFlipperClient.getInstance(context);
32
+
33
+ client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
34
+ client.addPlugin(new ReactFlipperPlugin());
35
+ client.addPlugin(new DatabasesFlipperPlugin(context));
36
+ client.addPlugin(new SharedPreferencesFlipperPlugin(context));
37
+ client.addPlugin(CrashReporterPlugin.getInstance());
38
+
39
+ NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
40
+ NetworkingModule.setCustomClientBuilder(
41
+ new NetworkingModule.CustomClientBuilder() {
42
+ @Override
43
+ public void apply(OkHttpClient.Builder builder) {
44
+ builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
45
+ }
46
+ });
47
+ client.addPlugin(networkFlipperPlugin);
48
+ client.start();
49
+
50
+ // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
51
+ // Hence we run if after all native modules have been initialized
52
+ ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
53
+ if (reactContext == null) {
54
+ reactInstanceManager.addReactInstanceEventListener(
55
+ new ReactInstanceEventListener() {
56
+ @Override
57
+ public void onReactContextInitialized(ReactContext reactContext) {
58
+ reactInstanceManager.removeReactInstanceEventListener(this);
59
+ reactContext.runOnNativeModulesQueueThread(
60
+ new Runnable() {
61
+ @Override
62
+ public void run() {
63
+ client.addPlugin(new FrescoFlipperPlugin());
64
+ }
65
+ });
66
+ }
67
+ });
68
+ } else {
69
+ client.addPlugin(new FrescoFlipperPlugin());
70
+ }
71
+ }
72
+ }
73
+ }