react-native-flyy 1.4.35 → 1.4.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
137
|
+
implementation 'com.github.roid-software:flyy-sdk:1.4.54.73'
|
|
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(
|
|
693
|
+
fun trackUIEvents() {
|
|
691
694
|
Flyy.trackUIEvents(object : FlyyUIEventsListener {
|
|
692
695
|
override fun onEventDone(flyyUiEvent: FlyyUIEvent?) {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
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
|
}
|
package/ios/ReactNativeFlyy.h
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
|
+
#import <React/RCTEventEmitter.h>
|
|
2
3
|
|
|
3
|
-
@interface ReactNativeFlyy :
|
|
4
|
+
@interface ReactNativeFlyy : RCTEventEmitter <RCTBridgeModule>
|
|
4
5
|
|
|
5
6
|
- (void)set_navigation_controller:(UINavigationController*)navigation withCurrentViewController:(UIViewController*) controller;
|
|
6
7
|
|
package/ios/ReactNativeFlyy.m
CHANGED
|
@@ -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
|
|
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