react-native-flyy 1.4.35 → 1.4.37

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.
@@ -134,7 +134,7 @@ dependencies {
134
134
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
135
135
 
136
136
  //Flyy sdk dependency
137
- implementation 'com.github.roid-software:flyy-sdk:1.4.51.1'
137
+ implementation 'com.github.roid-software:flyy-sdk:1.4.54.78'
138
138
  // implementation project(path: ':flyy')
139
139
 
140
140
  implementation 'com.google.code.gson:gson:2.8.7'
@@ -17,11 +17,13 @@ import theflyy.com.flyy.model.externals.FlyyReferrerDetails
17
17
  import theflyy.com.flyy.model.externals.FlyyScrachCardCount
18
18
  import theflyy.com.flyy.model.externals.FlyySpecificWalletData
19
19
  import java.util.*
20
+ import com.facebook.react.modules.core.DeviceEventManagerModule
20
21
 
21
22
 
22
23
  class FlyyModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
23
24
 
24
25
  private var context: Context? = reactContext.applicationContext
26
+ private var mReactContext: ReactContext? = null
25
27
 
26
28
  var STAGE = "STAGE"
27
29
  var PRODUCTION = "PRODUCTION"
@@ -36,6 +38,7 @@ class FlyyModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
36
38
 
37
39
  init {
38
40
  context = reactContext.applicationContext
41
+ mReactContext = reactContext
39
42
  }
40
43
 
41
44
  @ReactMethod
@@ -154,7 +157,7 @@ class FlyyModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
154
157
  })
155
158
  }
156
159
 
157
-
160
+
158
161
 
159
162
  @ReactMethod
160
163
  fun setNewUserWithSegment(externalUserId: String?, segmentId: String?, successCallBack: Callback) {
@@ -168,7 +171,7 @@ class FlyyModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
168
171
  extUid = externalUserId
169
172
  Flyy.setUser(externalUserId)
170
173
  }
171
-
174
+
172
175
  @ReactMethod
