lemnisk-react-native 0.1.5 → 0.1.6

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 (45) hide show
  1. package/android/.gradle/6.5/executionHistory/executionHistory.bin +0 -0
  2. package/android/.gradle/6.5/executionHistory/executionHistory.lock +0 -0
  3. package/android/.gradle/6.5/fileChanges/last-build.bin +0 -0
  4. package/android/.gradle/6.5/fileContent/fileContent.lock +0 -0
  5. package/android/.gradle/6.5/fileHashes/fileHashes.bin +0 -0
  6. package/android/.gradle/6.5/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/6.5/fileHashes/resourceHashesCache.bin +0 -0
  8. package/android/.gradle/6.5/gc.properties +0 -0
  9. package/android/.gradle/6.5/javaCompile/javaCompile.lock +0 -0
  10. package/android/.gradle/6.7/executionHistory/executionHistory.bin +0 -0
  11. package/android/.gradle/6.7/executionHistory/executionHistory.lock +0 -0
  12. package/android/.gradle/6.7/fileHashes/fileHashes.bin +0 -0
  13. package/android/.gradle/6.7/fileHashes/fileHashes.lock +0 -0
  14. package/android/.gradle/6.7/fileHashes/resourceHashesCache.bin +0 -0
  15. package/android/.gradle/6.7/javaCompile/classAnalysis.bin +0 -0
  16. package/android/.gradle/6.7/javaCompile/jarAnalysis.bin +0 -0
  17. package/android/.gradle/6.7/javaCompile/javaCompile.lock +0 -0
  18. package/android/.gradle/6.7/javaCompile/taskHistory.bin +0 -0
  19. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  20. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  21. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  22. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  23. package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
  24. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  25. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  26. package/android/.gradle/7.4/gc.properties +0 -0
  27. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  28. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  29. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  30. package/android/.gradle/checksums/checksums.lock +0 -0
  31. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  32. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  33. package/android/build.gradle +13 -12
  34. package/android/gradle.properties +22 -0
  35. package/android/gradlew.bat +0 -15
  36. package/android/src/main/java/com/reactnativelemnisksdk/LemniskSdkModule.java +32 -18
  37. package/lemnisk-react-native.podspec +1 -1
  38. package/lib/commonjs/index.js +3 -0
  39. package/lib/commonjs/index.js.map +1 -1
  40. package/lib/module/index.js +3 -0
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/typescript/index.d.ts +1 -0
  43. package/package.json +3 -3
  44. package/src/index.tsx +9 -1
  45. package/android/local.properties +0 -1
File without changes
File without changes
@@ -1,2 +1,2 @@
1
- #Wed Jan 18 20:34:56 IST 2023
1
+ #Tue Jun 13 16:36:43 IST 2023
2
2
  gradle.version=6.7
