lemnisk-react-native 0.1.5 → 0.1.7

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 (35) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +121 -121
  3. package/android/.gradle/6.7/executionHistory/executionHistory.lock +0 -0
  4. package/android/.gradle/6.7/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  7. package/android/.gradle/checksums/checksums.lock +0 -0
  8. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  9. package/android/build.gradle +72 -71
  10. package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  11. package/android/gradle.properties +22 -0
  12. package/android/gradlew +185 -185
  13. package/android/src/main/AndroidManifest.xml +4 -4
  14. package/android/src/main/java/com/reactnativelemnisksdk/LemniskSdkModule.java +158 -144
  15. package/android/src/main/java/com/reactnativelemnisksdk/LemniskSdkPackage.java +28 -28
  16. package/ios/LemniskSdk.h +5 -5
  17. package/ios/LemniskSdk.m +38 -38
  18. package/lemnisk-react-native.podspec +21 -21
  19. package/lib/commonjs/index.js +3 -0
  20. package/lib/commonjs/index.js.map +1 -1
  21. package/lib/module/index.js +3 -0
  22. package/lib/module/index.js.map +1 -1
  23. package/lib/typescript/index.d.ts +9 -8
  24. package/package.json +156 -156
  25. package/src/index.tsx +20 -12
  26. package/android/.gradle/6.7/executionHistory/executionHistory.bin +0 -0
  27. package/android/.gradle/6.7/fileHashes/fileHashes.bin +0 -0
  28. package/android/.gradle/6.7/fileHashes/resourceHashesCache.bin +0 -0
  29. package/android/.gradle/6.7/javaCompile/classAnalysis.bin +0 -0
  30. package/android/.gradle/6.7/javaCompile/jarAnalysis.bin +0 -0
  31. package/android/.gradle/6.7/javaCompile/javaCompile.lock +0 -0
  32. package/android/.gradle/6.7/javaCompile/taskHistory.bin +0 -0
  33. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  34. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  35. package/android/local.properties +0 -1