173
176
  fun setUserWithCallBack(externalUserId: String?, promise: Promise) {
174
177
  extUid = externalUserId
@@ -687,18 +690,21 @@ fun getPreviousLeaderboardWinners(tag: String, callBack: Callback) {
687
690
  }
688
691
 
689
692
  @ReactMethod
690
- fun trackUIEvents(callBack: Callback) {
693
+ fun trackUIEvents() {
691
694
  Flyy.trackUIEvents(object : FlyyUIEventsListener {
692
695
  override fun onEventDone(flyyUiEvent: FlyyUIEvent?) {
693
- val resultData: WritableMap = WritableNativeMap()
694
- resultData.putInt("campaign_id", flyyUiEvent?.campaignID!!)
695
- resultData.putString("campaign_name", flyyUiEvent.campaignName)
696
- resultData.putInt("wallet_type", flyyUiEvent.walletType)
697
- resultData.putString("wallet_label", flyyUiEvent.walletLabel)
698
- resultData.putString("user_id", flyyUiEvent.userID)
699
- resultData.putString("actionEvent_name", flyyUiEvent.actionEventName)
700
- resultData.putInt("created_at", flyyUiEvent.createdAt.toInt())
701
- callBack.invoke(resultData)
696
+ if (flyyUiEvent != null) {
697
+ val resultData: WritableMap = WritableNativeMap()
698
+ resultData.putInt("campaignID", flyyUiEvent.campaignID?: -1)
699
+ resultData.putString("campaignName", flyyUiEvent.campaignName?: "N/A")
700
+ resultData.putInt("walletType", flyyUiEvent.walletType?: -1)
701
+ resultData.putString("walletLabel", flyyUiEvent.walletLabel?: "N/A")
702
+ resultData.putString("userID", flyyUiEvent.userID)
703
+ resultData.putString("actionEventName", flyyUiEvent.actionEventName)
704
+ resultData.putInt("createdAt", flyyUiEvent.createdAt.toInt())
705
+ mReactContext?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
706
+ ?.emit("FlyyScreenTracking", resultData)
707
+ }
702
708
  }
703
709
  })
704
710
  }
@@ -1,6 +1,7 @@
1
1
  #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTEventEmitter.h>
2
3
 
3
- @interface ReactNativeFlyy : NSObject <RCTBridgeModule>
4
+ @interface ReactNativeFlyy : RCTEventEmitter <RCTBridgeModule>
4
5
 
5
6
  - (void)set_navigation_controller:(UINavigationController*)navigation withCurrentViewController:(UIViewController*) controller;
6
7
 
@@ -1,7 +1,7 @@
1
1
  #import "ReactNativeFlyy.h"
2
2
  #import "FlyyFramework/FlyyFramework.h"
3
3
 
4
- @interface ReactNativeFlyy ()<FlyySDKClosedListener> {
4
+ @interface ReactNativeFlyy ()<FlyySDKClosedListener,FlyySDKUiEventListener> {
5
5
  Flyy *flyy;
6
6
  }
7
7
 
@@ -703,10 +703,11 @@ RCT_EXPORT_METHOD(getLeaderboardParticipants: (NSString *)tag :(RCTResponseSende
703
703
  }
704
704
 
705
705
  //track ui events
706
- RCT_EXPORT_METHOD(trackUIEvents: (RCTResponseSenderBlock)callback)
706
+ RCT_EXPORT_METHOD(trackUIEvents)
707
707
  {
708
708
  //Instance of flyy class
709
709
  flyy = [Flyy sharedFlyyInstance];
710
+ [flyy trackUIEventsWithFlyysdkuieventlistener:self];
710
711
  }
711
712
 
712
713
 
@@ -1204,4 +1205,21 @@ RCT_EXPORT_METHOD(getAppData:(RCTPromiseResolveBlock)resolve
1204
1205
  };
1205
1206
  }
1206
1207
 
1208
+ // Override the supportedEvents method
1209
+ - (NSArray<NSString *> *)supportedEvents {
1210
+ return @[@"FlyyScreenTracking"];
1211
+ }
1212
+
1213
+ - (void)onSDKTrackUiEventWithCampaignName:(NSString * _Nonnull)campaignName campaignID:(NSInteger)campaignID walletType:(NSInteger)walletType userID:(NSString * _Nonnull)userID actionEventName:(NSString * _Nonnull)actionEventName walletLabel:(NSString * _Nonnull)walletLabel createdAt:(NSString * _Nonnull)createdAt {
1214
+ NSDictionary* jsonObject = @{ @"campaignID": [NSNumber numberWithInt: campaignID],
1215
+ @"campaignName": campaignName,
1216
+ @"walletType": [NSNumber numberWithInt: walletType],
1217
+ @"walletLabel": walletLabel,
1218
+ @"userID": userID,
1219
+ @"actionEventName": actionEventName,
1220
+ @"createdAt": createdAt
1221
+ };
1222
+ [self sendEventWithName:@"FlyyScreenTracking" body:@{@"name": jsonObject}];
1223
+ }
1224
+
1207
1225
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-flyy",
3
- "version": "1.4.35",
3
+ "version": "1.4.37",
4
4
  "description": "React Native wrapper around our Android and iOS mobile SDKs",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -65,7 +65,7 @@
65
65
  "pod-install": "^0.1.0",
66
66
  "prettier": "^2.0.5",
67
67
  "react": "17.0.2",
68
- "react-native": "0.68.1",
68
+ "react-native": "0.67.5",
69
69
  "react-native-builder-bob": "^0.17.1",
70
70
  "release-it": "^14.2.2",
71
71
  "typescript": "^4.1.3"
@@ -629,19 +629,19 @@
629
629
  "meow": "^8.1.0",
630
630
  "merge-stream": "^2.0.0",
631
631
  "merge2": "^1.4.1",
632
- "metro": "^0.58.0",
633
- "metro-babel-register": "^0.59.0",
634
- "metro-babel-transformer": "^0.58.0",
635
- "metro-cache": "^0.58.0",
636
- "metro-config": "^0.58.0",
637
- "metro-core": "^0.58.0",
638
- "metro-inspector-proxy": "^0.58.0",
639
- "metro-minify-uglify": "^0.58.0",
640
- "metro-react-native-babel-preset": "^0.58.0",
641
- "metro-react-native-babel-transformer": "^0.59.0",
642
- "metro-resolver": "^0.58.0",
643
- "metro-source-map": "^0.58.0",
644
- "metro-symbolicate": "^0.58.0",
632
+ "metro": "^0.66.2",
633
+ "metro-babel-register": "^0.66.2",
634
+ "metro-babel-transformer": "^0.66.2",
635
+ "metro-cache": "^0.66.2",
636
+ "metro-config": "^0.66.2",
637
+ "metro-core": "^0.66.2",
638
+ "metro-inspector-proxy": "^0.66.2",
639
+ "metro-minify-uglify": "^0.66.2",
640
+ "metro-react-native-babel-preset": "^0.66.2",
641
+ "metro-react-native-babel-transformer": "^0.66.2",
642
+ "metro-resolver": "^0.66.2",
643
+ "metro-source-map": "^0.66.2",
644
+ "metro-symbolicate": "^0.66.2",
645
645
  "micromatch": "^4.0.2",
646
646
  "mime": "^2.4.7",
647
647
  "mime-db": "^1.45.0",
@@ -677,7 +677,7 @@
677
677
  "nullthrows": "^1.1.1",
678
678
  "nwsapi": "^2.2.0",
679
679
  "oauth-sign": "^0.9.0",
680
- "ob1": "^0.58.0",
680
+ "ob1": "^0.66.2",
681
681
  "object-assign": "^4.1.1",
682
682
  "object-copy": "^0.1.0",
683
683
  "object-inspect": "^1.9.0",
@@ -18,5 +18,5 @@ Pod::Spec.new do |s|
18
18
 
19
19
 
20
20
  s.dependency "React-Core"
21
- s.dependency "FlyyFramework", "1.3.72"
21
+ s.dependency "FlyyFramework", "1.3.73"
22
22
  end