@@ -1,3 +1,4 @@
1
+
1
2
  buildscript {
2
3
  if (project == rootProject) {
3
4
  repositories {
@@ -6,7 +7,7 @@ buildscript {
6
7
  }
7
8
 
8
9
  dependencies {
9
- classpath 'com.android.tools.build:gradle:3.5.3'
10
+ classpath 'com.android.tools.build:gradle:4.1.0'
10
11
  }
11
12
  }
12
13
  }
@@ -18,11 +19,11 @@ def safeExtGet(prop, fallback) {
18
19
  }
19
20
 
20
21
  android {
21
- compileSdkVersion safeExtGet('LemniskSdk_compileSdkVersion', 31)
22
+ compileSdkVersion safeExtGet('LemniskSdk_compileSdkVersion', 33)
22
23
  buildToolsVersion safeExtGet('LemniskSdk_buildToolsVersion', '30.0.2')
23
24
  defaultConfig {
24
- minSdkVersion safeExtGet('LemniskSdk_minSdkVersion', 16)
25
- targetSdkVersion safeExtGet('LemniskSdk_targetSdkVersion', 31)
25
+ minSdkVersion safeExtGet('LemniskSdk_minSdkVersion', 21)
26
+ targetSdkVersion safeExtGet('LemniskSdk_targetSdkVersion', 33)
26
27
  versionCode 1
27
28
  versionName "1.0"
28
29
 
@@ -54,18 +55,18 @@ repositories {
54
55
 
55
56
  dependencies {
56
57
  //noinspection GradleDynamicVersion
57
- implementation 'androidx.appcompat:appcompat:1.3.0'
58
- implementation 'androidx.core:core-ktx:1.6.0'
59
58
  implementation "com.facebook.react:react-native:+" // From node_modules
60
- implementation 'co.lemnisk.app.android:AndroidSDK:1.1.28'
59
+ implementation 'co.lemnisk.app.android:AndroidSDK:1.1.30'
61
60
  //implementation(name:'AndroidSDK-release', ext:'aar')
62
61
  implementation group: 'joda-time', name: 'joda-time', version: '2.10.10'
63
- implementation 'com.google.android.gms:play-services-base:17.6.0'
62
+ implementation 'com.google.android.gms:play-services-base:18.2.0'
64
63
  implementation platform('com.google.firebase:firebase-bom:28.2.0')
65
64
  implementation 'com.google.firebase:firebase-messaging'
66
- implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
65
+ implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
67
66
  implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
68
- implementation "androidx.lifecycle:lifecycle-runtime:2.3.0"
69
- implementation 'android.arch.lifecycle:common-java8:1.1.0'
70
- implementation "androidx.work:work-runtime:2.7.1"
67
+ implementation 'androidx.work:work-runtime:2.8.0'
68
+ implementation 'com.google.code.gson:gson:2.3.1'
69
+ implementation 'androidx.lifecycle:lifecycle-process:2.5.1'
70
+ implementation 'androidx.lifecycle:lifecycle-common-java8:2.5.1'
71
+
71
72
  }
@@ -0,0 +1,22 @@
1
+ # Project-wide Gradle settings.
2
+
3
+ # IDE (e.g. Android Studio) users:
4
+ # Gradle settings configured through the IDE *will override*
5
+ # any settings specified in this file.
6
+
7
+ # For more details on how to configure your build environment visit
8
+ # http://www.gradle.org/docs/current/userguide/build_environment.html
9
+
10
+ # Specifies the JVM arguments used for the daemon process.
11
+ # The setting is particularly useful for tweaking memory settings.
12
+ # Default value: -Xmx10248m -XX:MaxPermSize=256m
13
+ # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14
+
15
+ # When configured, Gradle will run in incubating parallel mode.
16
+ # This option should only be used with decoupled projects. More details, visit
17
+ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18
+ # org.gradle.parallel=true
19
+ org.gradle.jvmargs=-Xmx3000m
20
+ android.useAndroidX=true
21
+ android.enableJetifier=true
22
+ FLIPPER_VERSION=0.54.0
@@ -40,11 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
40
40
 
41
41
  set JAVA_EXE=java.exe
42
42
  %JAVA_EXE% -version >NUL 2>&1
43
- <<<<<<< HEAD:ios-swift-sdk/Examples/LemniskReactDemo/android/gradlew.bat
44
- if "%ERRORLEVEL%" == "0" goto execute
45
- =======
46
43
  if "%ERRORLEVEL%" == "0" goto init
47
- >>>>>>> master:react-native/android/gradlew.bat
48
44
 
49
45
  echo.
50
46
  echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -58,11 +54,7 @@ goto fail
58
54
  set JAVA_HOME=%JAVA_HOME:"=%
59
55
  set JAVA_EXE=%JAVA_HOME%/bin/java.exe
60
56
 
61
- <<<<<<< HEAD:ios-swift-sdk/Examples/LemniskReactDemo/android/gradlew.bat
62
- if exist "%JAVA_EXE%" goto execute
63
- =======
64
57
  if exist "%JAVA_EXE%" goto init
65
- >>>>>>> master:react-native/android/gradlew.bat
66
58
 
67
59
  echo.
68
60
  echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -72,8 +64,6 @@ echo location of your Java installation.
72
64
 
73
65
  goto fail
74
66
 
75
- <<<<<<< HEAD:ios-swift-sdk/Examples/LemniskReactDemo/android/gradlew.bat
76
- =======
77
67
  :init
78
68
  @rem Get command-line arguments, handling Windows variants
79
69
 
@@ -89,7 +79,6 @@ if "x%~1" == "x" goto execute
89
79
 
90
80
  set CMD_LINE_ARGS=%*
91
81
 
92
- >>>>>>> master:react-native/android/gradlew.bat
93
82
  :execute
94
83
  @rem Setup the command line
95
84
 
@@ -97,11 +86,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
97
86
 
98
87
 
99
88
  @rem Execute Gradle
100
- <<<<<<< HEAD:ios-swift-sdk/Examples/LemniskReactDemo/android/gradlew.bat
101
- "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
102
- =======
103
89
  "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
104
- >>>>>>> master:react-native/android/gradlew.bat
105
90
 
106
91
  :end
107
92
  @rem End local scope for the variables with windows NT shell
@@ -1,10 +1,7 @@
1
1
  package com.reactnativelemnisksdk;
2
- import com.facebook.react.bridge.UiThreadUtil;
3
-
4
-
5
2
 
6
3
  import android.util.Log;
7
-
4
+ import android.app.Activity;
8
5
  import androidx.annotation.NonNull;
9
6
 
10
7
  import com.facebook.react.bridge.Promise;
@@ -16,7 +13,7 @@ import com.facebook.react.module.annotations.ReactModule;
16
13
  import com.google.android.gms.tasks.OnSuccessListener;
17
14
  import com.google.android.gms.tasks.Task;
18
15
  import com.google.firebase.messaging.FirebaseMessaging;
19
-
16
+ import javax.annotation.Nullable;
20
17
  import org.json.JSONObject;
21
18
  import java.util.Iterator;
22
19
 
@@ -26,21 +23,20 @@ import co.lemnisk.app.android.LemniskHelper;
26
23
  @ReactModule(name = LemniskSdkModule.NAME)
27
24
  public class LemniskSdkModule extends ReactContextBaseJavaModule {
28
25
  public static final String NAME = "LemniskSdk";
26
+ private ReactApplicationContext reactContext;
29
27
 
30
28
  public LemniskSdkModule(ReactApplicationContext reactContext) {
31
29
  super(reactContext);
32
- UiThreadUtil.runOnUiThread(new Runnable() {
33
- public void run(){
34
- LemniskHelper helper = LemniskHelper.getInstance(reactContext);
35
- Task<String> task = FirebaseMessaging.getInstance().getToken();
36
- task.addOnSuccessListener(new OnSuccessListener<String>() {
37
- @Override
38
- public void onSuccess(@NonNull String s) {
39
- Log.d("Firebase Token","onSuccess ========> : "+s);
40
- helper.setGCMToken(s);
41
- helper.init();
42
- }
43
- });
30
+ this.reactContext = reactContext;
31
+ LemniskHelper helper = LemniskHelper.getInstance(reactContext);
32
+
33
+ Task<String> task = FirebaseMessaging.getInstance().getToken();
34
+ task.addOnSuccessListener(new OnSuccessListener<String>() {
35
+ @Override
36
+ public void onSuccess(@NonNull String s) {
37
+ Log.d("Firebase Token","onSuccess ========> : "+s);
38
+ helper.setGCMToken(s);
39
+ helper.init();
44
40
  }
45
41
  });
46
42
  }
@@ -115,6 +111,24 @@ public class LemniskSdkModule extends ReactContextBaseJavaModule {
115
111
  }
116
112
  }
117
113
 
114
+ @ReactMethod
115
+ public void registerForPush( String title, String message){
116
+ Activity activity = reactContext.getCurrentActivity();
117
+ try{
118
+ if(title != null && message != null){
119
+ Log.d("Lemnisk: ", "registerForPushNotifications");
120
+ LemniskHelper.getInstance(getReactApplicationContext()).registerForPushNotifications(activity, title, message);
121
+ }
122
+ else{
123
+ Log.d("Lemnisk: ", "Default registerForPushNotifications");
124
+ LemniskHelper.getInstance(getReactApplicationContext()).registerForPushNotifications(activity);
125
+ }
126
+
127
+ }
128
+ catch (Exception e) {
129
+ Log.e("Lemnisk", "Exception in registerForPushNotifications", e);
130
+ }
131
+ }
118
132
 
119
133
  // Example method
120
134
  // See https://reactnative.dev/docs/native-modules-android
@@ -136,7 +150,7 @@ public class LemniskSdkModule extends ReactContextBaseJavaModule {
136
150
  LemniskHelper.getInstance(getReactApplicationContext()).logEvent(name, builder.build());
137
151
  }
138
152
  } catch (Exception e) {
139
- Log.e("TAG", "Exception in createLemniskEvent", e);
153
+ Log.e("Lemnisk", "Exception in createLemniskEvent", e);
140
154
  }
141
155
  }
142
156
 
@@ -17,5 +17,5 @@ Pod::Spec.new do |s|
17
17
  s.source_files = 'ios/**/*.{h,m,mm}'
18
18
 
19
19
  s.dependency 'React-Core'
20
- s.dependency 'Lemnisk-iOS-SDK', '3.8.5'
20
+ s.dependency 'Lemnisk-iOS-SDK', '3.7.1'
21
21
  end
@@ -8,6 +8,9 @@ var _reactNative = require("react-native");
8
8
  const {
9
9
  LemniskSdk
10
10
  } = _reactNative.NativeModules;
11
+ LemniskSdk.registerForPushNotifications = (title, message) => {
12
+ LemniskSdk.registerForPush(title, message);
13
+ };
11
14
  var _default = LemniskSdk;
12
15
  exports.default = _default;
13
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LemniskSdk","NativeModules"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n\ntype LemniskSdkType = {\n createLemniskEvent(name: string, object: object): any;\n track(eventName: string, properties: object, otherIds: object): any;\n screen(name: string, properties: object, otherIds: object): any;\n identify(userId: string, properties: object, otherIds: object): any;\n};\n\nconst { LemniskSdk } = NativeModules;\n\nexport default LemniskSdk as LemniskSdkType;\n"],"mappings":";;;;;;AAAA;AASA,MAAM;EAAEA;AAAW,CAAC,GAAGC,0BAAa;AAAC,eAEtBD,UAAU;AAAA"}
1
+ {"version":3,"names":["_reactNative","require","LemniskSdk","NativeModules","registerForPushNotifications","title","message","registerForPush","_default","exports","default"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n\nconst { LemniskSdk } = NativeModules;\n\n\nLemniskSdk.registerForPushNotifications = (title: string, message: string)=>{\n LemniskSdk.registerForPush(title, message);\n}\n\ntype LemniskSdkType = {\n createLemniskEvent(name: string, object: object): any;\n track(eventName: string, properties: object, otherIds: object): any;\n screen(name: string, properties: object, otherIds: object): any;\n identify(userId: string, properties: object, otherIds: object): any;\n registerForPushNotifications( title?: string, message?: string): any ;\n \n};\n\n\nexport default LemniskSdk as LemniskSdkType;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAM;EAAEC;AAAW,CAAC,GAAGC,0BAAa;AAGpCD,UAAU,CAACE,4BAA4B,GAAG,CAACC,KAAa,EAAEC,OAAe,KAAG;EAC1EJ,UAAU,CAACK,eAAe,CAACF,KAAK,EAAEC,OAAO,CAAC;AAC5C,CAAC;AAAA,IAAAE,QAAA,GAYcN,UAAU;AAAAO,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -2,5 +2,8 @@ import { NativeModules } from 'react-native';
2
2
  const {
3
3
  LemniskSdk
4
4
  } = NativeModules;
5
+ LemniskSdk.registerForPushNotifications = (title, message) => {
6
+ LemniskSdk.registerForPush(title, message);
7
+ };
5
8
  export default LemniskSdk;
6
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","LemniskSdk"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n\ntype LemniskSdkType = {\n createLemniskEvent(name: string, object: object): any;\n track(eventName: string, properties: object, otherIds: object): any;\n screen(name: string, properties: object, otherIds: object): any;\n identify(userId: string, properties: object, otherIds: object): any;\n};\n\nconst { LemniskSdk } = NativeModules;\n\nexport default LemniskSdk as LemniskSdkType;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAS5C,MAAM;EAAEC;AAAW,CAAC,GAAGD,aAAa;AAEpC,eAAeC,UAAU"}
1
+ {"version":3,"names":["NativeModules","LemniskSdk","registerForPushNotifications","title","message","registerForPush"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules } from 'react-native';\n\nconst { LemniskSdk } = NativeModules;\n\n\nLemniskSdk.registerForPushNotifications = (title: string, message: string)=>{\n LemniskSdk.registerForPush(title, message);\n}\n\ntype LemniskSdkType = {\n createLemniskEvent(name: string, object: object): any;\n track(eventName: string, properties: object, otherIds: object): any;\n screen(name: string, properties: object, otherIds: object): any;\n identify(userId: string, properties: object, otherIds: object): any;\n registerForPushNotifications( title?: string, message?: string): any ;\n \n};\n\n\nexport default LemniskSdk as LemniskSdkType;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAE5C,MAAM;EAAEC;AAAW,CAAC,GAAGD,aAAa;AAGpCC,UAAU,CAACC,4BAA4B,GAAG,CAACC,KAAa,EAAEC,OAAe,KAAG;EAC1EH,UAAU,CAACI,eAAe,CAACF,KAAK,EAAEC,OAAO,CAAC;AAC5C,CAAC;AAYD,eAAeH,UAAU"}
@@ -3,6 +3,7 @@ type LemniskSdkType = {
3
3
  track(eventName: string, properties: object, otherIds: object): any;
4
4
  screen(name: string, properties: object, otherIds: object): any;
5
5
  identify(userId: string, properties: object, otherIds: object): any;
6
+ registerForPushNotifications(title?: string, message?: string): any;
6
7
  };
7
8
  declare const _default: LemniskSdkType;
8
9
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lemnisk-react-native",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "plugin to setup the lemnisk sdk on both android and ios platform",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -61,8 +61,8 @@
61
61
  "jetifier": "^2.0.0",
62
62
  "pod-install": "^0.1.0",
63
63
  "prettier": "^2.0.5",
64
- "react": "16.13.1",
65
- "react-native": "0.63.4",
64
+ "react": "17.0.1",
65
+ "react-native": "0.64.1",
66
66
  "react-native-builder-bob": "^0.18.0",
67
67
  "release-it": "^14.2.2",
68
68
  "typescript": "^4.1.3"
package/src/index.tsx CHANGED
@@ -1,12 +1,20 @@
1
1
  import { NativeModules } from 'react-native';
2
2
 
3
+ const { LemniskSdk } = NativeModules;
4
+
5
+
6
+ LemniskSdk.registerForPushNotifications = (title: string, message: string)=>{
7
+ LemniskSdk.registerForPush(title, message);
8
+ }
9
+
3
10
  type LemniskSdkType = {
4
11
  createLemniskEvent(name: string, object: object): any;
5
12
  track(eventName: string, properties: object, otherIds: object): any;
6
13
  screen(name: string, properties: object, otherIds: object): any;
7
14
  identify(userId: string, properties: object, otherIds: object): any;
15
+ registerForPushNotifications( title?: string, message?: string): any ;
16
+
8
17
  };
9
18
 
10
- const { LemniskSdk } = NativeModules;
11
19
 
12
20
  export default LemniskSdk as LemniskSdkType;
@@ -1 +0,0 @@
1
- sdk.dir=/Users/sarvesh/Library/Android/sdk