@@ -1,144 +1,158 @@
1
- package com.reactnativelemnisksdk;
2
- import com.facebook.react.bridge.UiThreadUtil;
3
-
4
-
5
-
6
- import android.util.Log;
7
-
8
- import androidx.annotation.NonNull;
9
-
10
- import com.facebook.react.bridge.Promise;
11
- import com.facebook.react.bridge.ReactApplicationContext;
12
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
13
- import com.facebook.react.bridge.ReactMethod;
14
- import com.facebook.react.bridge.ReadableMap;
15
- import com.facebook.react.module.annotations.ReactModule;
16
- import com.google.android.gms.tasks.OnSuccessListener;
17
- import com.google.android.gms.tasks.Task;
18
- import com.google.firebase.messaging.FirebaseMessaging;
19
-
20
- import org.json.JSONObject;
21
- import java.util.Iterator;
22
-
23
- import co.lemnisk.app.android.AttributeBuilder;
24
- import co.lemnisk.app.android.LemniskHelper;
25
-
26
- @ReactModule(name = LemniskSdkModule.NAME)
27
- public class LemniskSdkModule extends ReactContextBaseJavaModule {
28
- public static final String NAME = "LemniskSdk";
29
-
30
- public LemniskSdkModule(ReactApplicationContext reactContext) {
31
- 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
- });
44
- }
45
- });
46
- }
47
-
48
- @Override
49
- @NonNull
50
- public String getName() {
51
- return NAME;
52
- }
53
-
54
- @ReactMethod
55
- private AttributeBuilder getAttributeBuilderFromMap(ReadableMap object) {
56
- try {
57
- JSONObject attr = new JSONObject(object.toString());
58
- AttributeBuilder.Builder builder = new AttributeBuilder.Builder();
59
- if (attr.has("NativeMap")) {
60
- JSONObject nativeMap = attr.getJSONObject("NativeMap");
61
- Iterator<String> keys = nativeMap.keys();
62
- while (keys.hasNext()) {
63
- String key = keys.next();
64
- builder.addAttribute(key, nativeMap.get(key).toString());
65
- }
66
- }
67
- return builder.build();
68
- }
69
- catch (Exception e) {
70
- Log.e("TAG", "Exception in creating AttributeBuilder From ReadbleMap", e);
71
- AttributeBuilder.Builder builder = new AttributeBuilder.Builder();
72
- return builder.build();
73
- }
74
- }
75
-
76
- @ReactMethod
77
- public void track(String eventName, ReadableMap propertiesObject, ReadableMap otherIdsObject) {
78
- Log.d("TAG: ", "eventLogging: track: ");
79
- Log.d("TAG: ", "eventLogging: properties: " + propertiesObject.toString() + " otherIds: " + otherIdsObject.toString());
80
- try {
81
- AttributeBuilder propertiesBuilder = getAttributeBuilderFromMap(propertiesObject);
82
- AttributeBuilder otherIdsBuilder = getAttributeBuilderFromMap(otherIdsObject);
83
- LemniskHelper.getInstance(getReactApplicationContext()).track(eventName,propertiesBuilder,otherIdsBuilder);
84
- }
85
- catch (Exception e) {
86
- Log.e("TAG", "Exception in track event", e);
87
- }
88
- }
89
-
90
- @ReactMethod
91
- public void screen(String name, ReadableMap propertiesObject, ReadableMap otherIdsObject) {
92
- Log.d("TAG: ", "eventLogging: track: ");
93
- Log.d("TAG: ", "eventLogging: properties: " + propertiesObject.toString() + " otherIds: " + otherIdsObject.toString());
94
- try {
95
- AttributeBuilder propertiesBuilder = getAttributeBuilderFromMap(propertiesObject);
96
- AttributeBuilder otherIdsBuilder = getAttributeBuilderFromMap(otherIdsObject);
97
- LemniskHelper.getInstance(getReactApplicationContext()).screen(name,propertiesBuilder,otherIdsBuilder);
98
- }
99
- catch (Exception e) {
100
- Log.e("TAG", "Exception in screen event", e);
101
- }
102
- }
103
-
104
- @ReactMethod
105
- public void identify(String userId, ReadableMap propertiesObject, ReadableMap otherIdsObject) {
106
- Log.d("TAG: ", "eventLogging: track: ");
107
- Log.d("TAG: ", "eventLogging: properties: " + propertiesObject.toString() + " otherIds: " + otherIdsObject.toString());
108
- try {
109
- AttributeBuilder propertiesBuilder = getAttributeBuilderFromMap(propertiesObject);
110
- AttributeBuilder otherIdsBuilder = getAttributeBuilderFromMap(otherIdsObject);
111
- LemniskHelper.getInstance(getReactApplicationContext()).identify(userId,propertiesBuilder,otherIdsBuilder);
112
- }
113
- catch (Exception e) {
114
- Log.e("TAG", "Exception in identify event", e);
115
- }
116
- }
117
-
118
-
119
- // Example method
120
- // See https://reactnative.dev/docs/native-modules-android
121
- @ReactMethod
122
- public void createLemniskEvent(String name, ReadableMap object) {
123
- Log.d("TAG: ", "eventLogging: name: " + name);
124
- Log.d("TAG: ", "eventLogging: object: " + object.toString());
125
- try {
126
- JSONObject attr = new JSONObject(object.toString());
127
- if (attr.has("NativeMap")) {
128
- JSONObject nativeMap = attr.getJSONObject("NativeMap");
129
-
130
- AttributeBuilder.Builder builder = new AttributeBuilder.Builder();
131
- Iterator<String> keys = nativeMap.keys();
132
- while (keys.hasNext()) {
133
- String key = keys.next();
134
- builder.addAttribute(key, nativeMap.get(key).toString());
135
- }
136
- LemniskHelper.getInstance(getReactApplicationContext()).logEvent(name, builder.build());
137
- }
138
- } catch (Exception e) {
139
- Log.e("TAG", "Exception in createLemniskEvent", e);
140
- }
141
- }
142
-
143
- public static native int nativeMultiply(int a, int b);
144
- }
1
+ package com.reactnativelemnisksdk;
2
+
3
+ import android.util.Log;
4
+ import android.app.Activity;
5
+ import androidx.annotation.NonNull;
6
+
7
+ import com.facebook.react.bridge.Promise;
8
+ import com.facebook.react.bridge.ReactApplicationContext;
9
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
10
+ import com.facebook.react.bridge.ReactMethod;
11
+ import com.facebook.react.bridge.ReadableMap;
12
+ import com.facebook.react.module.annotations.ReactModule;
13
+ import com.google.android.gms.tasks.OnSuccessListener;
14
+ import com.google.android.gms.tasks.Task;
15
+ import com.google.firebase.messaging.FirebaseMessaging;
16
+ import javax.annotation.Nullable;
17
+ import org.json.JSONObject;
18
+ import java.util.Iterator;
19
+
20
+ import co.lemnisk.app.android.AttributeBuilder;
21
+ import co.lemnisk.app.android.LemniskHelper;
22
+
23
+ @ReactModule(name = LemniskSdkModule.NAME)
24
+ public class LemniskSdkModule extends ReactContextBaseJavaModule {
25
+ public static final String NAME = "LemniskSdk";
26
+ private ReactApplicationContext reactContext;
27
+
28
+ public LemniskSdkModule(ReactApplicationContext reactContext) {
29
+ super(reactContext);
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();
40
+ }
41
+ });
42
+ }
43
+
44
+ @Override
45
+ @NonNull
46
+ public String getName() {
47
+ return NAME;
48
+ }
49
+
50
+ @ReactMethod
51
+ private AttributeBuilder getAttributeBuilderFromMap(ReadableMap object) {
52
+ try {
53
+ JSONObject attr = new JSONObject(object.toString());
54
+ AttributeBuilder.Builder builder = new AttributeBuilder.Builder();
55
+ if (attr.has("NativeMap")) {
56
+ JSONObject nativeMap = attr.getJSONObject("NativeMap");
57
+ Iterator<String> keys = nativeMap.keys();
58
+ while (keys.hasNext()) {
59
+ String key = keys.next();
60
+ builder.addAttribute(key, nativeMap.get(key).toString());
61
+ }
62
+ }
63
+ return builder.build();
64
+ }
65
+ catch (Exception e) {
66
+ Log.e("TAG", "Exception in creating AttributeBuilder From ReadbleMap", e);
67
+ AttributeBuilder.Builder builder = new AttributeBuilder.Builder();
68
+ return builder.build();
69
+ }
70
+ }
71
+
72
+ @ReactMethod
73
+ public void track(String eventName, ReadableMap propertiesObject, ReadableMap otherIdsObject) {
74
+ Log.d("TAG: ", "eventLogging: track: ");
75
+ Log.d("TAG: ", "eventLogging: properties: " + propertiesObject.toString() + " otherIds: " + otherIdsObject.toString());
76
+ try {
77
+ AttributeBuilder propertiesBuilder = getAttributeBuilderFromMap(propertiesObject);
78
+ AttributeBuilder otherIdsBuilder = getAttributeBuilderFromMap(otherIdsObject);
79
+ LemniskHelper.getInstance(getReactApplicationContext()).track(eventName,propertiesBuilder,otherIdsBuilder);
80
+ }
81
+ catch (Exception e) {
82
+ Log.e("TAG", "Exception in track event", e);
83
+ }
84
+ }
85
+
86
+ @ReactMethod
87
+ public void screen(String name, ReadableMap propertiesObject, ReadableMap otherIdsObject) {
88
+ Log.d("TAG: ", "eventLogging: track: ");
89
+ Log.d("TAG: ", "eventLogging: properties: " + propertiesObject.toString() + " otherIds: " + otherIdsObject.toString());
90
+ try {
91
+ AttributeBuilder propertiesBuilder = getAttributeBuilderFromMap(propertiesObject);
92
+ AttributeBuilder otherIdsBuilder = getAttributeBuilderFromMap(otherIdsObject);
93
+ LemniskHelper.getInstance(getReactApplicationContext()).screen(name,propertiesBuilder,otherIdsBuilder);
94
+ }
95
+ catch (Exception e) {
96
+ Log.e("TAG", "Exception in screen event", e);
97
+ }
98
+ }
99
+
100
+ @ReactMethod
101
+ public void identify(String userId, ReadableMap propertiesObject, ReadableMap otherIdsObject) {
102
+ Log.d("TAG: ", "eventLogging: track: ");
103
+ Log.d("TAG: ", "eventLogging: properties: " + propertiesObject.toString() + " otherIds: " + otherIdsObject.toString());
104
+ try {
105
+ AttributeBuilder propertiesBuilder = getAttributeBuilderFromMap(propertiesObject);
106
+ AttributeBuilder otherIdsBuilder = getAttributeBuilderFromMap(otherIdsObject);
107
+ LemniskHelper.getInstance(getReactApplicationContext()).identify(userId,propertiesBuilder,otherIdsBuilder);
108
+ }
109
+ catch (Exception e) {
110
+ Log.e("TAG", "Exception in identify event", e);
111
+ }
112
+ }
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
+ }
132
+
133
+ // Example method
134
+ // See https://reactnative.dev/docs/native-modules-android
135
+ @ReactMethod
136
+ public void createLemniskEvent(String name, ReadableMap object) {
137
+ Log.d("TAG: ", "eventLogging: name: " + name);
138
+ Log.d("TAG: ", "eventLogging: object: " + object.toString());
139
+ try {
140
+ JSONObject attr = new JSONObject(object.toString());
141
+ if (attr.has("NativeMap")) {
142
+ JSONObject nativeMap = attr.getJSONObject("NativeMap");
143
+
144
+ AttributeBuilder.Builder builder = new AttributeBuilder.Builder();
145
+ Iterator<String> keys = nativeMap.keys();
146
+ while (keys.hasNext()) {
147
+ String key = keys.next();
148
+ builder.addAttribute(key, nativeMap.get(key).toString());
149
+ }
150
+ LemniskHelper.getInstance(getReactApplicationContext()).logEvent(name, builder.build());
151
+ }
152
+ } catch (Exception e) {
153
+ Log.e("Lemnisk", "Exception in createLemniskEvent", e);
154
+ }
155
+ }
156
+
157
+ public static native int nativeMultiply(int a, int b);
158
+ }
@@ -1,28 +1,28 @@
1
- package com.reactnativelemnisksdk;
2
-
3
- import androidx.annotation.NonNull;
4
-
5
- import com.facebook.react.ReactPackage;
6
- import com.facebook.react.bridge.NativeModule;
7
- import com.facebook.react.bridge.ReactApplicationContext;
8
- import com.facebook.react.uimanager.ViewManager;
9
-
10
- import java.util.ArrayList;
11
- import java.util.Collections;
12
- import java.util.List;
13
-
14
- public class LemniskSdkPackage implements ReactPackage {
15
- @NonNull
16
- @Override
17
- public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
18
- List<NativeModule> modules = new ArrayList<>();
19
- modules.add(new LemniskSdkModule(reactContext));
20
- return modules;
21
- }
22
-
23
- @NonNull
24
- @Override
25
- public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
26
- return Collections.emptyList();
27
- }
28
- }
1
+ package com.reactnativelemnisksdk;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.facebook.react.ReactPackage;
6
+ import com.facebook.react.bridge.NativeModule;
7
+ import com.facebook.react.bridge.ReactApplicationContext;
8
+ import com.facebook.react.uimanager.ViewManager;
9
+
10
+ import java.util.ArrayList;
11
+ import java.util.Collections;
12
+ import java.util.List;
13
+
14
+ public class LemniskSdkPackage implements ReactPackage {
15
+ @NonNull
16
+ @Override
17
+ public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
18
+ List<NativeModule> modules = new ArrayList<>();
19
+ modules.add(new LemniskSdkModule(reactContext));
20
+ return modules;
21
+ }
22
+
23
+ @NonNull
24
+ @Override
25
+ public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
26
+ return Collections.emptyList();
27
+ }
28
+ }
package/ios/LemniskSdk.h CHANGED
@@ -1,5 +1,5 @@
1
- #import <React/RCTBridgeModule.h>
2
-
3
- @interface LemniskSdk : NSObject <RCTBridgeModule>
4
-
5
- @end
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface LemniskSdk : NSObject <RCTBridgeModule>
4
+
5
+ @end
package/ios/LemniskSdk.m CHANGED
@@ -1,38 +1,38 @@
1
- #import "LemniskSdk.h"
2
- #import <Foundation/Foundation.h>
3
- #import <React/RCTLog.h>
4
- #import <Lemnisk/Lemnisk.h>
5
-
6
- @implementation LemniskSdk
7
-
8
- RCT_EXPORT_MODULE()
9
-
10
- // Example method
11
- // See // https://reactnative.dev/docs/native-modules-ios
12
- // RCT_REMAP_METHOD
13
- RCT_EXPORT_METHOD(createLemniskEvent:(NSString *)name object:(NSDictionary *)object) {
14
- RCTLogInfo(@"Logging Lemnisk Event %@ object %@ ", name, object);
15
- LemniskAnalytics *lemAnalytics = [LemniskAnalytics shared];
16
- [lemAnalytics logActivityWithName:name traits:object];
17
- }
18
-
19
- RCT_EXPORT_METHOD(identify:(NSString *)userId object:(NSDictionary *)traits object:(NSDictionary *)otherIds) {
20
- RCTLogInfo(@"Logging Lemnisk Identify event with userId %@, properties: %@, otherIds: %@", userId, traits, otherIds);
21
- [[Lemnisk shared] identify:userId traits:traits otherIds:otherIds];
22
- }
23
-
24
- RCT_EXPORT_METHOD(track:(NSString *)event object:(NSDictionary *)properties object:(NSDictionary *)otherIds) {
25
- RCTLogInfo(@"Logging Lemnisk Track event with event %@, properties: %@, otherIds: %@", event, properties, otherIds);
26
- [[Lemnisk shared] track:event properties:properties otherIds:otherIds];
27
- }
28
-
29
- RCT_EXPORT_METHOD(screen:(NSString *)name object:(NSDictionary *)properties object:(NSDictionary *)otherIds) {
30
- RCTLogInfo(@"Logging Lemnisk Screen event with name %@, properties: %@, otherIds: %@", name, properties, otherIds);
31
- [[Lemnisk shared] screen:name properties:properties otherIds:otherIds];
32
- }
33
-
34
- RCT_EXPORT_METHOD(registerForPushNotifications) {
35
- RCTLogInfo(@"calling registerForPushNotifications");
36
- [[Lemnisk shared] registerForPushNotifications];
37
- }
38
- @end
1
+ #import "LemniskSdk.h"
2
+ #import <Foundation/Foundation.h>
3
+ #import <React/RCTLog.h>
4
+ #import <Lemnisk/Lemnisk.h>
5
+
6
+ @implementation LemniskSdk
7
+
8
+ RCT_EXPORT_MODULE()
9
+
10
+ // Example method
11
+ // See // https://reactnative.dev/docs/native-modules-ios
12
+ // RCT_REMAP_METHOD
13
+ RCT_EXPORT_METHOD(createLemniskEvent:(NSString *)name object:(NSDictionary *)object) {
14
+ RCTLogInfo(@"Logging Lemnisk Event %@ object %@ ", name, object);
15
+ LemniskAnalytics *lemAnalytics = [LemniskAnalytics shared];
16
+ [lemAnalytics logActivityWithName:name traits:object];
17
+ }
18
+
19
+ RCT_EXPORT_METHOD(identify:(NSString *)userId object:(NSDictionary *)traits object:(NSDictionary *)otherIds) {
20
+ RCTLogInfo(@"Logging Lemnisk Identify event with userId %@, properties: %@, otherIds: %@", userId, traits, otherIds);
21
+ [[Lemnisk shared] identify:userId traits:traits otherIds:otherIds];
22
+ }
23
+
24
+ RCT_EXPORT_METHOD(track:(NSString *)event object:(NSDictionary *)properties object:(NSDictionary *)otherIds) {
25
+ RCTLogInfo(@"Logging Lemnisk Track event with event %@, properties: %@, otherIds: %@", event, properties, otherIds);
26
+ [[Lemnisk shared] track:event properties:properties otherIds:otherIds];
27
+ }
28
+
29
+ RCT_EXPORT_METHOD(screen:(NSString *)name object:(NSDictionary *)properties object:(NSDictionary *)otherIds) {
30
+ RCTLogInfo(@"Logging Lemnisk Screen event with name %@, properties: %@, otherIds: %@", name, properties, otherIds);
31
+ [[Lemnisk shared] screen:name properties:properties otherIds:otherIds];
32
+ }
33
+
34
+ RCT_EXPORT_METHOD(registerForPushNotifications) {
35
+ RCTLogInfo(@"calling registerForPushNotifications");
36
+ [[Lemnisk shared] registerForPushNotifications];
37
+ }
38
+ @end
@@ -1,21 +1,21 @@
1
- require 'json'
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
-
5
- Pod::Spec.new do |s|
6
- s.name = 'lemnisk-react-native'
7
- s.version = package['version']
8
- s.summary = package['description']
9
- s.homepage = package['homepage']
10
- s.license = package['license']
11
- s.authors = package['author']
12
-
13
- s.requires_arc = true
14
- s.platforms = { :ios => '10.0' }
15
- s.source = { :git => 'https://github.com/Immensitas/lemnisk-react', :tag => s.version }
16
-
17
- s.source_files = 'ios/**/*.{h,m,mm}'
18
-
19
- s.dependency 'React-Core'
20
- s.dependency 'Lemnisk-iOS-SDK', '3.8.5'
21
- end
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'lemnisk-react-native'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.homepage = package['homepage']
10
+ s.license = package['license']
11
+ s.authors = package['author']
12
+
13
+ s.requires_arc = true
14
+ s.platforms = { :ios => '10.0' }
15
+ s.source = { :git => 'https://github.com/Immensitas/lemnisk-react', :tag => s.version }
16
+
17
+ s.source_files = 'ios/**/*.{h,m,mm}'
18
+
19
+ s.dependency 'React-Core'
20
+ s.dependency 'Lemnisk-iOS-SDK', '3.7.7'
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';\r\n\r\nconst { LemniskSdk } = NativeModules;\r\n\r\n\r\nLemniskSdk.registerForPushNotifications = (title: string, message: string)=>{\r\n LemniskSdk.registerForPush(title, message);\r\n}\r\n\r\ntype LemniskSdkType = {\r\n createLemniskEvent(name: string, object: object): any;\r\n track(eventName: string, properties: object, otherIds: object): any;\r\n screen(name: string, properties: object, otherIds: object): any;\r\n identify(userId: string, properties: object, otherIds: object): any;\r\n registerForPushNotifications( title?: string, message?: string): any ;\r\n \r\n};\r\n\r\n\r\nexport default LemniskSdk as LemniskSdkType;\r\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';\r\n\r\nconst { LemniskSdk } = NativeModules;\r\n\r\n\r\nLemniskSdk.registerForPushNotifications = (title: string, message: string)=>{\r\n LemniskSdk.registerForPush(title, message);\r\n}\r\n\r\ntype LemniskSdkType = {\r\n createLemniskEvent(name: string, object: object): any;\r\n track(eventName: string, properties: object, otherIds: object): any;\r\n screen(name: string, properties: object, otherIds: object): any;\r\n identify(userId: string, properties: object, otherIds: object): any;\r\n registerForPushNotifications( title?: string, message?: string): any ;\r\n \r\n};\r\n\r\n\r\nexport default LemniskSdk as LemniskSdkType;\r\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"}
@@ -1,8 +1,9 @@
1
- type LemniskSdkType = {
2
- createLemniskEvent(name: string, object: object): any;
3
- track(eventName: string, properties: object, otherIds: object): any;
4
- screen(name: string, properties: object, otherIds: object): any;
5
- identify(userId: string, properties: object, otherIds: object): any;
6
- };
7
- declare const _default: LemniskSdkType;
8
- export default _default;
1
+ type LemniskSdkType = {
2
+ createLemniskEvent(name: string, object: object): any;
3
+ track(eventName: string, properties: object, otherIds: object): any;
4
+ screen(name: string, properties: object, otherIds: object): any;
5
+ identify(userId: string, properties: object, otherIds: object): any;
6
+ registerForPushNotifications(title?: string, message?: string): any;
7
+ };
8
+ declare const _default: LemniskSdkType;
9
+ export default _default;